基于改进YOLOv7的线束缺陷检测研究
Research on wire harness defect detection based on improved YOLOv7
袁海兵 1赵凤胜 1杨奕洋 1吴俊1
作者信息
- 1. 湖北汽车工业学院机械工程学院 十堰 442002
- 折叠
摘要
针对目前线束端子压接缺陷检测过程中存在检测效率低、误检率高等问题,提出一种基于改进YOLOv7的线束缺陷检测方法.为提高算法的检测精度,在YOLOv7主干网络中添加归一化注意力模块(NAM),加强对检测目标的定位和识别;在颈部构建多尺度的集中特征金字塔网络(CFP),以捕捉不同尺度下的目标信息,加深对图像深层特征的提取;使用SIoU Loss替换CIoU Loss优化训练模型,在加快模型收敛的同时提高预测框的回归精度.实验结果表明,改进后的YOLOv7网络模型准确率达95.8%,召回率达94.5%,均值平均精度达97.6%,与原模型相比分别提高了5.0%、4.8%和3.3%,模型大小90.5 MB,检测时间为48 ms,有效提高了模型的检测精度.最后,使用PyQt5开源框架设计了线束端子压接缺陷检测系统,实现了端子压接缺陷检测的自动化和可视化,提高了缺陷检测效率,可以满足生产企业的需求.
Abstract
Aiming at the problems of low detection efficiency and high false detection rate in the current process of crimping defects of wire harness terminals,a wire harness defect detection method based on improved YOLOv7 is proposed.To improve the detection accuracy of the algorithm,the NAM attention mechanism is added to the YOLOv7 backbone network to strengthen the localization and recognition of detection targets.A multi-scale concentrated feature pyramid(CFP)network was constructed at the neck to capture the target information at different scales and deepen the extraction of deep features of the image.Use SIoU Loss to replace CIoU Loss to optimize the training model,which improves the regression accuracy of the prediction box while accelerating the model convergence.The experimental results show that the improved YOLOv7 network model has an accuracy rate of 95.8%,a recall rate of 94.5%,and an average accuracy of 97.6%,which is 5.0%,4.8%and 3.3%higher than the original model,respectively,with a model size of 90.5 MB and a detection time of 48 ms,which effectively improves the detection accuracy of the model.Finally,the wire harness terminal crimping defect detection system is designed using the PyQt5 open-source framework,which realizes the automation and visualization of terminal crimping defect detection,improves the defect detection efficiency,and can meet the needs of production enterprises.
关键词
线束端子压接/缺陷检测/YOLOv7/注意力机制/集中特征金字塔Key words
crimping of wiring harness terminals/defect detection/YOLOv7/attention mechanisms/centralized feature pyramid(CFP)引用本文复制引用
基金项目
教育部产学合作协同育人项目(201902016046)
教育部产学合作协同育人项目(201902118034)
湖北省科技厅企业创新发展项目(2021BAB018)
十堰市科学技术研究指导项目(16Y97)
出版年
2024