2023年第5期仪表技术与传感器InstrumentTechniqueandSensor2023No.5基金项目:国家自然科学基金青年基金资助项目(62006073)收稿日期:2022-11-03基于改进YOLOv5的PCB板表面缺陷检测王淑青1,张子言1,朱文鑫1,刘逸凡2,王娟1,李青珏1(1.湖北工业大学电气与电子工程学院,湖北武汉430068;2.华中科技大学武汉光电国家研究中心,湖北武汉430074)摘要:针对当前PCB板检测参数量庞大、检测精度低等问题,提出了一种改进YOLOv5的检测模型。以YOLOv5模型为框架,采用EfficientNetV2结构替换原始模型的主干网络,针对小目标缺陷,引入对空间信息更敏感的CA注意力机制,并采用α-IoU损失函数提高模型回归精度。实验结果表明:改进后的YOLOv5网络模型较原始网络均值平均精度提高了2.6%,参数量减少47%,可应用在小型工业检测设备中。关键词:PCB板检测;YOLOv5;EfficientNetV2;缺陷检测;注意力机制;损失函数中图分类号:TP391文献标识码:A文章编号:1002-1841(2023)05-0106-06SurfaceDefectDetectionofPCBBasedonImprovedYOLOv5WANGShu-qing1,ZHANGZi-yan1,ZHUWen-xin1,LIUYi-fan2,WANGJuan1,LIQing-jue1(1.SchoolofElectricalandElectronicEngineering,HubeiUniversityofTechnology,Wuhan430068,China;2.WuhanOptoelectronicsNationalResearchCenter,HuazhongUniversityofScienceandTechnology,Wuhan430074,China)Abstract:InordertosolvetheproblemsoflargenumberofparametersandlowdetectionaccuracyofcurrentPCBdetection,adetectionmodelofimprovedYOLOv5wasproposed.TakingtheYOLOv5modelastheframework,themainnetworkoftheorigi-nalmodelwasreplacedbythestructureofEfficientNetV2.Aimingatthedefectsofsmalltargets,theCAattentionmechanismwhichismoresensitivetospatialinformationwasintroduced,andtheα-IOUlossfunctionwasusedtoimprovetheaccuracyofthemodelregression.Theexperimentalresultsshowthatcomparedwiththeoriginalnetwork,theimprovedYOLOv5networkmod-elimprovesthemeanaverageaccuracyby2.6%andreducesthenumberofparametersby47%,whichcanbeeasilydeployedinsmallindustrialtestingequipment.Keywords:PCBdetection;YOLOv5;EfficientNetV2;defectdetection;mechanismofattention;lossfunction0引言进入工业4.0时代以来,电子设备与我们的生活紧密相连,而精密的电子产品往往依赖于PCB板进行走...