liveBook · Manning

Class activation heatmap

As explained in Deep Learning with R, Third Edition

Class activation map visualization is a technique that produces spatial heatmaps indicating which input locations support a model's predicted class.

A class activation heatmap is a spatial grid showing which image locations support a model’s prediction for a chosen class. It helps interpret classification decisions, debug mistakes, and locate objects. section 10.3

Grad-CAM builds the heatmap from a convolutional layer’s output: it weights each feature-map channel by the class gradient, then combines the weighted channels into a spatial activation map. section 10.3

African elephants

For an image containing two African elephants, the model predicts African elephant with high probability. The resulting heatmap highlights elephant regions; strong activation around the calf’s ears suggests a feature supporting the distinction from Indian elephants. section 10.3.4

How Deep Learning with R, Third Edition covers it

How deep it goes
Explains Grad-CAM through feature maps, gradients, pooling, channel weighting, and image overlays without deriving the method mathematically.
Examples
Demonstrates an Xception prediction and heatmap for two African elephants, including an overlay and attention to the calf’s ears.
What it assumes
Assumes an image-classification model with an accessible convolutional layer and a selected output class.
What you can do after
Diagnoses image-classification decisions with Grad-CAM using R, KerasHub, convolutional outputs, gradients, and visual overlays.
How it connects
Connects convolutional layers, feature maps, gradients, image classification, model interpretability, and object localization.

Also explained in

Compare how 2 books explain class activation heatmap →

Related concepts

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