# jacobgil/vit-explain

Explainability for Vision Transformers

Repository: https://github.com/jacobgil/vit-explain
Canonical: https://ross.abutalabs.com/products/vit-explain
Language: Python
License: MIT
License Family: permissive
Topics: vision-transformer, pytorch, explainable-ai, deep-learning, transformer
Last push: 2022-03-12T05:26:04+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 2073, "days_push": 1635, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1098, forks 108 (observed 2026-08-28T04:03:34.848314+00:00)

## What it is
A PyTorch library implementing explainability methods for Vision Transformers, including Attention Rollout and Gradient Attention Rollout. It provides both a Python API and a command-line script to visualize where a transformer model attends in an image.

## Use cases
- visualize attention maps of vision transformers
- explain vision transformer classifications
- generate class-specific saliency masks for ViT models
- understand which image regions a DeiT model uses
- debug transformer attention head behavior
- create attention heatmap overlays for research papers

## When to choose
- you need attention-based explainability for Vision Transformers in PyTorch
- you want class-specific attention visualizations with gradient rollout
- you want a quick CLI to generate attention heatmaps from images

## When to avoid
- you need explainability for CNNs rather than transformers
- you need production-grade model interpretation tooling with broad model support
- you need actively maintained features like attention flow, which is unfinished

## Facets
- artifact type: library
- maturity: maintenance
- function: machine-learning, deep-learning, image-processing, computer-vision
- domain: deep-learning, computer-vision, machine-learning, artificial-intelligence
- platform: python
- tags: vision-transformer, explainable-ai, attention-rollout, pytorch, interpretability

## Member repositories
- jacobgil/vit-explain (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:34.848314+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:46:19.527967+00:00, confidence not recorded.
  - readme: https://github.com/jacobgil/vit-explain (fetched 2026-08-28T04:03:34.848314+00:00, sha f45264f74086)
- Data as of 2026-08-30T08:39:29.467469+00:00.
