# SmoothGrad

**SmoothGrad** 是一种技术，用于减少深度神经网络基于梯度的显著性图中的视觉噪声：向输入多次添加随机高斯噪声，并对所得敏感度图取平均。它由丹尼尔·斯米尔科夫（Daniel Smilkov）、尼基尔·托拉特（Nikhil Thorat）、比恩·金（Been Kim）、费尔南达·维埃加斯（Fernanda Viégas）和马丁·瓦滕伯格（Martin Wattenberg）在 2017 年 6 月的一篇 arXiv 论文中提出，并在 ICML 2017 深度学习可视化研讨会上展示，其标题概括为：通过添加噪声来去除噪声。<sup>[1](https://arxiv.org/abs/1706.03825)</sup><sup> • </sup><sup>[2](https://media.icml.cc/Conferences/ICML2017/Workshop-Program-ICML-2017.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 作用 | 对输入的含噪副本进行采样，为每个副本计算基于梯度的敏感度图，并对它们取平均，以抑制像素级波动，同时保留结构一致的区域。<sup>[3](https://www.frontiersin.org/journals/signal-processing/articles/10.3389/frsip.2026.1797749/full)</sup> |
| 推荐设置 | 高斯噪声标准差约为输入值范围的 10% 到 20%，样本数约 50；超过 n = 50 后视觉质量收益递减。<sup>[4](https://doi.org/10.1016/j.inffus.2021.11.008)</sup> |
| 变体 | SmoothGrad-Squared 对样本归因的平方取平均；VarGrad 返回样本归因的方差。<sup>[5](https://github.com/meta-pytorch/captum/blob/master/captum/attr/_core/noise_tunnel.py)</sup> |
| 可组合性 | 它包装现有的归因方法，而不是取代它；Captum 的 NoiseTunnel 可将其应用于任何归因算法，默认使用 5 个噪声样本、噪声标准差 1.0。<sup>[5](https://github.com/meta-pytorch/captum/blob/master/captum/attr/_core/noise_tunnel.py)</sup> |
| 成本 | 相比底层显著性方法，计算时间约增加 20 倍，且由于随机扰动，输出是非确定性的。<sup>[6](https://vis.csail.mit.edu/pubs/saliency-cards.pdf)</sup> |
| 评估 | 在 2025 年一项对六种显著性技术的比较研究中，SmoothGrad 和 Integrated Gradients 在 CIFAR-10 和 Imagenette 上取得了最佳的保真度和稳定性得分，相较 LIME、GradCAM 和 GradCAM++ 有统计显著提升。<sup>[7](https://www.nature.com/articles/s41598-025-25839-y)</sup> |

## 背景与动机

对于图像分类器，一种常见的解释类型是找出强烈影响最终决策的像素。起点是类别得分函数相对于输入图像的梯度，它可以被解释为敏感度图；若干技术在这一基本思想上加以展开。<sup>[1](https://arxiv.org/abs/1706.03825)</sup> 然而，原始梯度图往往看起来噪声多且弥散，难以阅读。<sup>[3](https://www.frontiersin.org/journals/signal-processing/articles/10.3389/frsip.2026.1797749/full)</sup>

SmoothGrad 的作者直白地描述了这一过程：取一张感兴趣的图像，通过向其添加噪声来采样相似图像，然后对每张采样图像所得的敏感度图取平均。<sup>[8](https://aiwiki.ai/wiki/smoothgrad)</sup> 形式上，对于基础解释图 E，SmoothGrad 计算

\[ E_{\mathrm{sg}}(x) = \frac{1}{N} \sum_{i=1}^{N} E\!\left(x + g_i\right), \qquad g_i \sim \mathcal{N}\!\left(0, \sigma^{2} I\right), \]

其中 N 是含噪样本数，噪声向量独立地从高斯分布中抽取。<sup>[9](https://proceedings.neurips.cc/paper/2018/file/294a8ed24b1ad22ec2e7efea049b8737-Paper.pdf)</sup> 这是对输入周围局部噪声分布下期望归因的[蒙特卡洛](https://www.edgepedia.org/zh/monte-carlo)近似，也可以解释为用高斯核对归因方法进行平滑。<sup>[3](https://www.frontiersin.org/journals/signal-processing/articles/10.3389/frsip.2026.1797749/full)</sup><sup> • </sup><sup>[5](https://github.com/meta-pytorch/captum/blob/master/captum/attr/_core/noise_tunnel.py)</sup>

## 超参数

SmoothGrad 有两个超参数：σ，即高斯扰动的标准差；以及 n，即用于平均的样本数。在原始论文的定性实验中，施加 10% 到 20% 的噪声能在敏感度图的锐度与保留原始图像结构之间取得平衡，而 0% 噪声对应于普通梯度，或称“原味”梯度。<sup>[10](https://3dvar.com/Smilkov2017SmoothGrad.pdf)</sup> 作者基于这些实验推荐 σ 在 0.10 到 0.20 之间、n = 50。<sup>[4](https://doi.org/10.1016/j.inffus.2021.11.008)</sup> 随着样本数从 n = 2 增至 n = 100，视觉质量会提高，但超过 n = 50 后收益递减，因此对大多数应用而言，50 是一个实用阈值。<sup>[11](https://www.alphaxiv.org/zh/abs/1706.03825)</sup> 谷歌云（Google Cloud）的实现指南与这些取值一致，建议 noise_sigma 约为输入特征标准差的 10% 到 20%，noisy_sample_count 在 [1, 50] 范围内。<sup>[12](https://cloud.google.com/java/docs/reference/google-cloud-aiplatform/2.9.7/com.google.cloud.aiplatform.v1beta1.SmoothGradConfig.Builder)</sup>

## 变体与实现

与原始方法一同出现的还有两种密切相关的聚合方式。SmoothGrad-Squared 返回样本归因平方的均值，VarGrad 返回样本归因的方差；二者在 Captum 中作为噪声隧道类型提供，Captum 是 Meta PyTorch 的模型可解释性库，它将 SmoothGrad 实现为 NoiseTunnel 包装器，可套在任何归因算法上，例如 Integrated Gradients 或 Saliency。<sup>[5](https://github.com/meta-pytorch/captum/blob/master/captum/attr/_core/noise_tunnel.py)</sup> 谷歌的 PAIR 显著性库也随 SmoothGrad 一起提供 XRAI、BlurIG 和 Guided Integrated Gradients 等方法。<sup>[13](https://github.com/PAIR-code/saliency)</sup> 将 SmoothGrad 与其他梯度方法结合是常见做法：将其应用于 Integrated Gradients 或 Guided BackPropagation，会得到比任一方法单独使用时明显更锐利的敏感度图。<sup>[14](https://datanetworkanalysis.github.io/2019/10/22/smoothgrad)</sup>

这一思想已在其他方向得到扩展。NoiseGrad 将同样的随机平均原则应用于模型的权重参数而非输入，扰动的是决策边界而不是输入空间。<sup>[15](https://arxiv.org/abs/2106.10185)</sup> 后来的工作将 SmoothGrad 重新解释为卷积的一个推论，并从置信水平的角度分析 σ 的作用。<sup>[16](https://arxiv.org/abs/2410.07711)</sup>

## 评估与局限

**定量比较。** 在一项 2025 年的研究中，比较了六种显著性技术（LIME、SHAP、GradCAM、GradCAM++、Integrated Gradients 和 SmoothGrad）在三个数据集和三种架构上的表现，没有一种方法在所有指标上都更优；然而，基于梯度的方法——尤其是 Integrated Gradients 和 SmoothGrad——获得了最高的保真度和稳定性评分，在 CIFAR-10 和 Imagenette 上以统计显著的幅度优于 LIME、GradCAM 和 GradCAM++。在所有测试的数据集-模型组合中，SmoothGrad 与 Integrated Gradients 在保真度上没有统计显著差异。<sup>[7](https://www.nature.com/articles/s41598-025-25839-y)</sup>

**健全性检查。** NeurIPS 2018 的《显著性图的健全性检查》（"Sanity Checks for Saliency Maps"）研究检验了解释方法是否依赖于模型学到的参数和训练标签，发现梯度及其 SmoothGrad 变体在模型参数随机化以及用随机置换标签训练这两种情况下都会发生显著变化，表明它们对模型和数据具有敏感性。同一研究还警告说，仅靠目视检查很难判断一个解释是否忠实，因为某些显著性方法产生的输出与边缘检测器的结果惊人地相似。<sup>[9](https://proceedings.neurips.cc/paper/2018/file/294a8ed24b1ad22ec2e7efea049b8737-Paper.pdf)</sup>

**实际成本。** 由于该方法要对输入的许多含噪副本取平均，它会成倍增加底层归因方法的成本；一项系统性比较估计开销约为基础计算的 20 倍，而随机扰动使输出具有非确定性，因此重复运行可能产生略有不同的图。<sup>[6](https://vis.csail.mit.edu/pubs/saliency-cards.pdf)</sup> 在临床阅片研究中，SmoothGrad 类型的显著性解释并未能在 AI 预测本身之外可靠地提高诊断准确率；一项有 35 名神经外科医生参与的研究发现，无 AI 时准确率为 82.5%，有 AI 时为 87.7%，有 AI 加解释时为 88.5%，并指出由解释促成的决策改变中有 31% 是错误的。<sup>[17](https://www.frontiersin.org/journals/artificial-intelligence/articles/10.3389/frai.2026.1819422/full)</sup>

## References

1. [Daniel Smilkov, Nikhil Thorat, Been Kim, Fernanda Viégas, Martin Wattenberg (2017). SmoothGrad: removing noise by adding noise. arXiv:1706.03825.](https://arxiv.org/abs/1706.03825)
2. [ICML 2017 Workshop book, Workshop on Visualization for Deep Learning.](https://media.icml.cc/Conferences/ICML2017/Workshop-Program-ICML-2017.pdf)
3. [Explainable artificial intelligence approaches in cardiovascular imaging, Frontiers in Signal Processing (2026).](https://www.frontiersin.org/journals/signal-processing/articles/10.3389/frsip.2026.1797749/full)
4. [CLEVR-XAI: A benchmark dataset for the ground truth evaluation of neural network explanations, Information Fusion (2022).](https://doi.org/10.1016/j.inffus.2021.11.008)
5. [Captum NoiseTunnel source, meta-pytorch/captum, GitHub.](https://github.com/meta-pytorch/captum/blob/master/captum/attr/_core/noise_tunnel.py)
6. [Saliency Cards: A Framework to Characterize and Compare Saliency Methods, FAccT 2023.](https://vis.csail.mit.edu/pubs/saliency-cards.pdf)
7. [A comparative evaluation of explainability techniques for image data, Scientific Reports (2025).](https://www.nature.com/articles/s41598-025-25839-y)
8. [SmoothGrad, AI Wiki.](https://aiwiki.ai/wiki/smoothgrad)
9. [Adebayo et al. (2018). Sanity Checks for Saliency Maps, NeurIPS 2018.](https://proceedings.neurips.cc/paper/2018/file/294a8ed24b1ad22ec2e7efea049b8737-Paper.pdf)
10. [Smilkov et al. (2017). SmoothGrad paper PDF, section on noise level and sample size.](https://3dvar.com/Smilkov2017SmoothGrad.pdf)
11. [SmoothGrad: removing noise by adding noise, alphaXiv summary.](https://www.alphaxiv.org/zh/abs/1706.03825)
12. [Class SmoothGradConfig.Builder, Google Cloud Vertex AI Java reference.](https://cloud.google.com/java/docs/reference/google-cloud-aiplatform/2.9.7/com.google.cloud.aiplatform.v1beta1.SmoothGradConfig.Builder)
13. [PAIR-code/saliency: Framework-agnostic implementation for state-of-the-art saliency methods, GitHub.](https://github.com/PAIR-code/saliency)
14. [SmoothGrad: removing noise by adding noise, Korean-language walkthrough with visualizations.](https://datanetworkanalysis.github.io/2019/10/22/smoothgrad)
15. [NoiseGrad: Enhancing Explanations by Introducing Stochasticity to Model Weights, arXiv:2106.10185.](https://arxiv.org/abs/2106.10185)
16. [Rethinking the Principle of Gradient Smooth Methods in Model Explanation, arXiv:2410.07711.](https://arxiv.org/abs/2410.07711)
17. [Which explainable AI methods in medical imaging are clinically impactful? A systematic literature review, Frontiers in Artificial Intelligence (2026).](https://www.frontiersin.org/journals/artificial-intelligence/articles/10.3389/frai.2026.1819422/full)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 现代人工智能：基础模型、生成式人工智能与人工智能产业 › Foundation-model methods and training › Safety methods, interpretability, and red-teaming › Probing and attribution methods

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/smoothgrad

English original: https://www.edgepedia.org/smoothgrad
