GradCAM is a technique for explaining the output of a vision system by checking the gradients in the ๐๏ธ Convolutional Neural Network layers to produce a localization of the outputโa heatmap explaining which part of the image most contributed to the output.
The key idea is that for some target class
and compute the localization for a class as
Intuitively,
Applications
GradCAM is an extremely versatile technique that can be used for a variety of applications in prediction and interpretation.
- Weighting guided backpropagation with GradCAM weights gives us more localized pixel-wise explanations (Guided GradCAM).
- Taking the negative of the gradients for the weights gives us counterfactual localizationโregions which, if removed, would increase confidence for our target.
- Combining GradCAM output with weakly-supervised methods can give localization bounding boxes or segmentation masks.
- Visualized localizations can be used to increase trust, debug failure modes, and find biases.