ISSN1006-7167CN31-1707/TRESEARCHANDEXPLORATIONINLABORATORY第42卷第2期Vol.42No.22023年2月Feb.2023DOI:10.19927/j.cnki.syyt.2023.02.023基于LT-YOLOv5s的PCB缺陷检测方法张开生,李昊晨,关凯凯,彭朋(陕西科技大学电气与控制工程学院,西安710021)摘要:针对传统PCB缺陷检测算法检测准确度低、实时性差等问题,提出一种改进的YOLOv5s网络PCB缺陷检测方法。针对缺陷特性,去除大目标的检测尺度,保留中小目标检测尺度;在网络模型末端用Transformer替代BottleneckCSP模块,提升了网络模型捕获目标特征的能力;结合坐标注意力模块,提升模型的性能并减少参数。以某PCB数据集为测试对象,结果表明,改进后的算法平均精度均值(mAP)达到99.04%,平均检测速度为19ms/帧,改进后的算法能够更加快速有效的检测出PCB缺陷。关键词:缺陷检测;YOLOv5s算法;Transformer模块;检测尺度;坐标注意力机制中图分类号:TP391文献标志码:A文章编号:1006-7167(2023)02-0108-07PCBDefectDetectionMethodBasedonLT-YOLOv5sZHANGKaisheng,LIHaochen,GUANKaikai,PENGPeng(SchoolofElectricalandControlEngineering,ShaanxiUniversityofScienceandTechnology,Xi’an710021,China)Abstract:Aimingattheproblemsoflowdetectionaccuracyandpoorreal-timeperformanceoftraditionalPCBdefectdetectionalgorithms,animprovedPCBdefectdetectionmethodbasedonYOLOv5snetworkisproposed.Firstly,forthedefectcharacteristics,thedetectionscaleoflargetargetsisremoved,andthedetectionscaleofsmallandmediumtargetsisretained.Secondly,theTransformermoduleisusedtoreplacetheBottleneckCSPmoduleattheendofthenetworkmodel,whichimprovestheabilityofthenetworkmodeltocapturetargetfeatures.Finally,combinedwiththecoordinateattentionmodule,modelperformanceisimprovedandparametersarereduced.TakingthePCBdatasetreleasedbyPekingUniversityasthetestobject,theresultsshowthatthemeanaverageprecision(mAP)oftheimprovedalgorithmreaches99.04%,andtheaveragedetectionspeedis19ms/frame.TheimprovedalgorithmcandetectPCBdefectsmorequicklyandeffectively.Keywords:defectdetection;YOLOv5salgorithm;Transformermodule;detectionscale;coordinateattentionmechanism收稿日期:2022-04-08基金项目:陕西省自然科学基础研究计划...