# 去噪自编码器

**去噪自编码器**（denoising autoencoder，DAE）是一种自编码器，它接收损坏的数据点作为输入，经训练后预测原始的、未损坏的数据点作为输出<sup>[1](https://www.deeplearningbook.org/contents/autoencoders.html)</sup>。该方法由[蒙特利尔大学](https://www.edgepedia.org/zh/universite-de-montreal)的帕斯卡尔·樊尚、雨果·拉罗谢尔、[约书亚·本吉奥](https://www.edgepedia.org/zh/yoshua-bengio)和皮埃尔-安托万·芒扎戈尔在2008年赫尔辛基国际机器学习会议上的一篇论文中提出，用于无监督表示学习<sup>[2](https://www.cs.toronto.edu/~larocheh/publications/icml-2008-denoising-autoencoders.pdf)</sup>。其核心思想是使学习到的表示对输入的部分损坏具有鲁棒性：部分被破坏的输入应当产生几乎相同的表示<sup>[2](https://www.cs.toronto.edu/~larocheh/publications/icml-2008-denoising-autoencoders.pdf)</sup>。

| 关键事实 | 详情 |
|---|---|
| 定义 | 一种自编码器，经训练从损坏过程C(x̃ \| x)中抽取的损坏版本x̃重建干净数据点x<sup>[1](https://www.deeplearningbook.org/contents/autoencoders.html)</sup> |
| 训练损失 | 最小化−log p<sub>decoder</sub>(x \| h = f(x̃))，通常通过小批量梯度下降；当编码器为确定性时，DAE就是普通的前馈网络<sup>[1](https://www.deeplearningbook.org/contents/autoencoders.html)</sup> |
| 起源 | 樊尚、拉罗谢尔、本吉奥和芒扎戈尔，2008年国际机器学习会议；蒙特利尔大学技术报告1316，2008年2月<sup>[2](https://www.cs.toronto.edu/~larocheh/publications/icml-2008-denoising-autoencoders.pdf)</sup> |
| 堆叠结果 | 由堆叠DAE初始化的3隐藏层网络在MNIST“basic”变体上达到2.80 ± 0.14%的测试误差，而堆叠普通自编码器为3.46 ± 0.16%；在八项任务中除一项外，均优于或等于最佳对比模型<sup>[3](https://www.cs.toronto.edu/~larocheh/publications/denoising_autoencoders_tr1316.pdf)</sup> |
| 理论作用 | 在高斯损坏和平方误差下，重建函数学习一个向量场，估计数据分布的得分∇<sub>x</sub> log p(x)<sup>[1](https://www.deeplearningbook.org/contents/autoencoders.html)</sup> |
| 与收缩自编码器的关系 | 小高斯损坏使DAE类似于惩罚系数λ = σ²应用于整个重建函数的收缩自编码器<sup>[4](https://jmlr.csail.mit.edu/papers/volume15/alain14a/alain14a.pdf)</sup> |
| 现代后裔 | 掩码自编码器（过去常被称为去噪自编码器）以及通过迭代去噪进行生成的扩散模型<sup>[5](https://arxiv.org/abs/2208.00173)</sup> |

## 训练过程

DAE训练过程引入损坏过程C(x̃ \| x)，即给定数据样本x时损坏样本x̃的条件分布。每个训练步骤包括三部分：从训练数据中采样一个样本x，从C(x̃ \| x)中采样一个损坏版本x̃，并使用样本对(x, x̃)训练重建分布p<sub>reconstruct</sub>(x \| x̃) = p<sub>decoder</sub>(x \| h)，其中h是编码器输出f(x̃)<sup>[1](https://www.deeplearningbook.org/contents/autoencoders.html)</sup>。损失为负对数似然−log p<sub>decoder</sub>(x \| h = f(x̃))，解码器分布通常是由前馈网络输出的均值参数所确定的因子分布<sup>[1](https://www.deeplearningbook.org/contents/autoencoders.html)</sup>。

由于损坏仅施加于输入，网络无法学习恒等映射，从而消除了普通自编码器为避免平凡解所需的瓶颈或其他正则化的需要<sup>[3](https://www.cs.toronto.edu/~larocheh/publications/denoising_autoencoders_tr1316.pdf)</sup>。只要编码器是确定性的，DAE就是一个前馈网络，可用与其他前馈网络相同的技术进行训练<sup>[1](https://www.deeplearningbook.org/contents/autoencoders.html)</sup>。

**损坏选择。** 原始工作使用输入分量的破坏比例ν，基准实验中选定的值根据任务不同在10%到40%之间<sup>[3](https://www.cs.toronto.edu/~larocheh/publications/denoising_autoencoders_tr1316.pdf)</sup>。后来关于高斯损坏的工作将噪声视为加性的，N(x) = x + ε，其中ε ∼ N(0, σ²I)<sup>[4](https://jmlr.csail.mit.edu/papers/volume15/alain14a/alain14a.pdf)</sup>。

## 动机与解释

2008年的论文将该方法定位为对“用于初始化深度架构的良好中间表示应满足什么条件”这一问题的回答。其假设是对输入部分破坏的鲁棒性：高维冗余数据（如图像）中的稳定结构依赖于从许多输入维度组合中收集的证据，因此应当能够仅从部分观测中恢复<sup>[2](https://www.cs.toronto.edu/~larocheh/publications/icml-2008-denoising-autoencoders.pdf)</sup>。

论文还给出了若干形式化视角。从流形学习的角度看，将损坏样本映射回干净数据的方向，便定义并学习了一个低维流形，数据集中分布在该流形附近，中间表示充当该流形上的坐标系<sup>[3](https://www.cs.toronto.edu/~larocheh/publications/denoising_autoencoders_tr1316.pdf)</sup>。从生成模型的角度看，训练准则可以恢复为特定生成模型中的变分推断，学习到的随机算子定义了一个可以进行采样的半参数模型<sup>[3](https://www.cs.toronto.edu/~larocheh/publications/denoising_autoencoders_tr1316.pdf)</sup>。

## DAE学到了什么：得分匹配与收缩联系

一个核心理论结果是，使用高斯损坏和平方误差训练的DAE学到的不仅仅是重建映射。其训练准则使自编码器学习一个向量场g(f(x)) − x，该向量场估计数据分布的得分∇<sub>x</sub> log p(x)<sup>[1](https://www.deeplearningbook.org/contents/autoencoders.html)</sup>。蒙特利尔大学研究员纪尧姆·阿兰和该校教授约书亚·本吉奥在2014年《机器学习研究杂志》的一篇论文中证明，最小化正则化重建误差产生的重建函数在局部刻画了数据生成密度的形状，捕获了对数密度的得分和海森矩阵<sup>[4](https://jmlr.csail.mit.edu/papers/volume15/alain14a/alain14a.pdf)</sup>。

两个进一步的关联使图景更加清晰。第一，具有非常小的高斯损坏和平方误差损失的DAE是一种特殊的收缩自编码器，它收缩整个重建函数r(x) = g(f(x))而不仅仅是编码器，惩罚系数λ = σ²<sup>[4](https://jmlr.csail.mit.edu/papers/volume15/alain14a/alain14a.pdf)</sup>。第二，樊尚在2011年证明，对具有Sigmoid隐藏单元、线性重建单元、高斯噪声和均方误差的自编码器进行去噪训练，等价于使用去噪得分匹配训练具有高斯可见单元的限制[玻尔兹曼机](https://www.edgepedia.org/zh/boltzmann-machine)<sup>[1](https://www.deeplearningbook.org/contents/autoencoders.html)</sup>。本吉奥、姚、阿兰和樊尚后来的工作将生成解释扩展到任意损坏过程、任意重建损失和离散数据，消除了对无穷小噪声的限制<sup>[6](https://arxiv.org/abs/1305.6663)</sup>。

## 堆叠与2008年基准

DAE最初的用途是作为深度网络的构建模块。每一层用去噪准则训练，第k层的表示馈入第k+1层，得到的参数初始化一个在监督准则上微调的网络。损坏过程仅在训练时使用，在前向传播表示时不使用<sup>[3](https://www.cs.toronto.edu/~larocheh/publications/denoising_autoencoders_tr1316.pdf)</sup>。

在包含旋转、随机像素背景和图像背景等附加因素的MNIST变体基准上，三隐藏层堆叠DAE（SdA-3）在大多数情况下优于堆叠普通自编码器，并且在除bg-rand外的所有任务上与最佳对比算法（包括高斯核和多项式核支持向量机以及一层和三层深度信念网络）持平或更好<sup>[3](https://www.cs.toronto.edu/~larocheh/publications/denoising_autoencoders_tr1316.pdf)</sup>。代表性测试误差为：basic上2.80 ± 0.14%（DBN-3为3.11 ± 0.15%），rot上10.29 ± 0.27%，最难的rot-bg-img任务上44.49 ± 0.44%<sup>[3](https://www.cs.toronto.edu/~larocheh/publications/denoising_autoencoders_tr1316.pdf)</sup>。对学习到的滤波器的视觉检查表明，在没有损坏时许多滤波器保持为几乎均匀的灰色斑块，而随着破坏程度增加，产生了笔画检测器，在高噪声下则产生完整的字符检测器<sup>[3](https://www.cs.toronto.edu/~larocheh/publications/denoising_autoencoders_tr1316.pdf)</sup>。

使用自编码器进行去噪作为重建任务本身早于2008年的论文：作者指出它早在1987年就由勒昆以及加利纳里及其同事提出，作为霍普菲尔德模型的替代方案，但目标不同——是构建一个有竞争力的去噪算法而非学习表示<sup>[3](https://www.cs.toronto.edu/~larocheh/publications/denoising_autoencoders_tr1316.pdf)</sup>。

## 在异常检测和医学成像中的应用

基于自编码器的异常检测在正常数据上训练，通过重建误差标记异常。普通深度自编码器存在恒等映射问题，即高容量网络会复制包括异常区域在内的输入，以及模糊重建丢失高频纹理的问题。去噪自编码器通过向正常图像添加噪声并学习恢复干净图像来解决这个问题，这促使模型关注结构信息而非逐像素复制<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC13203773/)</sup>。

噪声的选择很重要。安塔纳斯·卡斯切纳斯及其同事在脑部MRI和CT异常检测的工作中表明，朴素的逐像素噪声导致较差的异常检测性能，而优化噪声的空间分辨率和幅度可以改善结果；中间空间尺度上的粗粒度噪声强制结构一致性并提高异常敏感性<sup>[8](https://arxiv.org/abs/2301.08330)</sup><sup> • </sup><sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC13203773/)</sup>。他们的结论是，使用粗噪声训练的DAE是一种快速简单的方法，在其两个真实世界数据集上达到了最先进的准确率<sup>[8](https://arxiv.org/abs/2301.08330)</sup>。训练噪声控制着重建细节量与异常消除量之间的权衡，两者都影响检测<sup>[8](https://arxiv.org/abs/2301.08330)</sup>。DAE变体也出现在应用医学流程中，例如多尺度深度去噪自编码器与单类支持向量机结合用于视网膜OCT成像中的异常检测<sup>[9](https://pmc.ncbi.nlm.nih.gov/articles/PMC13140303/)</sup>。

## 与掩码自编码器和扩散模型的关系

去噪思想在现代自监督学习中以大规模形式重新出现。2022年的一项综述指出，掩码图像建模的成功复兴了掩码自编码器，后者在过去常被称为去噪自编码器<sup>[5](https://arxiv.org/abs/2208.00173)</sup>。Facebook人工智能研究院的[何恺明](https://www.edgepedia.org/zh/kaiming-he)及其同事提出的掩码自编码器（MAE）掩蔽随机图像块并重建缺失像素，使用75%的掩蔽率和非对称编码器-解码器设计；以这种方式预训练的ViT-Huge模型在仅使用ImageNet-1K数据的方法中达到了87.8%的准确率<sup>[10](https://openaccess.thecvf.com/content/CVPR2022/html/He_Masked_Autoencoders_Are_Scalable_Vision_Learners_CVPR_2022_paper.html)</sup>。

扩散模型将去噪扩展为生成过程：它们通过迭代地将噪声精炼为连贯数据来生成，去噪扩散概率模型、基于得分的模型和得分随机微分方程是主要的表述形式<sup>[11](https://doi.org/10.1145/3626235)</sup>。在医学成像综述中，通过渐进去噪恢复正常结构的基于扩散的重建方法被视为同一去噪原理的后裔<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC13203773/)</sup>。

## References

1. [Autoencoders, Chapter 14 of Deep Learning (Goodfellow, Bengio, Courville), deeplearningbook.org](https://www.deeplearningbook.org/contents/autoencoders.html)
2. [Vincent, Larochelle, Bengio, Manzagol (2008). Extracting and Composing Robust Features with Denoising Autoencoders, ICML 2008.](https://www.cs.toronto.edu/~larocheh/publications/icml-2008-denoising-autoencoders.pdf)
3. [Vincent et al. (2008). Technical Report 1316: Extracting and Composing Robust Features with Denoising Autoencoders, Université de Montréal.](https://www.cs.toronto.edu/~larocheh/publications/denoising_autoencoders_tr1316.pdf)
4. [Alain, Bengio (2014). What Regularized Auto-Encoders Learn from the Data-Generating Distribution, JMLR 15:3743–3773.](https://jmlr.csail.mit.edu/papers/volume15/alain14a/alain14a.pdf)
5. [Zhang et al. (2022). A Survey on Masked Autoencoder for Self-supervised Learning in Vision and Beyond, arXiv:2208.00173.](https://arxiv.org/abs/2208.00173)
6. [Bengio, Yao, Alain, Vincent (2013). Generalized Denoising Auto-Encoders as Generative Models, arXiv:1305.6663.](https://arxiv.org/abs/1305.6663)
7. [Unsupervised Anomaly Detection in Medical Imaging: A Survey of Methods, Challenges, and Future Directions, PMC.](https://pmc.ncbi.nlm.nih.gov/articles/PMC13203773/)
8. [Kascenas et al. (2023). The role of noise in denoising models for anomaly detection in medical images, arXiv:2301.08330.](https://arxiv.org/abs/2301.08330)
9. [The Clinical Significance of Imaging Biomarkers Discoverable by Anomaly Detection Methods in Retinal Diseases: A Review, PMC.](https://pmc.ncbi.nlm.nih.gov/articles/PMC13140303/)
10. [He et al. (2022). Masked Autoencoders Are Scalable Vision Learners, CVPR 2022, pp. 16000–16009.](https://openaccess.thecvf.com/content/CVPR2022/html/He_Masked_Autoencoders_Are_Scalable_Vision_Learners_CVPR_2022_paper.html)
11. [Diffusion Models: A Comprehensive Survey of Methods and Applications, ACM Computing Surveys.](https://doi.org/10.1145/3626235)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Neural networks and deep learning › Generative and self-supervised models

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/denoising-autoencoder

English original: https://www.edgepedia.org/denoising-autoencoder
