Grad-CAM: Visual Explanations from Deep Networks via Gradient-Based Localization
Ramprasaath R. Selvaraju,Michael Cogswell,Abhishek Das,Ramakrishna Vedantam,Devi Parikh,Dhruv Batra
DOI: https://doi.org/10.1007/s11263-019-01228-7
IF: 13.369
2019-10-11
International Journal of Computer Vision
Abstract:We propose a technique for producing 'visual explanations' for decisions from a large class of Convolutional Neural Network (CNN)-based models, making them more transparent and explainable. Our approach—Gradient-weighted Class Activation Mapping (Grad-CAM), uses the gradients of any target concept (say 'dog' in a classification network or a sequence of words in captioning network) flowing into the final convolutional layer to produce a coarse localization map highlighting the important regions in the image for predicting the concept. Unlike previous approaches, Grad-CAM is applicable to a wide variety of CNN model-families: (1) CNNs with fully-connected layers (<em class="EmphasisTypeItalic">e.g.</em>VGG), (2) CNNs used for structured outputs (<em class="EmphasisTypeItalic">e.g.</em>captioning), (3) CNNs used in tasks with multi-modal inputs (<em class="EmphasisTypeItalic">e.g.</em>visual question answering) or reinforcement learning, all <em class="EmphasisTypeItalic">without architectural changes or re-training</em>. We combine Grad-CAM with existing fine-grained visualizations to create a high-resolution class-discriminative visualization, Guided Grad-CAM, and apply it to image classification, image captioning, and visual question answering (VQA) models, including ResNet-based architectures. In the context of image classification models, our visualizations (a) lend insights into failure modes of these models (showing that seemingly unreasonable predictions have reasonable explanations), (b) outperform previous methods on the ILSVRC-15 weakly-supervised localization task, (c) are robust to adversarial perturbations, (d) are more faithful to the underlying model, and (e) help achieve model generalization by identifying dataset bias. For image captioning and VQA, our visualizations show that even non-attention based models learn to localize discriminative regions of input image. We devise a way to identify important neurons through Grad-CAM and combine it with neuron names (Bau et al. in Computer vision and pattern recognition, 2017) to provide textual explanations for model decisions. Finally, we design and conduct human studies to measure if Grad-CAM explanations help users establish appropriate trust in predictions from deep networks and show that Grad-CAM helps untrained users successfully discern a 'stronger' deep network from a 'weaker' one even when both make identical predictions. Our code is available at <span class="ExternalRef"><a href="https://github.com/ramprs/grad-cam/"><span class="RefSource">https://github.com/ramprs/grad-cam/</span></a></span>, along with a demo on CloudCV (Agrawal et al., in: Mobile cloud visual media computing, pp 265–290. Springer, 2015) (<span class="ExternalRef"><a href="http://gradcam.cloudcv.org"><span class="RefSource">http://gradcam.cloudcv.org</span></a></span>) and a video at <span class="ExternalRef"><a href="http://youtu.be/COjUB9Izk6E"><span class="RefSource">http://youtu.be/COjUB9Izk6E</span></a></span>.
computer science, artificial intelligence