Visual attribution
Pytorch Implementation of recent visual attribution methods for model interpretability
A collection of visual attribution methods for model interpretability The project is written primarily in Jupyter Notebook, distributed under the BSD 2-Clause "Simplified" License license, first published in 2018. Key topics include: excitation, excitation-backpropagation, explanation, interpretability, interpretable-deep-learning.
Pytorch Visual Attribution Methods
A collection of visual attribution methods for model interpretability

Including:
- Vanilla Gradient Saliency
- Grad X Input
- Integrated Gradient
- SmoothGrad
- Deconv
- Guided Backpropagation
- Excitation Backpropagation, Contrastive Excitation Backpropagation
- GradCAM
- PatternNet, PatternLRP
- Real Time Saliency
- Occlusion
- Feedback
- DeepLIFT
- Meaningful Perturbation
Setup
Prerequisities
- Linux
- NVIDIA GPU + CUDA (Current only support running on GPU)
- Python 3.x
- PyTorch version == 0.2.0 (Sorry I haven't tested on newer versions)
- torchvision, skimage, matplotlib
Getting Started
- Clone this repo:
bashgit clone git@github.com:yulongwang12/visual-attribution.git cd visual-attribution
- Download pretrained weights
bashcd weights bash ./download_patterns.sh # for using PatternNet, PatternLRP bash ./download_realtime_saliency.sh # for using Real Time Saliency
Note: I convert caffe bvlc_googlenet pretrained models in pytorch format (see googlenet.py and weights/googlenet.pth).
Visual Saliency Comparison
see notebook saliency_comparison.ipynb. If everything works, you will get the above image.
Weakly Supervised Object Localization
TBD
Citation
If you use our codebase or models in your research, please cite this project.
bibtex@misc{visualattr2018, author = {Yulong Wang}, title = {Pytorch-Visual-Attribution}, howpublished = {\url{https://github.com/yulongwang12/visual-attribution}}, year = {2018} }
Contributors
Showing top 1 contributor by commit count.
