基于改进YOLOv8算法的焊缝缺陷检测研究
Research on Weld Defect Detection Based on Improved YOLOv8 Algorithm
DOI: 10.12677/csa.2026.165181, PDF,   
作者: 胡劭明, 罗柏文:湖南科技大学机电工程学院,湖南 湘潭
关键词: 焊缝缺陷微小缺陷YOLOv8CSWinTransformerWeld Defect Micro Defect YOLOv8 CSWinTransformer
摘要: 缺陷识别与分类是机器视觉焊缝缺陷检测流程的核心收尾环节。针对焊缝缺陷(如气孔、夹渣、裂纹、未熔合)特征微弱、易被噪声与背景纹理淹没的识别难题,文章提出一种基于YOLOv8算法改进的YOLO-CCS模型。首先使用CSWinTransformer替换了原骨干网络的特征提取模块,之后对其进行结构化通道剪枝,降低模型参数量和计算量。其次在FPN-PAN网络中融合双注意力SimAM和CBAM形成AttentionFPNPAN颈部模块,起到抑制焊接背景干扰和强化微小缺陷(Φ0.2~2 mm)特征的作用。同时新增P2微小缺陷检测头,移除了原来的P5大目标检测头,解决了对微小缺陷出现误检漏检的问题。结果表明,训练后的精确率为92.3%,召回率为90.2%,mAP@0.5 (%)达到90.3%,效果优于其他主流算法。
Abstract: Defect detection and classification constitute the critical concluding phase in machine vision-based weld defect inspection processes. To address the challenge of weak feature recognition for weld defects (e.g., porosity, slag inclusion, cracks, and incomplete fusion) that are easily obscured by noise and background textures, this study proposes an improved YOLO-CCS model based on the YOLOv8 algorithm. First, the original backbone network’s feature extraction module is replaced with CSWinTransformer, followed by structured channel pruning to reduce model parameters and computational complexity. The FPN-PAN network integrates dual attention mechanisms (SimAM and CBAM) in the AttentionFPNPAN neck module, effectively suppressing welding background interference while enhancing subtle defect (Φ0.2~2 mm) detection. Additionally, a new P2 micro-defect detection head replaces the original P5 large-object detection head to resolve false detection and missed detection issues. Experimental results demonstrate a trained precision rate of 92.3%, recall rate of 90.2%, and mAP@0.5% score of 90.3%, outperforming other mainstream algorithms.
文章引用:胡劭明, 罗柏文. 基于改进YOLOv8算法的焊缝缺陷检测研究[J]. 计算机科学与应用, 2026, 16(5): 251-262. https://doi.org/10.12677/csa.2026.165181

参考文献

[1] 李砚峰, 刘翠荣, 孙前来, 等. 基于机器视觉的机械钢板焊缝缺陷检测技术应用——评《焊接机械基础》[J]. 机械设计, 2020, 37(10): 149.
[2] Nowroth, C., Gu, T., Grajczak, J., Nothdurft, S., Twiefel, J., Hermsdorf, J., et al. (2022) Deep Learning-Based Weld Contour and Defect Detection from Micrographs of Laser Beam Welded Semi-Finished Products. Applied Sciences, 12, Article No. 4645. [Google Scholar] [CrossRef
[3] 彭波, 曹毅, 邓徐韬, 等. 基于机器视觉的大幅面管板焊缝检测方法与系统设计[J]. 东方电气评论, 2023, 37(3): 62-66.
[4] 程俊华. 基于深度学习的焊接缺陷电磁涡流检测及识别[D]: [硕士学位论文]. 天津: 天津工业大学, 2023.
[5] 王志鹏. 基于改进的Faster R-CNN的焊缝缺陷检测研究[D]: [硕士学位论文]. 北京: 北京交通大学, 2023.
[6] 肖文凯, 南水鱼, 张琳琳. 基于卷积神经网络的X射线焊缝缺陷检测算法研究[J]. 自动化仪表, 2022, 43(8): 67-72.
[7] 彭洪晟. 深度学习在X射线焊缝图像缺陷检测中的应用研究[D]: [硕士学位论文]. 武汉: 武汉工程大学, 2022.
[8] Yang, L., Wang, H., Huo, B., Li, F. and Liu, Y. (2021) An Automatic Welding Defect Location Algorithm Based on Deep Learning. NDT & E International, 120, Article ID: 102435. [Google Scholar] [CrossRef
[9] 支泽林, 姜洪权, 杨得焱, 等. 图谱数据深度学习融合模型及焊缝缺陷识别方法[J]. 西安交通大学学报, 2021, 55(5): 73-82.
[10] 谷静, 谢泽群, 张心雨. 基于改进深度学习模型的焊缝缺陷检测算法[J]. 宇航计测技术, 2020, 40(3): 75-79+87.
[11] Sun, H., Fu, R., Wang, X., Wu, Y., Al-Absi, M.A., Cheng, Z., et al. (2025) Efficient Deep Learning-Based Tomato Leaf Disease Detection through Global and Local Feature Fusion. BMC Plant Biology, 25, Article No. 311. [Google Scholar] [CrossRef] [PubMed]
[12] 周舟, 王海鹏, 徐丰, 等. 基于通道剪枝的SAR图像舰船检测优化算法[J]. 上海航天(中英文), 2020, 37(4): 48-54.
[13] Chen, B., Zhang, Z., Liu, N., Tan, Y., Liu, X. and Chen, T. (2020) Spatiotemporal Convolutional Neural Network with Convolutional Block Attention Module for Micro-Expression Recognition. Information, 11, Article No. 380. [Google Scholar] [CrossRef
[14] Shi, C., Zhu, D., Zhou, C., Cheng, S. and Zou, C. (2024) Gpmb-yolo: A Lightweight Model for Efficient Blood Cell Detection in Medical Imaging. Health Information Science and Systems, 12, Article No. 24. [Google Scholar] [CrossRef] [PubMed]
[15] 郑有凯, 胡君红, 田春欣. 基于自适应特征融合和任务对齐的小目标检测算法[J]. 激光杂志, 2024, 45(2): 36-42.
[16] 崔学智, 冯全, 王书志, 等. 边缘设备上的葡萄园田间场景障碍检测[J]. 中国农机化学报, 2021, 42(9): 150-156.
[17] 曹晋晋. 基于改进的Faster-RCNN的焊缝特征提取[J]. 科技与创新, 2023(18): 63-67.
[18] 周翌晨, 虞旦, 李佳成, 等. 基于改进YOLOv5的焊缝识别算法研究[J]. 制造技术与机床, 2024(7): 19-25.
[19] 侯芯露, 黄凌霄, 姚新波, 等. 基于多版本YOLO模型的工业缺陷检测性能对比研究[J]. 电脑知识与技术, 2025, 21(31): 20-25.