基于深度学习的金属表面缺陷检测算法
Metal Surface Defect Detection Algorithm Based on Deep Learning
摘要: 针对金属表面缺陷检测存在背景纹理干扰强、缺陷尺度跨度大、微细缺陷易漏检、模糊缺陷定位不准等问题,本文基于YOLOv12n模型,从特征提取、边界回归与激活函数三个维度进行针对性改进,提出一种适用于金属表面缺陷检测的优化算法。通过构建A2C2f_DFFN_DYT_Mona多尺度频域特征增强模块,强化复杂背景下的缺陷特征提取能力,弥补原生模型特征表征不足的缺陷;融合MPDIoU、Focaler-IoU与动态Wise-IoUv3损失机制,自适应平衡难易样本权重,有效抑制标注噪声干扰,提升微小、模糊缺陷的边界定位精度;引入Hardswish轻量化激活函数替换SiLU激活函数,在保证特征拟合能力的前提下降低推理开销,提升模型实时检测性能。实验结果表明,相较于原始YOLOv12n模型,本文改进算法的精度、召回率、mAP50-95与全流程FPS分别提升1.24%、3.07%、0.46%、0.71%,在提升精度的同时保持了高效率,能够有效满足工业金属缺陷实时质检需求。
Abstract: For problems such as strong background texture interference, large defect scale range, easy missed detection of micro-defects, and inaccurate positioning of blurry defects in metal surface defect detection, this paper improves the YOLOv12n model from three dimensions: feature extraction, boundary regression, and activation functions, and proposes an optimized algorithm suitable for metal surface defect detection. By constructing the A2C2f_DFFN_DYT_Mona multi-scale frequency domain feature enhancement module, the defect feature extraction ability in complex backgrounds is strengthened, and the deficiency of insufficient feature representation in the original model is compensated; by integrating the MPDIoU, Focaler-IoU and dynamic Wise-IoUv3 loss mechanisms, the weights of difficult and easy samples are adaptively balanced, and the interference of annotation noise is effectively suppressed, improving the boundary positioning accuracy of tiny and blurry defects; by introducing the Hardswish lightweight activation function to replace the SiLU activation function, the feature fitting ability is ensured while reducing the inference cost, and the real-time detection performance of the model is improved. Experimental results show that compared with the original YOLOv12n model, the improved algorithm’s accuracy, recall rate, mAP50-95 and the overall FPS have increased by 1.24%, 3.07%, 0.46% and 0.71% respectively. While improving the accuracy, it maintains high efficiency and can effectively meet the real-time quality inspection requirements of industrial metal defects.
参考文献
|
[1]
|
Ma, J., Zhou, Y., Zhou, Z., Zhang, Y. and He, L. (2025) Toward Smart Ocean Monitoring: Real-Time Detection of Marine Litter Using YOLOv12 in Support of Pollution Mitigation. Marine Pollution Bulletin, 217, Article 118136. https://doi.org/10.1016/j.marpolbul.2025.118136
|
|
[2]
|
Zhu, Y. and Jia, S. (2026) An Improved YOLOv8-Based Algorithm for Industrial Metal Surface Defect Detection. Journal of Electronic Research and Application, 10, 50-68.
|
|
[3]
|
Cao, Y., Yao, Y. and Lu, L. (2026) Lightweight Metal Surface Defect Detection Algorithm Based on Pruning and Knowledge Distillation. Scientific Reports. https://doi.org/10.1038/s41598-026-57496-0
|
|
[4]
|
卢开喜, 段先华, 陶宇诚, 等. KThin-YOLOv7: 轻量级的焊接件表面缺陷检测[J]. 电子测量技术, 2024, 47(7): 9-18.
|
|
[5]
|
盛良浩, 贾小云, 白颖洁, 等. 基于YOLOv8的轻量化金属表面缺陷检测模型[J]. 科学技术与工程, 2026, 26(7): 2990-2999.
|
|
[6]
|
韩涛, 于帅帅, 黄友锐, 等. PV-YOLOv12n: 多模态光伏组件故障检测模型[J]. 激光与光电子学进展, 2026, 63(6): 522-536.
|
|
[7]
|
郑楠, 付帅, 刘依萍, 等. 面向复杂场景的YOLOv11n小目标交通标志检测算法[J/OL]. 电子技术应用: 1-9. https://link.cnki.net/urlid/11.2305.TN.20260624.1435.002, 2026-07-19.
|
|
[8]
|
宋旭东, 顾亚良, 宋亮. 基于图像识别的PCB表观缺陷检测方法研究[J]. 大连交通大学学报, 2025, 46(5): 153-160.
|
|
[9]
|
Dang, C.T., Sato, H. and Kubo, M. (2025) EAW-YOLO11: Enhanced YOLO11 Network for Underwater Object Detection. Artificial Life and Robotics, 30, 773-785. https://doi.org/10.1007/s10015-025-01067-5
|
|
[10]
|
张振楷, 张浩, 信恒府, 等. 基于改进LU2Net的浑浊水偏振图像增强[J]. 电子测量技术, 2026, 49(4): 236-246.
|