[Paper Review] Use HiResCAM instead of Grad-CAM for faithful explanations of convolutional neural networks
HiResCAM provides class-specific explanations that faithfully reflect the locations a CNN uses for prediction, addressing Grad-CAM’s tendency to blur or expand attention due to gradient averaging.
Explanation methods facilitate the development of models that learn meaningful concepts and avoid exploiting spurious correlations. We illustrate a previously unrecognized limitation of the popular neural network explanation method Grad-CAM: as a side effect of the gradient averaging step, Grad-CAM sometimes highlights locations the model did not actually use. To solve this problem, we propose HiResCAM, a novel class-specific explanation method that is guaranteed to highlight only the locations the model used to make each prediction. We prove that HiResCAM is a generalization of CAM and explore the relationships between HiResCAM and other gradient-based explanation methods. Experiments on PASCAL VOC 2012, including crowd-sourced evaluations, illustrate that while HiResCAM's explanations faithfully reflect the model, Grad-CAM often expands the attention to create bigger and smoother visualizations. Overall, this work advances convolutional neural network explanation approaches and may aid in the development of trustworthy models for sensitive applications.
Motivation & Objective
- Motivate the need for faithful explanations in CNNs to avoid spurious correlations and bias in sensitive applications.
- Introduce HiResCAM as a class-specific explanation method that overcomes Grad-CAM’s gradient-averaging limitation.
- Prove theoretical relationships: HiResCAM is a generalization of CAM and connects to Grad-CAM and Gradient* Input.
- Empirically compare HiResCAM and Grad-CAM on natural images and a medical imaging dataset, including crowd-sourced perception.
- Provide guidance on when to use HiResCAM or CAM architectures for trustworthy explanations.
Proposed method
- Define HiResCAM as the element-wise product of the gradient with the corresponding feature maps, summed over all feature maps: ÃA_m^{HiResCAM} = sum_f (∂s_m/∂A^f) ⊙ A^f.
- Show that Grad-CAM uses averaged gradients α_m^f = (1/D1D2) sum_{d1,d2} ∂s_m/∂A^f_{d1d2} and then forms ÃA_m^{GradCAM} = sum_f α_m^f A^f.
- Prove that for CNNs ending in one fully connected layer, HiResCAM highlights locations that increase the class score, by deriving s_m = w_m A + b_m and ∂s_m/∂A = w_m.
- Demonstrate that for CAM architectures (global average pooling followed by FC), HiResCAM reduces to CAM up to a normalization constant.
- Discuss relationships to CAM, Grad-CAM, and Gradient* Input, and show that HiResCAM is a local explanation reflecting the model’s computations.
Experimental results
Research questions
- RQ1Does HiResCAM produce explanations that faithfully reflect the model’s computations for CNNs ending in a single fully connected layer?
- RQ2How do HiResCAM and Grad-CAM explanations differ in terms of localization, focus, and size of attention maps?
- RQ3What are the theoretical relationships between HiResCAM, CAM, Grad-CAM, and Gradient* Input across different CNN architectures?
- RQ4Do empirical comparisons on natural images and medical data support HiResCAM as a more faithful alternative to Grad-CAM?
Key findings
- HiResCAM explanations are proved to reflect the model’s computations for CNNs ending in one fully connected layer, yielding zero L2 distance to the true locations used by the model in this setting.
- Empirical results show Grad-CAM explanations differ from HiResCAM and often appear bigger and more rounded than faithful HiResCAM explanations.
- On PASCAL VOC 2012 with ResNet-34v and DenseNet-121v, Grad-CAM yields nonzero L2 distance to the true locations, whereas HiResCAM yields zero, confirming fidelity.
- Weakly supervised segmentation IoU results indicate Grad-CAM sometimes outperforms HiResCAM, suggesting Grad-CAM’s expanded attention can aid WSS but at the cost of faithfulness.
- Crowd-sourced human perception experiments indicate Grad-CAM explanations tend to be larger or less focused than HiResCAM explanations, aligning with qualitative observations.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.