#127 · Primary category: Computer Vision

torch-cam

activation-maps class-activation-map cnn deep-learning grad-cam gradcam gradcam-plus-plus interpretability interpretable-deep-learning python pytorch saliency-map score-cam smoothgrad

Class activation maps for your PyTorch models (CAM, Grad-CAM, Grad-CAM++, Smooth Grad-CAM++, Score-CAM, SS-CAM, IS-CAM, XGrad-CAM, Layer-CAM, Finer-CAM, LeGrad, RefineCAM)

Project last updated:08/26/26

GitHub Stars

2.3K

Forks

227

Contributors

5

License

Apache-2.0

Why we included this project

When you train a CNN, it helps to know which pixels actually drove a given prediction, and this library answers that question directly. It implements a broad family of class activation mapping methods, from the classic CAM and Grad-CAM through newer variants like Score-CAM, Layer-CAM, and XGrad-CAM, all behind a consistent API. The hooks work with many common architectures out of the box, and you can wire up custom models too, which makes it a handy tool for auditing or debugging vision models before you ship them. There's also a Hugging Face Space and a Colab quickstart if you want to see the maps before adding the dependency. For teams building image classifiers, it's a practical way to sanity-check what the model focuses on and to explain a prediction to stakeholders.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category