pytorch-grad-cam  by jacobgil

PyTorch SDK for explainable AI in computer vision

Created 8 years ago
12,175 stars

Top 4.1% 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

5 months ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
3
Star History
137 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems") and Kevin Hou Kevin Hou(Head of Product Engineering at Windsurf).

ImageAI by OlafenwaMoses

0.0%
9k
Python library for computer vision tasks
Created 7 years ago
Updated 1 year ago
Starred by Alexandr Wang Alexandr Wang(Chief AI Officer at Meta; Cofounder of Scale AI), Boris Cherny Boris Cherny(Creator of Claude Code; MTS at Anthropic), and
8 more.

awesome-deep-vision by kjw0612

0.1%
11k
Curated list of deep learning resources for computer vision
Created 10 years ago
Updated 2 years ago
Feedback? Help us improve.