SmoothGrad implementation in PyTorch
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib Fixed typo Jul 31, 2017
results Fixed typo Jul 31, 2017
.gitignore Fixed typo Jul 31, 2017
LICENSE initial commit Jul 28, 2017 Fixed image path Jul 31, 2017 Fixed some bugs when using GPU Jul 31, 2017 Fixed some bugs when using GPU Jul 31, 2017

SmoothGrad implementation in PyTorch

PyTorch implementation of SmoothGrad: removing noise by adding noise.

Vanilla Gradients SmoothGrad Guided backpropagation Guided SmoothGrad

And other techniques such as the following are implemented.


git clone


Save the saliency maps using VanillaGrad, GuidedBackpropGrad, SmoothGrad, GuidedBackpropSmoothGrad.

python --img <image-path>

Save the Grad-CAM image.

python --img <image-path>

If you do not specify an image path, read the raccoon's data (scipy.misc.face()).


  • PyTorch
  • torch-vision
  • numpy
  • scipy
  • OpenCV

Environment under Python 3.5.2 is tested.


This code is insipired by pytorch-grad-cam.