基金项目:国家重点研发计划(2017YFC1600804);江苏省自然科学基金(BK20180860)收稿日期:2021-06-08修回日期:2021-08-11第40卷第4期计算机仿真2023年4月文章编号:1006-9348(2023)04-0486-06基于RA-YOLOv5s的粮仓害虫检测模型杜聪,王赟,刘思雨,宋雪桦(江苏大学计算机科学与通信工程学院,江苏镇江212013)摘要:针对粮仓害虫体积较小且个别种类害虫外形相似而难以区分的问题,提出一种RA-YOLOv5s(ResNeXtandAttention-YOLOv5s)粮仓害虫检测模型。先在YOLOv5s的CSP模块支路中分别引入空间注意力机制和通道注意力机制。将主干网络CSP模块中的残差单元修改为ResNeXt残差单元,同时对模型进行轻量化处理,去除重复的残差单元。最后修改颈部网络CSP模块结构,使其与主干网络保持一致。实验结果表明,RA-YOLOv5s相较于其它主流目标检测模型具有更高的害虫检测平均正确率,而且模型更加轻量化。关键词:粮仓害虫;目标检测;注意力机制;分组卷积中图分类号:TP183文献标识码:BGranaryPestDetectionModelBasedonRA-YOLOv5sDUCong,WANGYun,LIUSi-yu,SONGXue-hua(SchoolofComputerScienceandCommunicationEngineering,JiangsuUniversity,ZhenjiangJiangsu212013,China)ABSTRACT:Sincemostgranarypestsaresmallanddifficulttodistinguishindividualpestswithsimilarappearances,anRA-YOLOv5sgranarypestdetectionmodelisproposed.First,thespatialattentionmechanismandchannelattentionmechanismwereintroducedrespectivelyintodifferentbranchesoftheCSPmoduleofYOLOv5s.Second,theresidualunitoftheCSPmoduleinthebackbonenetworkwasimprovedtotheResNeXtresidualunit.Inaddition,themodelstructurewaslightweightedtoremovetherepeatedresidualunitsintheCSPmodule.Finally,theCSPmodulestructureofthenecknetworkwasmodifiedtokeepitconsistentwiththebackbonenetwork.Theexperi-mentalresultsshowthatcomparedwithothermainstreamtargetdetectionmodels,RA-YOLOv5shasahigheraverageaccuracyrateofpestdetection,andthemodelismorelightweight.KEYWORDS:Granarypest;Objectdetection;Attentionmechanism;Groupedconvolution1引言在中国,粮食作为国家重要资源之一,对国家的发展具有重大意义。粮食储备是国家每年的重要任务,关乎人民的生计。粮食在储备过程中,虫害的发生是导致粮食经济损失的主要原因之一。大多数粮仓害虫较小,害虫的尺寸低于拍摄图像尺寸的10%,属于小目标...