CAMs as Shapley Value-based Explainers

Huaiguang Cai
1/9/2025
cs.CVcs.GT

Abstract

Class Activation Mapping (CAM) methods are widely used to visualize neural network decisions, yet their underlying mechanisms remain incompletely understood. To enhance the understanding of CAM methods and improve their explainability, we introduce the Content Reserved Game-theoretic (CRG) Explainer. This theoretical framework clarifies the theoretical foundations of GradCAM and HiResCAM by modeling the neural network prediction process as a cooperative game. Within this framework, we develop ShapleyCAM, a new method that leverages gradients and the Hessian matrix to provide more precise and theoretically grounded visual explanations. Due to the computational infeasibility of exact Shapley value calculation, ShapleyCAM employs a second-order Taylor expansion of the cooperative game's utility function to derive a closed-form expression. Additionally, we propose the Residual Softmax Target-Class (ReST) utility function to address the limitations of pre-softmax and post-softmax scores. Extensive experiments across 12 popular networks on the ImageNet validation set demonstrate the effectiveness of ShapleyCAM and its variants. Our findings not only advance CAM explainability but also bridge the gap between heuristic-driven CAM methods and compute-intensive Shapley value-based methods. The code is available at \url{https://github.com/caihuaiguang/pytorch-shapley-cam}.

View on arXivView PDF

Code Implementations(2)

MIT

ShapleyCAM: Weight the activations using the gradient and Hessian-vector product.

80TeX, ShellJul 22, 20241 years agoMIT
PyTorchMIT

Advanced AI Explainability for computer vision. Support for CNNs, Vision Transformers, Classification, Object detection, Segmentation, Image similarity and more.

12,7871,702PythonMay 31, 20175 months agoMIT
class-activation-mapscomputer-visiondeep-learningexplainable-aiexplainable-ml+12 more

Cite this paper

@article{cai2025cams,
  title  = {CAMs as Shapley Value-based Explainers},
  author = {Huaiguang Cai},
  year   = {2025},
  eprint = {2501.06261},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.06261v1}
}

Discussion