pytorch-grad-cam  by jacobgil

PyTorch SDK for explainable AI in computer vision

created 8 years ago
11,983 stars

Top 4.3% on sourcepulse

GitHubView on GitHub
Project Summary

This library provides advanced AI explainability methods for PyTorch computer vision models, targeting researchers and developers who need to understand model predictions. It offers a comprehensive suite of state-of-the-art techniques for diagnosing model behavior, benchmarking new methods, and visualizing feature attributions.

How It Works

The package implements a variety of pixel attribution methods, including GradCAM, HiResCAM, ScoreCAM, and AblationCAM, by weighting model activations based on gradients or output perturbations. It supports advanced use cases like object detection and semantic segmentation by allowing custom reshape_transform and model_target functions to adapt to diverse architectures and tasks beyond standard classification.

Quick Start & Requirements

Highlighted Details

  • Supports a wide range of methods including GradCAM, HiResCAM, ScoreCAM, AblationCAM, EigenCAM, and more.
  • Tested on common CNNs (ResNet, VGG) and Vision Transformers (ViT, SwinT).
  • Includes metrics for evaluating explanation trustworthiness and tuning performance.
  • Offers smoothing techniques (aug_smooth, eigen_smooth) for cleaner visualizations.

Maintenance & Community

The project is actively maintained by Jacob Gildenblat and contributors. Community support channels are not explicitly mentioned in the README.

Licensing & Compatibility

The project is licensed under the MIT License, permitting commercial use and integration with closed-source projects.

Limitations & Caveats

Some methods like ScoreCAM and AblationCAM can be computationally intensive due to multiple forward passes, with batch size configurable for performance tuning. Adapting to highly custom architectures may require understanding the reshape_transform and model_target concepts.

Health Check
Last commit

3 months ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
0
Star History
444 stars in the last 90 days

Explore Similar Projects

Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Phil Wang Phil Wang(Prolific Research Paper Implementer), and
4 more.

vit-pytorch by lucidrains

0.2%
24k
PyTorch library for Vision Transformer variants and related techniques
created 4 years ago
updated 6 days ago
Feedback? Help us improve.