首页|基于YOLOv5-TGs的PCB缺陷检测算法研究

基于YOLOv5-TGs的PCB缺陷检测算法研究

扫码查看
针对目前PCB缺陷检测算法在实际应用中检测精度低等问题,提出基于改进YOLOv5s的PCB缺陷检测算法YOLOv5-TGs.该算法以YOLOv5s算法模型为基础,首先在主干网络中引入Swin Transformer结构,并取代C3 模块中的Bottleneck模块,并使用Ghost卷积模块替换Conv模块,降低了模型的计算复杂度,实现轻量化,同时增加了其接收域,增强PCB缺陷的小目标的特征表达能力;其次,在颈部网络的C3 结构后面添加全局注意力机制,更大程度地保留通道和空间信息,在减少特征信息弥散的情况下放大全局跨纬度的交互特征,提高检测效率.最后用SIoU损失函数来代替原有的CIoU损失函数,通过在损失函数代价中引入方向性,加快模型收敛速度,提高回归精度.本文实验使用的是北京大学实验室公开发布的PCB缺陷数据集,结果表明:改进算法的平均精度均值达到 98.2%,精确率达到 95.5%;相较于YOLOv5s,改进算法的平均精度均值提升了 7.3%,精确率提升了 7.5%.
Research on PCB defect detection algorithm based on YOLOv5-TGs
A PCB defect detection algorithm YOLOv5-TGs based on improved YOLOv5s is proposed to address the low detection accuracy of current PCB defect detection algorithms in practical applications.This algorithm is based on the YOLOv5s algorithm model.Firstly,the Swin Transformer structure is introduced into the backbone network,replacing the bottleneck module in the C3 module.The Ghost Conv module is used to replace the Conv module,reducing the computational complexity of the model and achieving lightweight.At the same time,the receiver domain is increased to enhance the feature expression ability of small targets with PCB defects.Secondly,a global attention mechanism is added after the C3 structure of the Neck network to preserve channel and spatial information to a greater extent,amplifying global cross latitude interactive features while reducing feature information dispersion and improving detection efficiency.Finally,the SIoU loss function is used to replace the original CIoU loss function.By introducing directionality into the cost of the loss function,the convergence speed of the model is accelerated and the regression accuracy is improved.The experiment in this article used a PCB defect dataset publicly released by the Peking University laboratory,and the results showed that the improved algorithm achieved an average accuracy mean(mAP)of 98.2% and an accuracy rate of 95.5% .Compared to YOLOv5s,mAP has improved by 7.3% and accuracy by 7.5% .

PCB defect detectionYOLOv5s algorithmGhost convSwin Transformer structureglobal attention mechanismSIoU loss

徐一奇、肖金球、谢翔

展开 >

苏州科技大学 电子与信息工程学院,江苏 苏州 215009

苏州市智能测控工程技术研究中心,江苏 苏州 215009

苏州科技大学 物理科学与技术学院,江苏 苏州 215009

PCB缺陷检测 YOLOv5s算法 Ghost卷积 Swin Transformer结构 全局注意力机制 SIoU损失

中国住房与城乡建设部项目江苏省住房和城乡建设厅项目

34111160134173164

2024

微电子学与计算机
中国航天科技集团公司第九研究院第七七一研究所

微电子学与计算机

CSTPCD
影响因子:0.431
ISSN:1000-7180
年,卷(期):2024.41(10)