qmetrics.net

PyTorch Grad CAM

PyTorch explainability library for computer vision models

PyTorch Grad CAM screenshot

A Python package that implements class activation and pixel attribution methods for PyTorch vision models. Use it to explain predictions during development or in production.

Overview

PyTorch Grad CAM collects explainable AI methods for computer vision in one installable package. You can diagnose why a network assigns a label, compare attribution algorithms, and use the same tooling as a research benchmark for new explainability work.

The package ships many attribution variants such as GradCAM, ScoreCAM, AblationCAM, EigenCAM, LayerCAM, and meta-wrappers like RefineCAM and SESS. Methods apply to classification, object detection, semantic segmentation, embedding similarity, and architectures from CNNs through Vision Transformers and Swin.

You choose a target layer and optional model targets when the task is not plain classification. A reshape transform can convert activations from non-CNN layouts back into spatial maps. Batched inference is supported across methods, and optional augsmooth and eigensmooth reduce noise in the heatmaps.

Built-in metrics help evaluate whether an explanation is trustworthy, including ROAD-style measures and tuning guidance. An example script runs selected methods from the command line on CPU, CUDA, MPS, or other devices. Documentation covers Hugging Face image models, YOLO, Faster R-CNN, and custom pipelines.

Key features

  • Many CAM and attribution algorithms
  • CNN and Vision Transformer support
  • Classification, detection, and segmentation
  • Batched image processing
  • Explanation smoothing options
  • Faithfulness and ROAD metrics
  • Custom layer and target hooks
  • Guided backpropagation pairing

Use cases

  • Debugging misclassified images
  • Production model monitoring
  • Comparing XAI algorithms
  • Research benchmarks for new methods
  • 3D medical segmentation explanation

Tags

Similar software

TensorFlow

End-to-end machine learning platform and tooling ecosystem

TensorFlow is a machine learning platform with Python and C++ APIs, optional GPU packages, and companion libraries for data, training, deployment, and visualization.

★ 201.8k⟳ todayApache-2.0

Transformers

Shared model definitions for multimodal ML workloads

Transformers is a Python library that defines pretrained text, vision, audio, and multimodal models once in PyTorch for shared inference and training across the ecosystem.

★ 169.4k⟳ todayApache-2.0

RAGFlow

Open-source RAG engine and agent context platform

RAGFlow ingests heterogeneous documents, builds retrievable knowledge, and supports agent workflows with citations. It can run on your own hardware with Docker or a from-source server stack.

★ 94.8k⟳ todayApache-2.0

Headroom

Local LLM context compression library and proxy

Headroom shrinks tool outputs, logs, JSON, and chat history before LLM calls to cut input tokens while preserving retrievable originals. It offers a Python library, proxy, MCP tools, and agent wrappers.

★ 81k⟳ yesterdayApache-2.0

Unsloth

Local desktop workspace to run and fine-tune AI models

Unsloth is a desktop application to chat with, fine-tune, and serve LLMs, diffusion, audio, and embedding models on your own hardware with optional agent integrations.

★ 80.4k⟳ todayApache-2.0

Models

TensorFlow reference models and modeling utilities collection

The TensorFlow Model Garden hosts implementations of models and modeling solutions for TensorFlow, installable via pip as tf-models-official.

★ 77.6k⟳ 11 days agoApache-2.0