Anchor explanations for ImageNet
In this section, we will build a Python Alibi program that will produce anchors for images. Alibi is a library that contains several XAI resources.
We will use images from ImageNet to run the explainer.
We will build the program in the following order:
- Installing Alibi and importing the modules
- Loading an
InceptionV3
model - Downloading an image to explain
- Processing the image and making predictions
- Creating the anchor image explainer and displaying the visual explanations
Let's first install Alibi and import the modules.
Installing Alibi and importing the modules
To get started, open the Image_XAI_Anchor.ipynb
notebook for this chapter. This notebook is in the chapter directory of this book.
We will first install Alibi as follows:
# @title Install Alibi
try:
import alibi
except:
!pip install alibi
If Alibi is installed, the program will continue. However, when Colaboratory...