# SmoothGrad: removing noise by adding noise

Daniel Smilkov, Nikhil Thorat, Been Kim, Fernanda Viégas, Martin Wattenberg · arXiv · 2017-6-12

- **Problem** Gradient-based sensitivity maps scatter bright points over irrelevant regions, and it was unclear whether that noise reflects how the network decides. The authors conjecture it comes from class scores changing sharply over tiny input changes.
- **Method** SmoothGrad averages sensitivity maps over several copies of an input with Gaussian noise added. Unlike the vanilla gradient, it targets a local average of the gradient, which it estimates by random sampling.
- **Results** In a qualitative inspection of 200 random images, SmoothGrad maps were judged more visually coherent than Integrated Gradients and the vanilla gradient.

## Why raw gradient maps look noisy

A sensitivity map for class c is the derivative of the class score S\_c with respect to the input image x, so each pixel gets a value that reflects how much a tiny change there would move the score. Such maps often land on parts of the object that a person would also pick out, but they also scatter bright points over regions that look irrelevant.

The core question is whether this scatter reflects something real in how the network decides, or only a superficial artifact; the authors leave that open. Their conjecture is that the noise comes from the class score function changing sharply over very small scales, since networks built from ReLU units are not smooth in their input.

To probe this, the authors fix one image and one pixel and move slowly along a short path of images that look identical to a person.

## Averaging the gradient over noisy copies

Instead of differentiating at the image itself, SmoothGrad targets a local average of the gradient, a Gaussian smoothing of the derivative. Computing that average exactly in a high-dimensional input space is intractable, so the method replaces it with random sampling around the input.

For an input x, the method draws n noisy copies of x, computes the vanilla map at each copy, and averages them, which gives the following estimate. \\\[ \\hat{M}\_c(x) = \\frac{1}{n}\\sum\_{i=1}^{n} M\_c\\big(x + \\mathcal{N}(0,\\sigma^2)\\big) \\\] Here M\_c is the gradient map of the class score, n is the number of samples, and each copy receives its own draw of Gaussian noise with standard deviation σ.

Two hyperparameters control the result: σ, the noise level, and n, the number of samples averaged. The noise level is expressed relative to the input value range, as σ/(xmax−xmin), and the noise is added to the input pixels.

Since the averaging is applied to the output maps, the same wrapper can sit around any gradient-based method, and the paper applies it to Integrated Gradients and Guided BackProp in addition to the vanilla gradient.

## Choices in turning maps into images

Sensitivity map algorithms often produce signed values, so the display must decide whether to show positive and negative values separately or only their absolute value. The answer depends on the dataset: on MNIST, where digits are always white, positive gradients indicate signal for the class, while on ImageNet the absolute value gave clearer pictures.

The authors suggest that the sign depends on context, since image recognition is largely invariant to color and illumination changes.

A few pixels often have much larger gradients than the rest, and these outliers can set the color scale so that most of the map looks dark. Capping extreme values at the 99th percentile produced more coherent maps in the authors' experience, and without that step the maps could end up almost entirely black.

Some methods multiply the gradient-based values by the pixel values, which gives sharper, simpler images. The cost is that pixels with a value of 0 never appear on the map, so a black object on a white background can disappear, and the multiplication is most meaningful when the gradient is read as a contribution, as in a linear system where x\_i w\_i is the contribution of x\_i to the score.

## How noise level and sample count shape the map

The noise-level comparison covers five gazelle images from ImageNet, with each map averaged over 50 samples and the noise expressed as σ/(xmax−xmin). The leftmost column without noise is the vanilla method, and the middle columns with 10%-20% noise seem to keep the sharpness of the map while preserving the structure of the image for Inception.

The authors note that the ideal noise level depends on the input, so a single noise range is not best for every image. The same kind of noise sweep on MNIST is shown separately.

For the sample-size comparison, each image had 10% noise applied, and the estimated gradient becomes smoother as n grows. The gain shows diminishing returns, with little visible change in the maps for n above 50.

## Comparison with baseline methods

Qualitative evaluation rests on two criteria: visual coherence, meaning that highlights stay on the object rather than the background, and discriminativity, meaning that a class explanation concentrates on its own object. Among 200 random images inspected, the authors found SmoothGrad more visually coherent than Integrated Gradients and the vanilla gradient.

Guided BackProp gives the sharpest maps, but it fails more often, especially on images with uniform backgrounds. SmoothGrad's effect is largest when the object sits on a uniform background color, and the authors leave the reason for this difference for further study.

For discriminativity, the sensitivity maps M1 and M2 for two classes are each scaled to \[0, 1\], and their difference is plotted on a diverging color map. On images that contain two objects of different classes, SmoothGrad looked qualitatively more discriminative than the other methods, while Guided BackProp looked weakest.

Applying the same averaging on top of Integrated Gradients and Guided BackProp improved the visual coherence of both methods in the authors' inspection.

## Adding noise during training

When sharper maps matter more than the unchanged network, the weights can be modified instead, and the authors test the well-known regularization of adding noise to training samples. The same method also improved the sharpness of the sensitivity map.

Experiments compare noise at training time, at evaluation time, or both, for an MNIST model and for Inception. Training with noise also gave a de-noising effect on the sensitivity map, and the two forms of noise appear to add together, so performing both gives the most coherent of the four combinations.

## Limitations

Sensitivity maps have no ground truth, so visual coherence and discriminativity were assessed only qualitatively, and the paper leaves quantitative metrics as an open problem.

The experiments cover an Inception v3 model on ImageNet and a convolutional MNIST model, and the best noise level varies with the input image.

The noise-as-cause conjecture is supported only by a plausibility argument, and the sharpening effect could also come from differing effects of noise on different textures. Future work could add a penalty on large partial derivatives or on differences between neighbouring pixels, but these were not tested.

## Paper info

- **Authors**: Daniel Smilkov, Nikhil Thorat, Been Kim, Fernanda Viégas, Martin Wattenberg
- **Venue**: arXiv · Preprint
- **First published**: 2017-6-12
- **Added**: 2026-11-12
- **Updated**: 2017-6-12
- **Version**: v1
- **arXiv**: 1706.03825
- **Category**: cs.LG · cs.CV · stat.ML
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1706.03825v1) · [PDF ↗](https://arxiv.org/pdf/1706.03825v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Daniel Smilkov, Nikhil Thorat, Been Kim, Fernanda Viégas, Martin Wattenberg (2017). SmoothGrad: removing noise by adding noise. arXiv:1706.03825v1. https://arxiv.org/abs/1706.03825v1

**BibTeX**

```
@misc{smilkov2017smoothgrad,
  title = {{SmoothGrad: removing noise by adding noise}},
  author = {Daniel Smilkov and Nikhil Thorat and Been Kim and Fernanda Viégas and Martin Wattenberg},
  year = {2017},
  eprint = {1706.03825},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1706.03825v1}
}
```

## Other paper commentary

- [Fine-Grained Visual Classification of Aircraft](https://refivu.com/en/papers/3543af61-7a52-4fb1-ac78-312fdda48697-fine-grained-visual-classification-of-aircraft.md)
- [Vision Transformers for Dense Prediction](https://refivu.com/en/papers/9b71a7ee-e2ab-43e8-a6e8-d9dd244b9be7-vision-transformers-for-dense-prediction.md)
- [CyCADA: Cycle-Consistent Adversarial Domain Adaptation](https://refivu.com/en/papers/86c1af43-2e3a-459f-87e6-d7c0653694a6-cycada-cycle-consistent-adversarial-domain-adaptation.md)
- [The Open Images Dataset V4: Unified image classification, object detection, and visual relationship detection at scale](https://refivu.com/en/papers/a257d9ea-aed6-4a9a-9d02-5e4c50a42a90-the-open-images-dataset-v4-unified-image-classification.md)
- [Generative Image Inpainting with Contextual Attention](https://refivu.com/en/papers/aad66e29-0d9a-49ff-bbf1-91b1b036c9eb-generative-image-inpainting-with-contextual-attention.md)
- [Multimodal Unsupervised Image-to-Image Translation](https://refivu.com/en/papers/f66e468d-e3a2-4e1b-8490-2978cf3d55ff-multimodal-unsupervised-image-to-image-translation.md)
- [All-Optical Machine Learning Using Diffractive Deep Neural Networks](https://refivu.com/en/papers/818615cb-8c22-447c-a0a6-77954575b98a-all-optical-machine-learning-using-diffractive-deep-neural.md)
- [Beyond Part Models: Person Retrieval with Refined Part Pooling (and a Strong Convolutional Baseline)](https://refivu.com/en/papers/0d7a16fd-c14e-49e6-938f-2cdeb51ea5a4-beyond-part-models-person-retrieval-with-refined-part.md)
- [Digging Into Self-Supervised Monocular Depth Estimation](https://refivu.com/en/papers/501b9eb4-7fd4-43f0-8b68-eaaf0aab3b71-digging-into-self-supervised-monocular-depth-estimation.md)
- [Language Models (Mostly) Know What They Know](https://refivu.com/en/papers/ffe245df-5662-4bfb-8c0b-899a38b87412-language-models-mostly-know-what-they-know.md)
- [From Local to Global: A Graph RAG Approach to Query-Focused Summarization](https://refivu.com/en/papers/b90240e0-a6fe-4297-adb6-4ebd769e9c60-from-local-to-global-a-graph-rag-approach.md)

## Terms in this paper

- [ImageNet](https://refivu.com/en/terms/5eadad128667-imagenet)
- [MNIST](https://refivu.com/en/terms/28b9bb66d1c6-mnist)
- [Integrated Gradients](https://refivu.com/en/terms/7ea02692192e-integrated-gradients)
- [noise level](https://refivu.com/en/terms/435976119e5e-noise-level)
- [sample size](https://refivu.com/en/terms/674241886f4d-sample-size)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/ab609ae7-27e3-4473-bc00-e8bc5f0e8a91-smoothgrad-removing-noise-by-adding-noise)
