SmoothGrad is a feature attribution technique that produces cleaner saliency maps by averaging the gradients of a model’s output over many copies of an input perturbed with Gaussian noise. Introduced in 2017 by researchers at Google, it is one of the standard tools of Explainable AI for image and text classifiers, where plain gradient maps often look speckled and hard to interpret.
The method rests on a simple observation: the gradient of a deep network fluctuates sharply at small scales, so a single gradient reflects local noise as much as meaningful sensitivity. Averaging over a small neighborhood of the input smooths out these fluctuations and leaves the pixels or tokens that consistently influence the prediction.
How SmoothGrad averages noisy gradients
SmoothGrad starts from a vanilla gradient saliency map, the derivative of the class score with respect to each input feature. Instead of computing it once, the method draws n noisy samples of the input, each formed by adding independent Gaussian noise with standard deviation sigma, computes the gradient for every sample, and returns their arithmetic mean.
Formally, the smoothed map approximates the expected gradient under a Gaussian distribution centered on the input. This expectation is equivalent to the gradient of a Gaussian-blurred version of the model’s score function, which explains why the result looks less jagged: SmoothGrad effectively explains a smoothed copy of the model rather than the raw, highly nonlinear function.
Because the procedure only needs gradients, it is model-specific but architecture-agnostic: it works with any differentiable network, including convolutional networks, transformers and multimodal encoders. It also acts as a wrapper, so the averaging step can be applied on top of other gradient-based attribution methods.
Key parameters and typical settings
Two parameters control SmoothGrad: the noise level and the number of samples. The noise level is usually expressed as a fraction of the input range, for example sigma divided by the difference between the maximum and minimum pixel values.
The table below gives commonly used ranges and their effect on the resulting map.
| Parameter | Typical range | Effect when too low | Effect when too high |
|---|---|---|---|
| Noise level | 10% to 20% of input range | Map stays noisy | Map blurs and loses detail |
| Sample count n | 20 to 100 | High variance between runs | Linear growth in compute cost |
| Squared variant | Optional | Not applicable | Emphasizes strong features, hides weak ones |
| Absolute value | Common for images | Signed map hard to read | Loses direction of influence |
In the original experiments, a noise level of about 10% to 20% gave the best visual balance, and improvements largely saturated after roughly 50 samples. These values are starting points; data scaling, model depth and the input modality all shift the optimum.
SmoothGrad compared with related attribution methods
SmoothGrad belongs to the family of gradient-based saliency methods and is often combined with them. It differs from neighbors mainly in what it averages and which property of explanations it targets.
The following comparison places SmoothGrad among methods that practitioners frequently evaluate side by side.
| Method | Core idea | Main strength | Main weakness |
|---|---|---|---|
| Vanilla gradient | Single derivative of output | Fast, one backward pass | Very noisy maps |
| SmoothGrad | Average gradients over noisy inputs | Visually coherent maps | n times the cost |
| Integrated Gradients | Integrate gradients along a baseline path | Satisfies completeness axiom | Depends on baseline choice |
| Gradient × input | Multiply gradient by input value | Simple, sign-aware | Inherits gradient noise |
| Grad-CAM | Weight feature maps by pooled gradients | Class-discriminative regions | Coarse spatial resolution |
Variants such as SmoothGrad combined with Integrated Gradients, sometimes called SmoothGrad-IG, and VarGrad, which uses the variance of the noisy gradients rather than the mean, extend the same idea. Libraries such as Captum expose SmoothGrad as a generic noise tunnel around any supported attribution method.
When to use SmoothGrad in practice
SmoothGrad is most useful when engineers need a quick, visual sanity check of what a differentiable model attends to. It suits debugging, dataset audits and communication with domain experts, but it should not be the only evidence in high-stakes decisions.
The decision table below matches common goals with a recommended approach.
| Goal | Recommendation | Reason |
|---|---|---|
| Spot spurious cues in images | SmoothGrad with absolute values | Clear maps reveal background shortcuts |
| Quantitative attribution scores | Integrated Gradients or SHAP | Axiomatic properties and additivity |
| Coarse object localization | Grad-CAM | Region-level maps from deep layers |
| Noisy Integrated Gradients output | Wrap it with SmoothGrad | Combines completeness with smoothing |
| Non-differentiable model | Occlusion or KernelSHAP | SmoothGrad requires gradients |
Limitations and faithfulness concerns
The main limitation is that visual clarity does not guarantee faithfulness. Sanity-check studies have shown that some gradient-based maps change little when model weights are randomized, which means they partly reflect the input’s edges rather than the learned function. SmoothGrad performs better than many guided methods in these tests, but its maps still require validation.
- Explains a smoothed model: the averaged gradient describes the model’s behavior in a neighborhood, not exactly at the input.
- Noise may leave the data distribution: heavy Gaussian noise creates inputs the network never saw during training.
- Compute cost scales linearly: 50 samples mean about 50 backward passes per explanation.
- Run-to-run variance: a small sample count produces maps that differ between runs unless the random seed is fixed.
- No completeness property: attributions do not sum to the output score, unlike Integrated Gradients.
Good practice pairs SmoothGrad with quantitative faithfulness metrics, such as deletion and insertion curves, and with randomization tests that confirm the map depends on the trained weights.
The idea in brief
A heat map can show which parts of a picture a neural network used to make its decision. The basic version is often grainy and confusing. SmoothGrad fixes this by asking the same question many times. Each time, it adds a little random static to the picture.
It then averages all the answers. Random speckles cancel out. The parts that matter every time stay bright. It is similar to taking many photos of a starry sky and stacking them to remove sensor noise. The result is a cleaner, more readable map.
A practical scenario
A medical imaging team builds a convolutional network that flags pneumonia on chest X-rays. Plain gradient maps look like scattered dots across the whole image, so radiologists cannot judge them. The engineers apply SmoothGrad with 50 samples and a noise level of 15% of the pixel range.
The smoothed maps show that, for a noticeable share of positive cases, the model highlights a hospital text marker in the image corner instead of the lungs. The team masks the markers, retrains the model and repeats the analysis. The new maps concentrate on the lung fields, and accuracy on scans from an external hospital improves, confirming that SmoothGrad exposed a shortcut the validation score alone had hidden.