Score-CAM: Score-Weighted Visual Explanations for Convolutional Neural Networks

Haofan Wang, Zifan Wang, Mengnan Du, Fan Yang, Zijian Zhang, Sirui Ding, Piotr Mardziel, Xia Hu

TL;DR

Score-CAM is a novel, gradient-free method for visualizing how Convolutional Neural Networks (CNNs) make decisions. By weighting activation maps based on their actual contribution to the model's output score rather than noisy gradients, it produces cleaner, more faithful saliency maps that outperform existing state-of-the-art techniques in both object recognition and localization.

What Problem Does This Paper Address?

Deep Neural Networks are notoriously "black boxes." To trust them in critical applications, we need to understand why they classify an image a certain way. Existing visual explanation methods generally fall into two camps:

  1. Gradient-based (e.g., Grad-CAM): These use the backpropagated gradient of a class score to highlight important regions. However, gradients are often visually noisy and suffer from "saturation" issues (where the gradient vanishes even if a feature is important).
  2. Perturbation-based (e.g., RISE): These mask parts of the input and observe changes in the output. While accurate, they are computationally expensive and often require thousands of random samples.

The authors identify a "False Confidence" issue in gradient-based methods: sometimes a region with a high gradient weight actually contributes very little to the final prediction score. Score-CAM aims to bridge the gap between these two worlds, providing the structural benefits of CAM-based methods without the reliability issues of gradients.

Methods

Score-CAM introduces a two-phase process to generate a saliency map:

  • Phase 1: Activation Extraction. The model performs a standard forward pass on an input image. The authors extract the activation maps from the last convolutional layer (though any layer can be used).
  • Phase 2: Score-Based Weighting. Instead of using gradients to weight these maps, Score-CAM treats each activation map as a mask.
  • Each map is upsampled to the original image size and normalized to a $[0, 1]$ range.
  • The original image is masked by these upsampled maps (via Hadamard product).
  • These masked images are fed back into the CNN to obtain a "target score" for the class of interest.
  • The Increase of Confidence (CIC)—the difference in score between the masked input and a baseline—becomes the weight for that specific activation map.

Finally, the result is a linear combination of the activation maps and their corresponding CIC weights, followed by a ReLU operation to keep only the features that positively influence the prediction.

Figure 3. Pipeline of our proposed Score-CAM. Activation maps are first extracted in Phase 1. Each activation then works as a mask on original image, and obtain its forward-passing score on the target class. Phase 2 repeats for N times where N is the number of activation maps. Finally, the result can be generated by linear combination of score-based weights and activation maps. Phase 1 and Phase 2 shares a same CNN module as feature extractor.

Datasets

The researchers evaluated Score-CAM using the ILSVRC2012 (ImageNet) validation set. They utilized a pre-trained VGG16 network as their primary base model, while also providing supplemental results on other architectures like AlexNet, ResNet (18, 34, 101), and Inception v3.

Key Insights and Ideas

  • Gradients are Not Enough: The paper demonstrates that gradient-based weights can be misleading. Figure 2 shows an example where a region with the highest gradient weight actually caused the lowest increase in the target score.
  • Normalization is Crucial: The authors found that using post-softmax scores (probabilities) as weights provides much better class discrimination than raw logits (pre-softmax). This allows the model to distinguish between multiple objects in a single image more effectively.
Figure 4. Visualization results of Vanilla Backpropagation [14], Guided Backpropagation [17], SmoothGrad [16], IntegrateGrad [18], Mask [6], RISE [9], Grad-CAM [12], Grad-CAM++ [4] and our proposed Score-CAM. More results are provided in Appendix.
  • Saliency as a Debugging Tool: Score-CAM can reveal dataset biases. For instance, the authors show an image of a bicycle classified as a "person." Score-CAM reveals the model is actually looking at the human rider to identify the "bicycle" class, suggesting the training set might have a bias where bicycles almost always appear with people.

Key Results

Score-CAM consistently outperformed Grad-CAM, Grad-CAM++, and perturbation methods like RISE across several metrics:

  • Faithfulness (Recognition): On the ImageNet validation set, Score-CAM achieved an Average Drop of 31.5% (lower is better) and an Average Increase of 30.6% (higher is better). For comparison, Grad-CAM scored 47.8% and 19.6% respectively.
  • Localization: In an "Energy-Based Pointing Game"—which measures how much of the saliency map's "energy" falls within the object's bounding box—Score-CAM achieved 63.7%, significantly higher than Grad-CAM's 48.1%.
  • Visual Quality: Qualitatively, Score-CAM produces much cleaner heatmaps that are tightly focused on the object of interest, with far less background noise than its predecessors.
Visualization results of various methods. Score-CAM generates more visually interpretable saliency maps with less random noises.

Limitations and Future Work

The primary limitation of Score-CAM is its computational cost. Because Phase 2 requires a forward pass for every channel in the chosen convolutional layer, it is slower than gradient-based methods (which only require one backward pass). For a layer with 512 channels, Score-CAM requires 512 forward passes.

The authors suggest that future work could involve exploring different weight representations or finding ways to optimize the number of forward passes required without sacrificing the quality of the explanation.

Summary updated

BibTeX
@inproceedings{wang2020score,
  author = {Haofan Wang and Zifan Wang and Mengnan Du and Fan Yang and Zijian Zhang and Sirui Ding and Piotr Mardziel and Xia Hu},
  title = {{Score-CAM: Score-Weighted Visual Explanations for Convolutional Neural Networks}},
  booktitle = {Workshops @ CVPR},
  year = {2020},
  doi = {10.1109/cvprw50498.2020.00020},
}
Figure