[1]原子昊,翟中波,章毅恒,等.基于改进YOLOv5算法的汽车零件焊点缺陷检测研究[J].机械与电子,2026,44(06):113-120.
 YUAN Zihao,ZHAI Zhongbo,ZHANG Yiheng,et al.Research on Automotive Part Weld Defect Detection Based on an Improved YOLOv5 Algorithm[J].Machinery & Electronics,2026,44(06):113-120.
点击复制

基于改进YOLOv5算法的汽车零件焊点缺陷检测研究()
分享到:

《机械与电子》[ISSN:1001-2257/CN:52-1052/TH]

卷:
44
期数:
2026年06期
页码:
113-120
栏目:
智能制造
出版日期:
2026-06-27

文章信息/Info

Title:
Research on Automotive Part Weld Defect Detection Based on an Improved YOLOv5 Algorithm
文章编号:
1001-2257(2026)06-0113-08
作者:
原子昊翟中波章毅恒孔 博卢江林
重庆交通职业学院,重庆 江津 402247
Author(s):
YUAN ZihaoZHAI ZhongboZHANG YihengKONG BoLU Jianglin
(Chongqing College of Transportation,Jiangjin 402247,China)
关键词:
Ov5深度学习Transformer多头自注意力机制Focal-EIoU
Keywords:
YOLOv5deep learningTransformermulti-head self-attentionFocal-EIoU
分类号:
U466;TG441.7
文献标志码:
A
摘要:
针对汽车零件焊点缺陷检测任务,使用专业工业相机采集了1 635个样本,构建了涵盖焊穿、焊缝和缺口等缺陷类型的专用数据集。以YOLOv5深度学习模型为基础模型,引入Transformer的多头自注意力机制MHSA,将其嵌入骨干网络与特征融合模块,以增强复杂背景下的特征提取能力,并采用Focal-EIoU 损失函数优化目标定位精度。实验结果表明,改进后的YOLOv5在自建数据集上的mAP50和mAP50-95分别较原始模型提升2百分点和4百分点。在计算开销方面,改进模型的推理延迟由40.02 ms降至35.01 ms,FPS由24.99帧/s提升至28.56帧/s,显存占用仅增加7.12 MB,在保持高效推理的同时实现了更优的检测精度,在工业视觉自动检测场景下展现出优越的检测性能。
Abstract:
For the task of weld defect detection in automotive parts,a dedicated dataset comprising 1,635 samples was constructed using professional industrial camera,covering defect types such as burn-through,weld seam,and gap.Using YOLOv5 as the baseline deep learning model,the multi-head self-attention (MHSA) mechanism from the Transformer was introduced and embedded into both the backbone network and the feature fusion module to enhance feature extraction capability under complex backgrounds. Additionally,the Focal-EIoU loss function was adopted to optimize object localization accuracy.Experimental results show that the improved YOLOv5 achieves a 2 percentage point increase in mAP50 and a 4 percentage point increase in mAP50-95 on the self-constructed dataset,compared to the original algorithm.In terms of computational cost,the inference latency of the improved model is reduced from 40.02 ms to 35.01 ms,while the FPS increases from 24.99 to 28.56,with GPU memory usage increasing by only 7.12 MB.The proposed model achieves superior detection accuracy while maintaining high inference efficiency,demonstrating superior detection performance in automated industrial visual inspection scenarios.

参考文献/References:

[1] 曹鹏彬,李健轲,王强,等.基于生成对抗网络数据增强与迁移学习的小样本激光软钎焊焊点缺陷检测研究[J/OL].焊接学报,2026-01-20.https:∥link.cnki.net/urlid/23.1178.TG.20260119.1658.002.

[2] 郭庆,张文斌,景亚鹏,等.电动扬声器智能检测与自动分类系统的设计[J].仪表技术与传感器,2021(1):48-52.
[3] 刘重遥.基于机器视觉的银线焊点定位以及缺陷检测系统设计[D].成都:电子科技大学,2024.
[4] Xia Guisong,Bai Xiang,Ding Jian,et al.DOTA:a large scale dataset for object detection in aerial images[C]∥ 2018 IEEE Conference on Computer Vision and Pattern Recognition.New York :IEEE,2018:3974-3983.
[5] Zhang Jing,Liang Xi,Wang Meng,et al.Coarse-to-fine object detection in unmanned aerial vehicle imagery using lightweight convolutional neural network and deep motion saliency [J].Neurocomputing,2020,398:555-565.
[6] Pathak A R,Pandey M,Rautaray S.Application of deep learning for object detection [J].Procedia Computer Science,2018,132:1706-1717.
[7] 刘兆英,陈志远,张婷,等.改进YOLOv5的工业产品表面缺陷检测方法[J].郑州大学学报(工学版),2025, 46(5):18-25.
[8] Chen Chenyi,Liu Mingyu,Tuzel O,et al.R-CNN for small object detection[C]∥Computer Vision– ACCV 2016,2016:214-230.
[9] Girshick R.Fast R-CNN[C]∥2015 IEEE International Conference on Computer Vision (ICCV).New York:IEEE,2015:1440-1448.
[10] Ren shaoqing,He Kaiming,Girshick R,et al.Faster R-CNN:towards real-time object detection with region proposal networks[C]∥Proceedings of the 28th International Conference on Neural Information Processing Systems,2015:91-99.
[11] Jiang Peiyuan,Ergu D J,Liu Fangyao,et al.A review of YOLO algonthm developments[J].Procedia Computer Science, 2022,199:1066-1073.
[12] Redmon J,Farhadi A.Yolo9000:better,faster,stronger[ C]∥2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR).New York :IEEE,2017:6517-6525.
[13] Sruthi M S,Poovathingal M J,Nandana V N,et al. YOLOv5 based open-source UAV for human detection during search and rescue (SAR) [C]∥2021 International Conference on Advances in Computing and Communications (ICACC).New York :IEEE,2021:1-6.
[14] Zhu Xingkui,Lyu Shuchang,Wang Xu,et al.TPH-YOLOv5:improved YOLOv5 based on transformer prediction head for object detection on drone-capturedscenarios[C]∥2021 IEEE/CVF International Conference on Computer Vision Workshops (ICCVW). New York :IEEE,2021:2778-2788.
[15] Liu Wei,Anguelov D,Erhan D,et al.SSD:single shot multibox detector[C ∥Computer Vision – ECCV 2016,2016:21-37.
[16] Huang Zhanchao,Wang Jianlin,Fu Xuesong,et al.DCSPP-YOLO:dense connection and spatial pyramid pooling based YOLO for object detection [J].Information Sciences,2020,522:241-258.
[17] Wu Weihao,Li Qing.Machine vision inspection of electrical connectors based on improved YOLOv3 [J]. IEEE Access,2020,8:166184-166196.
[18] Liu Guoxu,Nouaze J C,Mbouembe P L T,et al.YOLO-tomato:A robust algorithm for tomato detection based on YOLOv3 [J].Sensors,2020,20(7):2145.
[19] Hsu W Y,Lin W Y.Ratio-and-scale-aware YOLO for pedestrian detection [J].IEEE Transactions on Image Processing,2020,30:934-947.
[20] Vaswani A,Shazeer N,Parmar N,et al.Attention is all you need[J].Advances in Neural Information Processing Systems 30 (NIPS 2017),2017,30:6000-6010.
[21] Wei Changyun,Han Hui,WU Zhichao,et al.Transformer-based multiscale reconstruction network for defect detection of infrared images [J].IEEE Transactions on Instrumentation and Measurement,2024, 73:5037414.
[22] Srinivas A,Lin T Y,Parmar N,et al.Bottleneck transformers for visual recognition[C]∥2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR).New York:IEEE,2021:16514-16524.
[23] 周雪枫,芦晓辉,南晓强,等.融合MTF-ACGAN 样本增强与多尺度CNN MHSA的电力系统暂态稳定评估[J/OL].太原理工大学学报,2026-01-14.https:∥link.cnki.net/urlid/14.1220.n.20260114.1050.004.
[24] 刘悦,马馨秀,林皓琨.基于改进YOLOv8的架空线路危物辨识方法[J].电网与清洁能源,2025,41(10):112-118.[25] 齐俊艳,车玉浩,王磊,等.改进黏菌算法优化TCN-LSTM-MHSA 的巷道锚杆(索)应力预测模型[J].工矿自动化,2025,51(5):129-139.
[26] Zhang Yifan,Ren Weigiang,Zhang Zhang,et al.Focal and efficient IOU loss for accurate bounding box regression[ J].Neurocomputing,2022,506:146-157.
[27] Dai Jifeng,Li Yi,He Kaiming,et al.R-FCN:object detection via region-based fully convolutional networks[ C]∥NIPS’16:Proceedings of the 30th InternationalConference on Neural Information Processing Systems, 2016:379-387.

相似文献/References:

[1]王骁贤,张保华,陆思良.基于连续小波变换和卷积神经网络的无刷直流电机故障诊断[J].机械与电子,2018,(06):29.
 WANG Xiaoxian,ZHANG Baohua,LU Siliang.Fault Diagnosis of Brushless Direct Current Motor Based on Continuous Wavelet Transform and Convolutional Neural Network[J].Machinery & Electronics,2018,(06):29.
[2]刘志宇,黄亦翔.基于深度学习和迁移学习的液压泵健康评估方法[J].机械与电子,2018,(09):67.
 LIU Zhiyu,HUANG Yixiang.Health Assessment for Hydraulic Pump Based on Deep Learning and Transfer Learning[J].Machinery & Electronics,2018,(06):67.
[3]肖倩宏,康 鹏,杜 江,等.深度学习在电网智能调控系统中应用研究[J].机械与电子,2021,(01):38.
 XIAO Qianhong,KANG Peng,DU Jiang,et al.Research on the Application of Deep Learning Theory in Power Grid Intelligent Dispatching[J].Machinery & Electronics,2021,(06):38.
[4]许 哲,张少帅,郭 璐,等.无人机深度学习去雾算法[J].机械与电子,2021,(04):13.
 XU Zhe,ZHANG Shaoshuai,GUO Lu,et al. Deep Learning Defogging Algorithm for UAV[J].Machinery & Electronics,2021,(06):13.
[5]齐爱玲1,李 琳1,朱亦轩2,等.基于融合特征的双通道CNN滚动轴承故障识别[J].机械与电子,2021,(05):15.
 QI Ailing,LI Lin,ZHU Yixuan,et al.Dual Channel CNN Bearing Fault Identification Based on Fusion Feature[J].Machinery & Electronics,2021,(06):15.
[6]徐先峰,郑少杰,赵 依,等.基于数据分解与重构的光伏发电功率超短期预测[J].机械与电子,2022,(04):20.
 XU Xianfeng,ZHENG Shaojie,ZHAO Yi,et al.Ultra-short-term Prediction of Photovoltaic Power Generation Based on Data Decomposition and Deconstruction[J].Machinery & Electronics,2022,(06):20.
[7]江 励,熊达明,汤健华,等.自然光线环境中的空间物体快速识别和定位算法研究[J].机械与电子,2022,(06):8.
 JIANG Li,XIONG Daming,TANG Jianhua,et al.Recognition and Positioning Algorithm of Space Objects in Natural Light Environment[J].Machinery & Electronics,2022,(06):8.
[8]王西志,管声启,张理博,等.基于视觉引导的工业棒材上料系统研究[J].机械与电子,2023,41(05):19.
 WANG Xizhi,GUAN Shengqi,ZHANG Libo,et al.Research on Industrial Bar Feeding System Based on Visual Guidance[J].Machinery & Electronics,2023,41(06):19.
[9]王 青,吕绪山,党 帅,等.基于深度学习的纱管识别方法研究[J].机械与电子,2023,41(12):20.
 WANG Qing,LYU Xushan,DANG Shuai,et al.Research on Yarn Bobbin Detection Method Based on Deep Learning[J].Machinery & Electronics,2023,41(06):20.
[10]姜越夫,王 青,吕绪山.改进 YOLOv5s 的纱管目标检测方法[J].机械与电子,2024,42(02):29.
 JIANG Yuefu,WANG Qing,LYU Xushan.Improved YOLOv5s Method for Yarn Tube Object Detection[J].Machinery & Electronics,2024,42(06):29.

备注/Memo

备注/Memo:
收稿日期:2026-02-28
基金项目:重庆市教委科学技术研究项目(KJZD-K202405702)
作者简介:原子昊 (1999-),男,河南焦作人,硕士,研究方向为计算机视觉、深度学习目标检测。
更新日期/Last Update: 2026-08-27