meta-pytorch /captum

Model interpretability and understanding for PyTorch

★ 5,721⑂ 576👁 274⑃ 1,371● 588▤ 11
PythonBSD-3-ClauseCreated 2019-08-27captum.ai
More from this author
Download: Captum v0.9.0 ReleaseCaptum-0.9.0 ↓0.9.02026-04-17
-1
Daily
5,721
stars
576
forks
274
watchers
1,371
prs
588
issues
11
releases

README

!Captum Logo




![GitHub - License][github-license]

![PyPI][pypi-package]
![Conda - Platform][conda-forge-package]
![Conda (channel only)][conda-forge-package]
![Conda Recipe][conda-forge-feedstock]
![Docs - GitHub.io][docs-package]

[github-license]: https://github.com/pytorch/captum/blob/master/LICENSE
[pypi-package]: https://pypi.org/project/captum/
[conda-forge-package]: https://anaconda.org/conda-forge/captum
[conda-forge-feedstock]: https://github.com/conda-forge/captum-feedstock
[docs-package]: https://captum.ai/



Captum is a model interpretability and understanding library for PyTorch.
Captum means comprehension in Latin and contains general purpose implementations
of integrated gradients, saliency maps, smoothgrad, vargrad and others for
PyTorch models. It has quick integration for models built with domain-specific
libraries such as torchvision, torchtext, and others.


 About Captum

With the increase in model complexity and the resulting lack of transparency, model interpretability methods have become increasingly important. Model understanding is both an active area of research as well as an area of focus for practical applications across industries using machine learning. Captum provides state-of-the-art algorithms such as Integrated Gradients, Testing with Concept Activation Vectors (TCAV), TracIn influence functions, just to name a few, that provide researchers and developers with an easy way to understand which features, training examples or concepts contribute to a models' predictions and in general what and how the model learns. In addition to that, Captum also provides adversarial attacks and minimal input perturbation capabilities that can be used both for generating counterfactual explanations and adversarial perturbations.



Captum helps ML researchers more easily implement interpretability algorithms that can interact with PyTorch models. Captum also allows researchers to quickly benchmark their work against other existing algorithms available in the library.

!Overview of Attribution Algorithms

 Target Audience

The primary audiences for Captum are model developers who are looking to improve their models and understand which concepts, features or training examples are important and interpretability researchers focused on identifying algorithms that can better interpret many types of models.

Captum can also be used by application engineers who are using trained models in production. Captum provides easier troubleshooting through improved model interpretability, and the potential for delivering better explanations to end users on why they’re seeing a specific piece of content, such as a movie recommendation.

 Installation

Installation Requirements
- Python = 3.10
- PyTorch = 2.3


 Installing the latest release

Install released Captum via pip.

With pip

bash
pip install captum


Manual / Dev install

If you'd like to try our bleeding edge features (and don't mind potentially
running into the occasional bug here or

Top issues

Latest release

Captum v0.9.0 Release v0.9.0 2026-04-17
The v0.9.0 release of Captum adds NumPy 2.x support, retires the long-deprecated Captum Insights, introduces new multimodal image-mask attribution primitives, adds remote LLM attribution via vLLM, and promotes cross-tensor attribution to a default-on feature for perturbation-based methods. This release also raises minimum supported Python and PyTorch versions to 3.10 and 1.13, respectively.

Upgrading from v0.8 should be drop-in for most users. The exceptions to watch for: any code that imports from captum.insights or installs the [insights] extra (removed — see below), environments on Pytho

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON