首页|基于YOLOv7改进的PCB缺陷检测方法

基于YOLOv7改进的PCB缺陷检测方法

扫码查看
针对目前传统网络模型对PCB缺陷检测不准确、检测速度慢、识别精度低等问题,提出了一种基于YOLOv7改进的PCB缺陷检测方法.首先,该方法在原YOLOv7模型基础上采用FasterNet中的部分卷积PConv代替CatConv,从而减少内存访问和参数量,提高检测速度;其次,将双向特征金字塔网络(BiFPN)引入到YOLOv7模型的头部网络,实现PCB缺陷的多尺度特征融合,提升模型的检测精度,再次,将FasterNet模块与BiFPN融合,形成YOLOv7+FasterNet+BiFPN的PCB缺陷检测模型,增强模型对缺陷的特征表达能力;最后,将原有的CIoU改进为XIoU损失函数,不仅提高了模型的收敛速度和对小目标边界框的扰动抵抗能力,也准确地衡量了边界框预测的准确性和定位精度.实验结果表明:改进后的YO-LOv7模型在测试集上的mAP@0.5达到了95.7%,召回率为98.0%,相比于原YOLOv7模型mAP@0.5值和召回率分别提高了7、2个百分点,检测时间仅为21.7 ms,同时,FLOPs值与原模型相比计算量也减小了6.5 G.本文方法在检测速度、查全率和准确率等方面均优于传统网络,为PCB缺陷检测提供了有效的解决方案.
PCB Defect Detection Method Based on Improved YOLOv7
A PCB defect detection method based on an improved version of YOLOv7 has been proposed to address the issues of inaccurate detection,slow detection speed,and low recognition accuracy in traditional network models.Firstly,this method re-places CatConv with partial convolution PConv from FasterNet in the original YOLOv7 model to reduce memory access and pa-rameter quantity,thereby improving detection speed.Secondly,a bidirectional feature pyramid network(BiFPN)is introduced into the head network of the YOLOv7 model to achieve multi-scale feature fusion for PCB defect detection,enhancing the model's detection accuracy.The FasterNet module is then fused with BiFPN to form the YOLOv7+FasterNet+BiFPN model for PCB de-fect detection,enhancing the model′s capability to express defect features.Finally,the original CIoU loss function is improved to XIoU loss function,which not only improve the convergence speed of the model and its resistance to perturbations on small bounding boxes,but it also accurately measures the accuracy and localization precision of the bounding box predictions.The ex-perimental results show that the improved YOLOv7 model achieves an mAP@0.5 of 95.7%and a recall rate of 98.0%on the test set.Compared to the original YOLOv7 model,the mAP@0.5 value and recall rate have increased by 7 and 2 percentage points,respectively.The detection time is only 21.7 ms.Additionally,the computational complexity of FLOPs has also decreased by 6.5 G compared to the original model.The proposed method outperforms traditional network models in terms of detection speed,re-call rate,and accuracy,providing an effective solution for PCB defect detection.

FasterNetPCB defect detectionBiFPNmemory accessYOLOv7multi-scale feature fusion

张思敏、刘新妹、殷俊龄、李宝玲

展开 >

中北大学电子测试技术国家重点实验室,山西 太原 030051

FasterNet PCB缺陷检测 BiFPN 内存访问 YOLOv7 多尺度特征融合

2024

计算机与现代化
江西省计算机学会 江西省计算技术研究所

计算机与现代化

CSTPCD
影响因子:0.472
ISSN:1006-2475
年,卷(期):2024.(12)