Source-linked AI summary
Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization
Ramprasaath R. Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, Dhruv Batra
TL;DR
CNNs can be difficult to interpret, making it hard to understand why they produce particular decisions. Grad-CAM uses gradients flowing into the final convolutional layer to create visual explanations, and evaluations report that its visualizations outperform existing approaches in interpretability and faithfulness.
Problem
CNNs can be difficult to interpret, limiting users’ ability to understand why they produce particular decisions.
Source: §1 · p. 2, Interpretability matters · p. 2Method
Grad-CAM uses gradients flowing into a CNN’s final convolutional layer to generate class-discriminative visual explanations without architectural changes or retraining.
Source: Interpretability matters · p. 2, §3 · p. 4Results
Grad-CAM visualizations outperform existing approaches in interpretability and faithfulness, while human studies find improved class discrimination and exposure of classifier trustworthiness and dataset biases.
Source: §9 · p. 13Takeaways & Limitations
The visualizations provide insight into CNN failure explanations and show that captioning and VQA models can localize discriminative image regions without grounded image-text training.
Source: Interpretability matters · p. 2
Abstract
from arXiv · showhide
We propose a technique for producing "visual explanations" for decisions from a large class of CNN-based models, making them more transparent. Our approach - Gradient-weighted Class Activation Mapping (Grad-CAM), uses the gradients of any target concept, flowing into the final convolutional layer to produce a coarse localization map highlighting important regions in the image for predicting the concept. Grad-CAM is applicable to a wide variety of CNN model-families: (1) CNNs with fully-connected layers, (2) CNNs used for structured outputs, (3) CNNs used in tasks with multimodal inputs or reinforcement learning, without any architectural changes or re-training. We combine Grad-CAM with fine-grained visualizations to create a high-resolution class-discriminative visualization and apply it to off-the-shelf image classification, captioning, and visual question answering (VQA) models, including ResNet-based architectures. In the context of image classification models, our visualizations (a) lend insights into their failure modes, (b) are robust to adversarial images, (c) outperform previous methods on localization, (d) are more faithful to the underlying model and (e) help achieve generalization by identifying dataset bias. For captioning and VQA, we show that even non-attention based models can localize inputs. We devise a way to identify important neurons through Grad-CAM and combine it with neuron names to provide textual explanations for model decisions. Finally, we design and conduct human studies to measure if Grad-CAM helps users establish appropriate trust in predictions from models and show that Grad-CAM helps untrained users successfully discern a 'stronger' nodel from a 'weaker' one even when both make identical predictions. Our code is available at https://github.com/ramprs/grad-cam/, along with a demo at http://gradcam.cloudcv.org, and a video at youtu.be/COjUB9Izk6E.
1 Introduction
CNN-based models have achieved breakthroughs across many computer-vision tasks, but their lack of intuitive, decomposable components makes them difficult to interpret. When they fail, users may receive incoherent outputs without an explanation.
- CNNs have enabled breakthroughs in image classification [24], detection [21], segmentation [37], captioning [55] [7] [18] [29], VQA [20] [42] [46], visual dialog [13] [12], and embodied question answering [10] [23].Source: §1 · p. 1
- Because deep models lack decomposition into individually intuitive components, their decisions are hard to interpret and failures can leave users without an explanation.Source: §1 · p. 2
Interpretability matters.
Interpretability can help diagnose weak AI, establish user trust in deployable systems, and support machine teaching by stronger systems. Grad-CAM aims to make deep models more explainable while retaining their architectures and broad applicability.
- Guided Grad-CAM fuses pixel-space gradient visualizations with Grad-CAM to produce explanations that are both high-resolution and class-discriminative.For the “tiger cat” class, it highlights fine-grained features such as the cat’s stripes.Source: Interpretability matters · p. 2
- Grad-CAM provides class-discriminative localization for CNNs without architectural changes or retraining, and outperforms baselines in localization and model faithfulness.It generalizes CAM [59], which was limited to image-classification CNNs without fully connected layers and traded model complexity and performance for transparency.Source: Interpretability matters · p. 2
- Applied to top-performing classification, captioning, and VQA models, Grad-CAM reveals classification failure modes and shows CNN+LSTM models can localize discriminative regions without grounded image-text training.The paper also presents ResNet visualizations for image classification and VQA.Source: Interpretability matters · p. 2
- A proof of concept shows Grad-CAM visualizations can uncover dataset biases, helping diagnose failure modes and support generalization and fair, bias-free outcomes.Source: Interpretability matters · p. 2
- Combining Grad-CAM neuron importance with neuron names [4] yields textual explanations for model decisions.Source: Interpretability matters · p. 3
- Human studies show Guided Grad-CAM helps users establish trust and lets untrained users distinguish stronger from weaker networks even when both predict identically.The studies also show that Guided Grad-CAM explanations are class-discriminative.Source: Interpretability matters · p. 3
2 Related Work
Related work situates Grad-CAM among CNN visualization, model-trust assessment, and weakly supervised localization, highlighting its distinction from class-indiscriminative saliency methods and architecture-restricted CAM.
Visualizing CNNs
- Pixel-gradient methods highlight influential pixels, but their visualizations are not class-discriminative and can look nearly identical across classes.Other approaches synthesize high-resolution, class-discriminative images or invert latent representations, but do not explain a single input image.Source: §2 · p. 3
Assessing Model Trust
- Human studies, motivated by interpretability and model-trust assessment, evaluate whether Grad-CAM visualizations help users assess and place trust in automated systems.Source: §2 · p. 3
Aligning Gradient-based Importances
- Follow-up work uses Grad-CAM’s gradient-based neuron importances to connect model decisions with human-provided class knowledge and attention maps.The cited approaches target novel-class classifiers and grounding vision-language models, respectively.Source: §2 · p. 3
Weakly-supervised localization
- Weakly supervised localization aims to localize image objects using only holistic image class labels.Source: §2 · p. 3
- CAM requires modified CNNs with global-average pooling, while Grad-CAM uses gradients without architectural changes and applies to captioning and VQA; CAM is its fully convolutional special case.CAM and related methods use global-max or log-sum-exp pooling. [45]Source: §2 · pp. 3–4
- Perturbation-based localization is less efficient than Grad-CAM’s single forward and partial backward pass; c-MWP is more computationally expensive, classification-only, and outperformed by Grad-CAM.The paper reports quantitative and qualitative comparisons with c-MWP in Sections 4.1 and D.Source: §2 · p. 4
3 Grad-CAM
Grad-CAM uses gradients flowing into convolutional feature maps to localize regions supporting a target decision. Its extensions generalize CAM, add high-resolution visual detail, and provide counterfactual explanations.
3 Grad-CAM
- Grad-CAM averages class-score gradients over spatial locations to weight convolutional feature maps, then applies ReLU to highlight positive, class-supporting regions.The resulting localization map is coarse and matches the convolutional feature-map resolution.Source: §3 · pp. 4–5
- Grad-CAM explains any differentiable target activation, including caption words or question-answer scores; global-average pooling worked better than global-max pooling.Maps become progressively worse at earlier convolutional layers, which have smaller receptive fields and less semantic features.Source: §3 · pp. 4–5, §3.1 · p. 5
3.1 Grad-CAM generalizes CAM
- Grad-CAM strictly generalizes CAM beyond its specialized image-classification architecture to CNNs with complex interactions, including captioning and VQA.CAM uses global-average-pooled convolutional maps fed directly to a softmax classifier.Source: §3.1 · p. 5
3.2 Guided Grad-CAM
- Guided Grad-CAM multiplies bilinearly upsampled Grad-CAM by Guided Backpropagation, combining class-discriminative localization with high-resolution feature details.For “tiger cat,” it highlights stripes, pointy ears, and eyes; Deconvolution produced similar but artifact-prone, noisier visualizations.Source: §3.2 · p. 6
3.3 Counterfactual Explanations
- Counterfactual explanations negate the class-score gradients to highlight regions whose concept removal would make the model more confident in its prediction.They are formed by weighting forward activation maps with the negated-gradient importance weights and applying ReLU.Source: §3.3 · p. 6
4 Evaluating Localization Ability of Grad-CAM
Grad-CAM provides weakly supervised localization cues that improve localization and segmentation results, and it outperforms c-MWP in a modified Pointing Game evaluation.
4.1 Weakly-supervised Localization
- Grad-CAM significantly improves top-1 and top-5 localization errors over c-MWP [58] and Simonyan et al. [51], while VGG-16 beats CAM [59] without reducing classification performance.Localization maps are thresholded at 15% of maximum intensity, and a bounding box is drawn around the largest connected segment; the models were not trained with bounding-box annotations. CAM also has 2.98% worse top-1 classification error.Source: Table 1 · p. 6, §4.1 · p. 6
4.2 Weakly-supervised Segmentation
- Grad-CAM seeds improve PASCAL VOC 2012 segmentation IoU to 49.6, compared with 44.6 using CAM.The Grad-CAM maps replace CAM maps as seeds for the SEC weakly supervised segmentation method [32].Source: §4.2 · p. 7
4.3 Pointing Game
- Grad-CAM outperforms c-MWP [58] in the modified Pointing Game, scoring 70.58% versus 60.30%.The modification evaluates top-5 class predictions and counts correctly rejected predictions absent from the ground-truth categories as hits.Source: §4.3 · p. 7
5 Evaluating Visualizations
The section evaluates Grad-CAM visualizations through human studies of class discrimination and trust, plus an occlusion-based test of faithfulness to the model.
5.1 Evaluating Class Discrimination
- Guided Grad-CAM yielded 61.23% human category-identification accuracy versus 44.44% for Guided Backpropagation, a 16.79% gain; Grad-CAM raised Deconvolution from 53.33% to 60.37%.The study used 360 visualizations from 90 image-category pairs, with nine ratings per image.Source: §5.1 · p. 7, Table 2 · p. 8
- Deconvolution was more class-discriminative than Guided Backpropagation (53.33% vs. 44.44%), although Guided Backpropagation was judged more aesthetically pleasing.The authors report this as the first quantification of that difference.Source: §5.1 · p. 8
5.2 Evaluating Trust
- When both models made the same correct prediction, workers rated VGG-16 more reliable than AlexNet: 1.27 with Guided Grad-CAM versus 1.00 with Guided Backpropagation.The study tested whether explanations reveal model reliability independently of prediction correctness.Source: §5.2 · p. 8
5.3 Faithfulness vs. Interpretability
- Across 2,510 PASCAL 2007 validation images, rank correlation with occlusion was 0.254 for Grad-CAM and 0.261 for Guided Grad-CAM, versus 0.168 Guided Backpropagation, 0.220 c-MWP, and 0.208 CAM.The authors frame faithfulness as a trade-off with interpretability and use image occlusion as a high-local-faithfulness reference.Source: §5.3 · p. 8
6 Diagnosing image classification CNNs with Grad-CAM
The section uses Grad-CAM with VGG-16 to inspect image-classification errors, adversarial perturbations, and dataset bias, showing how visualizations can expose model behavior and guide bias reduction.
6.1 Analyzing failure modes for VGG-16
- Guided Grad-CAM’s high-resolution, class-discriminative maps made VGG-16’s top-1 and top-5 errors interpretable, exposing ImageNet ambiguities and seemingly unreasonable but explicable predictions.Source: Figure 6 · p. 9, §6.1 · p. 9
6.2 Effect of adversarial noise on VGG-16
- Despite >0.9999 confidence in the absent “airliner” class, Grad-CAM localized the original “tiger cat” and “boxer” categories, indicating robustness to adversarial noise.Source: Figure 7 · p. 9, §6.2 · p. 9
6.3 Identifying bias in dataset
- Grad-CAM exposed reliance on faces and hairstyles, leading to female-doctor and male-nurse errors; search results were skewed, with 78% of doctor images men and 93% of nurse images women.Source: §6.3 · pp. 9–10
- 90% test accuracy after rebalancing, versus 82% test accuracy before, shows Grad-CAM-guided additions of male nurses and female doctors improved generalization.The retrained model also looked at appropriate image regions.Source: §6.3 · pp. 9–10
7 Textual Explanations with Grad-CAM
Grad-CAM textual explanations pair class-specific neuron importance with concept names to describe the concepts associated with a prediction. Examples show agreement between visual and textual explanations, alongside a misclassification and a limitation caused by filtering neuron names.
7 Textual Explanations with Grad-CAM
- Positive neuron importance indicates that a concept’s presence raises the class score, whereas negative importance indicates that its absence raises the score.The importance values are obtained from Equation (1).Source: §7 · p. 10
- Using Bau et al. [4]’s neuron-naming approach, explanations rank last-convolutional-layer neurons by class-specific importance and report the names of the top-5 and bottom-5.The names represent concepts that the neurons detect in images.Source: §7 · p. 10
- For VGG-16 on Places365, visual and textual explanations highlight water and stratified for waterfall, while Book-store explanations emphasize book and shelf positively and absent concepts negatively.The absent concepts include sky, road, water, and car.Source: §7 · p. 10
- In a misclassification as rope-bridge, the important concepts water and bridge still indicate the predicted class despite the absence of a rope.Source: §7 · p. 10
- For Elevator door, Grad-CAM correctly highlights the door and staircase, but door-detecting neurons are omitted from textual explanations because they fail the IoU threshold of 0.05.The threshold was chosen to suppress noise in neuron names.Source: §7 · p. 10
8 Grad-CAM for Image Captioning and VQA
Grad-CAM provides class-discriminative visual explanations for image captioning and VQA, including models without explicit attention. The section evaluates its localization and faithfulness against region annotations, human attention, and occlusion maps.
8.1 Image Captioning
- Without explicit attention, Grad-CAM localizes objects mentioned in generated captions, including small kites and people, while excluding nearby objects not named.The caption model computes gradients of caption log probability with respect to the CNN’s final convolutional layer.Source: §8.1 · pp. 10–11
- 6.38 ± 0.99 (Guided Grad-CAM), 3.27 ± 0.18 (Grad-CAM), and 2.32 ± 0.08 (Guided Backpropagation) exceed the 1.0 uniform baseline for localizing DenseCap regions.The holistic captioning model was never trained with bounding-box annotations.Source: §8.1 · p. 11, Figure 10 · p. 11
8.1.1 Grad-CAM for individual words of caption
- On 1,000 COCO images, word-level Grad-CAM achieves 30.0% pointing accuracy against segmentation maps for the corresponding object categories.The maps serve as human attention, and accuracy measures whether the maximally activated point falls within the relevant segmentation.Source: §8.1.1 · p. 12
8.2 Visual Question Answering
- Grad-CAM’s VQA rank correlation with occlusion maps is 0.60 ± 0.038 versus 0.42 ± 0.038 for Guided Backpropagation; its correlation with human attention is 0.136, above chance.The human-attention comparison used 1,374 validation question-image pairs; the models were not trained on grounded image-text pairs.Source: §8.2 · pp. 12–13
- For a ResNet-based hierarchical co-attention VQA model, Grad-CAM changes little across most adjacent layers and more across dimensionality-reduction layers.The paper reports visualizing decisions from ResNet-based models for the first time.Source: §8.2 · p. 13
9 Conclusion · Appendix · A Appendix Overview
The conclusion presents Grad-CAM and Guided Grad-CAM as visual explanation methods for CNN decisions, with applications across several tasks and avenues for future work. The appendix lists supplementary studies, evaluations, and examples.
9 Conclusion
- Grad-CAM produces class-discriminative localization maps, while combining them with high-resolution visualization techniques yields Guided Grad-CAM explanations.The paper describes Guided Grad-CAM as combining high resolution with class discrimination.Source: §9 · p. 13
- The authors report that their visualizations outperform existing approaches in interpretability and faithfulness, while human studies show benefits for class discrimination, trust assessment, and identifying dataset biases.The studies also indicate that the visualizations help users discern classifier trustworthiness.Source: §9 · p. 13
- The paper proposes using Grad-CAM to identify important neurons and provide textual explanations for model decisions.Source: §9 · p. 13
- Grad-CAM is demonstrated on off-the-shelf image classification, image captioning, and visual question answering models; future work includes reinforcement learning, natural language processing, and video.Source: §9 · p. 13
A Appendix Overview
- The appendix lists ablation studies, additional qualitative image-classification examples, and more details on the Pointing Game evaluation technique.Source: A Appendix Overview · pp. 13–14
- The appendix also lists qualitative comparisons with existing visualization techniques and additional qualitative examples of textual explanations.Source: A Appendix Overview · pp. 13–14
B Ablation studies … E Qualitative comparison to Excitation Backprop (c-MWP) and CAM
The supplemental sections examine how Grad-CAM design choices affect localization and show qualitative explanations across image classification, captioning, and VQA. They also report a pointing-game comparison and discuss qualitative differences from CAM and c-MWP.
1. Grad-CAM for different layers
- Grad-CAM localization worsens at earlier convolutional layers because they capture less semantic information than deeper layers while retaining spatial information.The layer comparison is shown for AlexNet and VGG-16; the figure caption describes VGG16 visualizations.Source: §1 · p. 14, Figure 13 · p. 15
2. Design choices
- Removing ReLU increases localization error by 15.3%, and Global Max Pooling lowers localization ability relative to Global Average Pooling.The ablations assess layers, ReLU, gradient types, and gradient pooling strategies; the table evaluates top-1 localization errors on ILSVRC-15 validation over 10 crops.Source: §2.1 · p. 14, §2.2 · p. 14, B Ablation studies · p. 14
2.3. Effect of different ReLU on Grad-CAM
- Guided-ReLU [53] marginally improves localization but reduces class-discriminativeness, while Deconv-ReLU [57] performs worse, indicating negative gradients carry class-discriminative information.The variants modify the backward pass of ReLU; visual comparisons are shown in Fig. 16.Source: §2.3 · p. 14, Figure 16 · p. 15
1. Image Classification
- On COCO images with multiple objects, Grad-CAM localizes predicted classes, while Guided Grad-CAM can highlight tiny objects and distinguish a toilet seat from a dog.The examples include a correctly localized torch despite its small size and unusual location.Source: §1 · p. 14, Figure 17 · p. 16
2. Image Captioning
- For image captioning, Grad-CAM provides coarse localization that Guided Backpropagation combines into a high-resolution visualization of regions supporting the generated caption.The experiments use Neuraltalk2, which encodes images with VGG16 and generates captions with an LSTM.Source: §2 · p. 15
3. Visual Question Answering (VQA)
- VQA visualizations reveal when models rely on context or attend to relevant regions, helping assess predictions without architectural changes or accuracy loss.AlexNet answered “Tennis ball” without looking at the ball; for the waves question, AlexNet and VGG-16 focused on the person while VGG-19 correctly attended around the man.Source: §3 · p. 16
D More details of Pointing Game
- 70.58% vs 60.30%: Grad-CAM outperforms c-MWP on VGG-16 in the modified top-5 pointing game.The test classifies whether a top-5 category is present using the map’s maximum value, with a rejection option for absent categories.Source: D More details of Pointing Game · pp. 16, 20
E Qualitative comparison to Excitation Backprop (c-MWP) and CAM
- Grad-CAM and c-MWP can visualize existing ImageNet-trained VGG-16 models fine-tuned on PASCAL VOC 2012, whereas CAM requires architectural changes and retraining and is classification-only.The passage notes that CAM retraining leads to loss in accuracy.Source: Figure 20 · p. 19, E Qualitative comparison to Excitation… · p. 20
F Visual and Textual explanations for Places dataset · G Analyzing Residual Networks
The Places examples show visual and textual explanations for VGG-16, while the ResNet analysis finds that Grad-CAM localization depends on layer depth and spatial resolution.
F Visual and Textual explanations for Places dataset
- The Places365 examples show visual and textual explanations for the VGG-16 image-classification model.The paper points to these as additional examples of explanations discussed in Section 7.Source: F Visual and Textual explanations for… · p. 20
- The figure reports that Grad-CAM's discriminative ability decreases as downsampling layers are encountered.In the ResNet examples, localization also fails in earlier residual sets with different spatial resolutions.Source: Figure 22 · p. 21, G Analyzing Residual Networks · p. 21
G Analyzing Residual Networks
- The analysis applies Grad-CAM to the 200-layer ResNet architecture trained on ImageNet10.The paper identifies its 200-layer architecture as coming from facebook/fb.resnet.torch.Source: G Analyzing Residual Networks · p. 21
- ResNets [24] typically comprise residual blocks, with some blocks using identity skip connections between layers of identical dimensions.These blocks are interspersed with downsampling modules that alter the propagating signal's dimensions.Source: G Analyzing Residual Networks · p. 21
- Grad-CAM localizes the cat and dog at the last convolutional layer but fails in earlier residual sets with different spatial resolutions; similar trends appear in 18- and 50-layer ResNets.The figure notes a reduction in discriminative ability as downsampling layers are encountered.Source: G Analyzing Residual Networks · p. 21, Figure 22 · p. 21
- Grad-CAM correctly visualizes the cat and dog in residual blocks of the final set.This contrasts with its failure to localize the categories in earlier sets.Source: G Analyzing Residual Networks · p. 21
Related papers
This paper cites
- Very Deep Convolutional Networks for Large-Scale Image Recognition2014
- Microsoft COCO: Common Objects in Context2014
- Rethinking the Inception Architecture for Computer Vision2015
- Striving for Simplicity: The All Convolutional Net2014
- Object Detectors Emerge in Deep Scene CNNs2014
- Ask Your Neurons: A Neural-based Approach to Answering Questions about Images2015
Cited by
- Bridging Neural Representations and Symbolic Semantics in Audio Classification2026
- Does Federated Training Degrade Explainability? A Comparative Analysis of Grad-CAM Faithfulness in Centralized vs. Federated Deepfake Detection2026
- Assessing feature scorer results on high-dimensional datasets with t-SNE2026
- INTR++: INterpretable TRansformer with better Accuracy, Interpretability, and Adaptability2026
- Drop the Details, Get the Gist: Dynamic Conceptual Representation for Video Recognition2026
- Seeing Through Distractions: Context-Stable Attribution via the Least Core2026