liveBook · Manning

Interpretability

As explained in Deep Learning with Python, Third Edition

The degree to which a model's behavior can be understood and interpreted by humans.

Interpretability asks why a ConvNet makes a particular prediction—for example, calling an image a fridge when it appears to show a truck. This matters when models complement human expertise, especially in medical imaging. ConvNets are unusually suitable for visualization because their learned representations correspond to visual concepts. section 10.0

Use these visualizations to inspect what the network learns and how it decides:

  • Visualize intermediate activations to see how successive layers transform an image and to infer what individual filters detect. section 10.0
  • Visualize filters to identify the visual patterns or concepts to which they respond. section 10.0
  • Use class activation heatmaps to identify image regions supporting a particular class and to localize objects. section 10.0 section 10.3
  • Inspect semantically organized image manifolds to find outliers, ambiguous images, and opportunities to improve training or evaluation data. section 10.0

Explaining an elephant prediction with Grad-CAM

A pretrained Xception model classifies an image of African elephants. Grad-CAM takes the output feature map from a convolution layer, weights each channel by the gradient of the target class, and produces a spatial heatmap showing where the image activates that class. The heatmap can reveal which regions supported the prediction and help debug a mistake. section 10.3

Figure 10.7 Test picture of African elephants
elephant

Use the African-elephant test image as the concrete input for prediction and heatmap interpretation. section 10.3

How Deep Learning with Python, Third Edition covers it

How deep it goes
Explains activations, filters, response maps, and Grad-CAM weighting, while stopping short of surveying every visualization technique.
Examples
Uses dogs-versus-cats heatmaps and a pretrained Xception classifier applied to African elephants.
What you can do after
Diagnose/debug with activation visualizations, filter responses, and Grad-CAM heatmaps.
How it connects
Connects interpretability with ConvNets, learned filters, intermediate activations, class activation maps, and image classification.

Also explained in

Compare how 16 books explain interpretability →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with Python, Third Edition. The section links point to the parts of the book it draws on.