# 基于深度学习的缺陷检测

**基于深度学习的缺陷检测**，是利用深度神经网络从图像或传感器数据中发现、定位并分类工业产品缺陷的方法，取代了建立在手工设计图像处理特征之上的检测流程。它应用于金属、陶瓷、玻璃、纺织、电子、焊接部件和增材制造等制造领域，并支撑现代自动光学检测系统。<sup>[1](https://doi.org/10.1016/j.aei.2025.104067)</sup><sup> • </sup><sup>[2](https://www.mdpi.com/1999-4893/16/2/95)</sup><sup> • </sup><sup>[3](https://www.sciencedirect.com/science/article/pii/S0166361523000611)</sup>

| 关键事实 | 说明 |
|---|---|
| 学习范式 | 监督、半监督和无监督方法，依据已有标注缺陷数据的多少选用<sup>[2](https://www.mdpi.com/1999-4893/16/2/95)</sup> |
| 任务 | 缺陷分类、检测（边界框）、分割（像素级定位）和异常检测<sup>[4](https://xplorestaging.ieee.org/document/10113226/)</sup><sup> • </sup><sup>[5](https://www.mdpi.com/2079-9292/15/12/2727)</sup> |
| 数据模态 | 二维成像与三维传感，各自对应不同的方法族<sup>[6](https://www.sciencedirect.com/science/article/abs/pii/S0278612525002845)</sup> |
| 已报道的 CNN 性能 | 在焊缝缺陷检测中，CNN 分类器准确率超过 95%，分割网络平均 IoU 约为 85–91%，但结果取决于数据集<sup>[7](https://www.sciencedirect.com/science/article/pii/S036083522500871X)</sup> |
| 检测器权衡 | 基于 YOLO 的检测器在精度与速度之间取得最佳平衡；Transformer 混合模型精度最高，但计算代价更大<sup>[7](https://www.sciencedirect.com/science/article/pii/S036083522500871X)</sup> |
| 基准饱和 | 在 MVTec AD 和 VisA 上，最先进的分割 AU-PRO 值目前差距不到一个百分点，限制了这些基准区分模型的能力<sup>[8](https://arxiv.org/abs/2503.21622)</sup> |
| 核心数据挑战 | 训练数据不足、数据生成昂贵、缺陷尺寸小，以及表面缺陷出现频率低<sup>[9](https://arxiv.org/abs/2109.11304)</sup> |

## 为什么深度学习取代了基于手工特征的检测

在卷积神经网络（CNN）普及之前，质量检测依赖参数化图像处理算法，并结合显式编码的人类知识，由人工提取、选择和验证特征。[深度学习](https://www.edgepedia.org/zh/deep-learning)改变了这一点：它能自动发现适合任务的特征表示，从而推动了工业质量评估领域科学论文和商业产品的快速增长。<sup>[4](https://xplorestaging.ieee.org/document/10113226/)</sup> 该领域的一项综述回顾了截至 2023 年 2 月发表的 220 多篇相关文章。<sup>[4](https://xplorestaging.ieee.org/document/10113226/)</sup>

基于深度学习的方法如今构成了现代自动光学检测的基础。按网络连接方式，可分为稠密网络和稀疏网络；按学习类型，可分为监督模型和无监督模型：前者主要用于分类和分割，后者则免去了标注图像和标注像素的成本。<sup>[3](https://www.sciencedirect.com/science/article/pii/S0166361523000611)</sup>

## 学习范式

**监督方法**在有标注的缺陷图像上训练，执行分类、检测或分割。当有足够多的标注样本时，它们能取得很高的实测准确率，但工业数据很少如此配合：缺陷稀少、尺寸小且形态多样，标注成本高昂。<sup>[2](https://www.mdpi.com/1999-4893/16/2/95)</sup><sup> • </sup><sup>[9](https://arxiv.org/abs/2109.11304)</sup>

**半监督和小样本方法**直接针对标注数据稀缺的情形。一项专门讨论少标注样本表面缺陷检测的综述，将该领域分为传统图像处理方法和面向有限标注设计的深度学习方法。<sup>[10](https://arxiv.org/abs/2203.05733)</sup>

**无监督异常检测**学习无缺陷生产图像的规律，并标记出与这一基线模板不一致的离群样本，因此无需标注异常数据就能识别新的缺陷类型。<sup>[4](https://xplorestaging.ieee.org/document/10113226/)</sup><sup> • </sup><sup>[6](https://www.sciencedirect.com/science/article/abs/pii/S0278612525002845)</sup> 生成式方法，包括生成对抗网络（GAN）和扩散模型，因其无需大量标注数据集即可检测异常的能力而被采用。<sup>[1](https://doi.org/10.1016/j.aei.2025.104067)</sup> 这一范式常被称为工业视觉异常检测，其快速发展被认为是工业图像异常检测研究的一个里程碑。<sup>[11](https://link.springer.com/article/10.1007/s11633-023-1459-z)</sup>

## 模型族及其权衡

得益于强大的特征提取能力，基于 CNN 和金字塔网络的模型仍被列为最常用于检测工业表面缺陷的深度学习方法之一。<sup>[5](https://www.mdpi.com/2079-9292/15/12/2727)</sup> 一项关于焊缝缺陷检测的元分析这样描绘比较图景：CNN 分类器表现稳健，但会对数据中的偏差作出反应；分割网络效果良好，但结果波动；基于 YOLO 的检测器能可靠地在精度与速度之间提供最佳折中；Transformer 混合模型精度最高，但成本更高。<sup>[7](https://www.sciencedirect.com/science/article/pii/S036083522500871X)</sup>

新兴策略进一步扩展了这一集合。基于 Transformer 的模型、小样本学习、大语言模型（LLM）和基础模型正被探索用于缺陷检测，无监督生成方法也在其列。<sup>[1](https://doi.org/10.1016/j.aei.2025.104067)</sup>

## 基准及其局限

该领域的标准数据集是 MVTec AD、VisA 和 BTAD，其中 MVTec AD 和 VisA 在工业异常检测研究中使用最广。<sup>[12](https://link.springer.com/chapter/10.1007/978-3-031-73113-6_26)</sup><sup> • </sup><sup>[13](https://bmva-archive.org.uk/bmvc/2025/assets/papers/Paper_922/paper.pdf)</sup> 在 MVTec AD 的统一多类设置下，ReContrast 方法报告了 98.2% 的图像级 AUROC，超过了此前由 UniAD 保持的 96.5% 的最先进水平。<sup>[14](https://papers.nips.cc/paper_files/paper/2023/file/228b9279ecf9bbafe582406850c57115-Paper-Conference.pdf)</sup>

**基准饱和**已成为一个实际问题。在 MVTec AD 和 VisA 上，分割 AU-PRO 的性能已开始饱和，最先进模型之间的差距常常不到一个百分点。这种区分力的缺乏妨碍了有意义的模型比较，也阻碍了进展，尤其考虑到机器学习结果固有的随机性。<sup>[8](https://arxiv.org/abs/2503.21622)</sup>

较新的数据集瞄准这一缺口。MVTec AD 2 包含早期数据集未涉及、具有挑战性且贴近工业检测的场景——例如透明和重叠物品、暗场和背光设置、异常多样的正常数据，以及小到难以轻易发现的缺陷——作者还维护了一个公开评测服务器，为测试集提供像素级精确的真值。<sup>[8](https://arxiv.org/abs/2503.21622)</sup> MVTec LOCO AD 数据集增加了逻辑约束异常，即单个部件正常，但其结构违反预期。<sup>[15](https://link.springer.com/article/10.1007/s11263-022-01578-9)</sup> 在 MVTec-AD、BTAD、VisA 和 VIADUCT 中，VIADUCT 数据集按图像、类别和缺陷数量计是该领域最大的，不过在一个数据集上表现良好的方法未必能迁移到其他数据集。<sup>[16](https://www.ecva.net/papers/eccv_2024/papers_ECCV/papers/08661.pdf)</sup>

## 工业挑战

各综述反复报告的困难相当一致。训练数据不足且生成昂贵，缺陷尺寸小且出现频率低，各类别样本不均衡；生产线还要求实时处理。<sup>[9](https://arxiv.org/abs/2109.11304)</sup><sup> • </sup><sup>[2](https://www.mdpi.com/1999-4893/16/2/95)</sup> 部署还带来精度与吞吐量之间的权衡、标注负担，以及域偏移下的鲁棒性问题。<sup>[17](https://www.techscience.com/cmc/v88n1/67279/html)</sup>

可靠性是另一个顾虑。模型可能过度自信且校准不佳，工业部署取决于模型可信度、人在回路框架和可靠性评估技术。<sup>[1](https://doi.org/10.1016/j.aei.2025.104067)</sup> 一项对视觉工业异常检测的批判性分析还发现，学术基准与工业需求之间存在差距，指出评估需要大幅标准化才能反映真实世界条件，并且即使噪声标签比例很高，真正无监督的方法仍未超过大多数单类方法。<sup>[18](https://openaccess.thecvf.com/content/CVPR2025W/VAND/papers/Baitieva_Beyond_Academic_Benchmarks_Critical_Analysis_and_Best_Practices_for_Visual_CVPRW_2025_paper.pdf)</sup>

## 最近发生了什么变化

三个转变标志着该领域近期的方向。第一，覆盖范围已从二维图像扩展到二维与三维结合的缺陷检测方法。<sup>[6](https://www.sciencedirect.com/science/article/abs/pii/S0278612525002845)</sup> 第二，无监督范式已从边缘课题转变为核心研究场景，出现了专门综述以及为标签稀缺检测设计的生成式方法（GAN、扩散模型）。<sup>[11](https://link.springer.com/article/10.1007/s11633-023-1459-z)</sup><sup> • </sup><sup>[1](https://doi.org/10.1016/j.aei.2025.104067)</sup> 第三，基准设计正在回应饱和问题：MVTec AD 2 和 MVTec LOCO AD 引入更困难的场景，如透明物体、逻辑异常和极小缺陷，正是因为较旧的基准已无法区分强模型。<sup>[8](https://arxiv.org/abs/2503.21622)</sup><sup> • </sup><sup>[15](https://link.springer.com/article/10.1007/s11263-022-01578-9)</sup>

## References

1. [Lutfun Nahar, Mohammad Awrangjeb, Md. Saiful Islam. AI-enabled defect detection in industrial products: A comprehensive survey, key insights and future research challenges. Advanced Engineering Informatics 69 (2026), 104067.](https://doi.org/10.1016/j.aei.2025.104067)
2. [Defect Detection Methods for Industrial Products Using Deep Learning Techniques: A Review. Algorithms 16(2), 95 (2023).](https://www.mdpi.com/1999-4893/16/2/95)
3. [Deep CNN-based visual defect detection: Survey of current literature. Computers in Industry 148 (2023), 103911.](https://www.sciencedirect.com/science/article/pii/S0166361523000611)
4. [Automatic vision-based recognition of industrial surface defects: A survey. IEEE (2023).](https://xplorestaging.ieee.org/document/10113226/)
5. [State of the Art in AI-Based Visual Inspection for Industrial Quality Control. Electronics 15(12), 2727 (2025).](https://www.mdpi.com/2079-9292/15/12/2727)
6. [A comprehensive survey for real-world industrial surface defect detection: Challenges, approaches, and prospects. Journal of Manufacturing Systems 84 (2026), 152–172.](https://www.sciencedirect.com/science/article/abs/pii/S0278612525002845)
7. [Deep learning approaches for weld defect detection: A comprehensive review. Computers & Industrial Engineering (2025).](https://www.sciencedirect.com/science/article/pii/S036083522500871X)
8. [The MVTec AD 2 Dataset: Advanced Scenarios for Unsupervised Anomaly Detection. arXiv:2503.21622.](https://arxiv.org/abs/2503.21622)
9. [Deep Learning Strategies for Industrial Surface Defect Detection Systems. arXiv:2109.11304.](https://arxiv.org/abs/2109.11304)
10. [A Survey of Surface Defect Detection of Industrial Products Based on A Small Number of Labeled Data. arXiv:2203.05733.](https://arxiv.org/abs/2203.05733)
11. [Deep Industrial Image Anomaly Detection: A Survey. Machine Intelligence Research (2023).](https://link.springer.com/article/10.1007/s11633-023-1459-z)
12. [AD3: Introducing a Score for Anomaly Detection Dataset Difficulty Assessment Using VIADUCT Dataset. Springer (2024).](https://link.springer.com/chapter/10.1007/978-3-031-73113-6_26)
13. [Experiments on MVTec AD and VisA benchmark datasets. BMVC 2025.](https://bmva-archive.org.uk/bmvc/2025/assets/papers/Paper_922/paper.pdf)
14. [ReContrast: anomaly detection performances under unified multi-class setting on MVTec AD. NeurIPS 2023.](https://papers.nips.cc/paper_files/paper/2023/file/228b9279ecf9bbafe582406850c57115-Paper-Conference.pdf)
15. [Beyond Dents and Scratches: Logical Constraints in Unsupervised Anomaly Detection and Localization. International Journal of Computer Vision (2022).](https://link.springer.com/article/10.1007/s11263-022-01578-9)
16. [AD3: Anomaly Detection Dataset Difficulty assessment. ECCV 2024.](https://www.ecva.net/papers/eccv_2024/papers_ECCV/papers/08661.pdf)
17. [Applying Deep Learning to Defect Detection in Steel Manufacturing. CMC (2025).](https://www.techscience.com/cmc/v88n1/67279/html)
18. [Beyond Academic Benchmarks: Critical Analysis and Best Practices for Visual Industrial Anomaly Detection. CVPR 2025 Workshops.](https://openaccess.thecvf.com/content/CVPR2025W/VAND/papers/Baitieva_Beyond_Academic_Benchmarks_Critical_Analysis_and_Best_Practices_for_Visual_CVPRW_2025_paper.pdf)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 工程与制造 › 机器人技术与自动化 › Robot software, AI, and methods › Industrial machine vision and automation

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/deep-learning-based-defect-detection

English original: https://www.edgepedia.org/deep-learning-based-defect-detection
