Grad-CAM

Grad-CAM

โ˜… 4.2 ๐Ÿ”– 4000 saves ๐Ÿ’ฐ Free GitHub

PyTorch Grad-CAM is the standard library for visualizing what computer vision models are looking at. It implements a large family of class activation map methods for CNNs and Vision Transformers in clean PyTorch, and it has become a default tool for explainable AI work with about 13,000 stars on GitHub.

Overview

A classifier’s accuracy number says nothing about whether it learned the right evidence. Grad-CAM techniques answer that by producing heatmaps over the input image showing which regions drove a prediction, and this library collects the major methods โ€” GradCAM, GradCAM++, ScoreCAM, XGradCAM, LayerCAM, EigenCAM and more โ€” behind one consistent interface. It goes well beyond plain classification: the same tooling works for object detection, semantic segmentation and image similarity models, and it handles modern architectures such as Vision Transformers and Swin Transformers alongside classic CNNs. The project includes quantitative metrics for evaluating explanation quality, smoothing and ablation utilities, and an extensive online book of tutorials. For teams that must debug, audit or simply trust a vision model, it is usually the first library they reach for.

Key Features

  • Many CAM methods in one library: GradCAM, GradCAM++, ScoreCAM, LayerCAM, EigenCAM and others
  • Works with CNNs, Vision Transformers and Swin Transformers
  • Supports classification, object detection, segmentation and image similarity tasks
  • Built-in metrics for quantitatively evaluating explanation quality
  • Extensive documentation and tutorial book with worked examples
  • Simple pip installation and a consistent API across all methods

๐Ÿ’ณ Pricing

PyTorch Grad-CAM is completely free and open source under the MIT license. There are no paid tiers; it runs wherever your PyTorch models run.

Who Is It For

Grad-CAM is for machine learning engineers and researchers who need to interpret, debug or audit vision models โ€” verifying a model attends to the right regions before deployment, investigating failure cases, or producing explanations for stakeholders and regulators.

๐Ÿš€ Visit Grad-CAM Official Site

๐Ÿšฉ Report an issue