1.School of Computing Science,Wuhu University,Wuhu 241000,China
2.School of Electronic & Information Technology,Wuhu University,Wuhu 241000,China
3.School of Computer and Information,Anhui Normal University,Wuhu 241000,China
Show less
文章历史+
Received
Accepted
Published
2025-02-18
Issue Date
2026-05-13
PDF (3485K)
摘要
为提高林业害虫识别精度,提出改进YOLOv7的林业害虫检测模型(GhostConv and SE attention enhanced YOLOv7,GS-YOLOv7)。首先,该模型将主干网络的传统卷积改用GhostConv轻量卷积,减小模型运行的参数量,提高模型效率;其次,通过添加挤压激励(squeeze excitation,SE)注意力模块,强化对特征不显著的害虫图像边缘的提取能力,进而提高网络的特征提取能力;再次,用内容感知的特征重组(content aware reassembly of features,CARAFE)轻量级算子取代传统采样方法,提高特征重建质量,解决尺度不匹配问题,增强检测性能;最后,在 Neck 网络引入协调坐标卷积(coordinate convolution,CoordConv)模块,利用其位置信息解决目标定位不准问题,提高模型对空间位置的感受能力和泛化能力。在6种常见的病虫数据集上进行试验,GS-YOLOv7模型的精确率达到93.15%,交并比阈值为0.5时的平均精度均值达到93.29%,比原模型的精确率、平均精度均值分别提高6.50%和2.09%;参数量和模型大小分别降至1.9×107个和38.17 MB,比原模型分别降低51.4%和46.53%。结果表明,GS-YOLOv7模型较原模型性能有显著提升,模型改进有效。
Abstract
In order to improve the accuracy of forest pest identification, a forest pest detection model (GhostConv and SE attention enhanced YOLOv7, GS-YOLOv7) based on the improved YOLOv7 is proposed. Firstly, the model replaced the traditional convolution in the backbone network with GhostConv lightweight convolution to reduce the number of parameters in model operation and improve the model efficiency. Secondly, by adding the squeeze excitation (SE) attention module, the ability to extract the edges of pest images with insignificant features was enhanced, thereby further improving the feature extraction ability of the network. Thirdly, the content aware reassembly of features (CARAFE) lightweight operator was used to replace the traditional upsampling method to improve the quality of feature reconstruction, solve the scale mismatch problem, and enhance the detection performance. Finally, the coordinate convolution (CoordConv) module was introduced into the Neck network, and its position information was utilized to solve the problem of inaccurate target positioning and improve the model's sensitivity to spatial positions and its generalization ability. Experiments were conducted on six common pest and disease datasets, the precision of the GS-YOLOv7 model reached 93.15%, and the mean average precision at an intersection over union threshold of 0.5 reached 93.29%. Compared with the original model, the precision and mean average precision increased by 6.50% and 2.09%, respectively. The number of parameters and the model size decreased to 1.9×107 units and 38.17 MB, representing a reduction of 51.4% and 46.53%, respectively, compared to the original model. Results indicate that the GS-YOLOv7 model demonstrates significant performance improvements over the original model, confirming the effectiveness of the model modifications.
中国林业遭受生物胁迫的有害生物种类有8 000多种,经常造成危害的有200多种[1]。林业害虫会降低木材质量,抑制林木的自然生长与更新,从而造成林业资源大量损失,对生态环境造成严重影响[2]。及时、准确地识别林业害虫,制定合理的防治方案并采取相应的防治措施,对降低害虫造成的林业经济损失、保护生态环境具有重要意义。害虫检测主要包含人工检测、传统的机器学习算法检测和深度学习算法检测。人工检测是通过人工捕捉昆虫进行识别和计数,但该方法实时性差、效率低;传统的机器学习算法主要是通过支持向量机、随机森林等模型对人工提取的害虫图像特征进行分类,从而实现害虫检测识别,但该方法鲁棒性和泛化能力差。深度学习算法检测是将快速区域卷积神经网络(faster region-based convolutional neural networks,Faster R-CNN)、单次多框检测器(single shot multibox detector,SSD)和YOLO(you only look once)等深度学习算法广泛地应用到林业害虫的检测识别。徐信罗等[3]提出了基于Faster R-CNN的松材线虫病的检测识别,有效确定了受害木的位置,但检测精度不高。林文树等[4]提出一种改进YOLOv4模型的受灾树木实时检测方法,提高树木落叶松毛虫虫害的识别精度与检测速度,但存在漏检的情况。戴佳兵等[5]提出了一种YOLOv5s-SE(you only look once v5s-squeeze-and-excitation)和通道剪枝的虫咬紫金蝉茶检测方法,该方法检测速度较快,但检测精度较低。周宏威等[6]提出了一种改进的YOLOv8检测梢斑螟虫蛀树木,但平均检测精度仍需要提高。苏佳杰等[7]提出了深度双线性转换注意力机制网络,实现了林业有害生物的识别,但准确率有待提高。综上所述,现有的林业害虫检测存在检测精度不高、识别速度慢等问题。
为提高林业害虫识别的精度和效率,本研究提出改进YOLOv7的林业害虫检测模型(GhostConv and SE attention enhanced YOLOv7,GS-YOLOv7)。该模型在主干网络中引入GhostConv轻量卷积代替传统卷积减小模型参数量,引入挤压激励(squeeze excitation,SE)注意力机制提高特征提取能力;在Neck网络中,引入CoordConv卷积模块提高模型的空间位置感知能力和泛化能力,采用内容感知的特征重组(content aware reassembly of features,CARAFE)轻量级算子提高模型检测能力。该模型通过结合轻量化网络、特征重组等方法在降低模型参数量的同时,提高检测识别精度。
SE 注意力机制的基本思想是不同通道的权重应该自适应分配,由网络自己学习出来。将向量输入到2个全连接层中,以学习每个通道的权重。第1个全连接层被称为“压缩层”,将平均值向量压缩为更小的尺寸,以减少计算开销。第2个全连接层被称为“激活层”,使用Sigmoid函数或ReLU函数等激活函数来学习每个通道的权重。压缩层表达式为
ZHENGJ Q, XUY L, ZHANGH C,et al.Advances and prospects of target recognition techniques for forest pest control at home and abroad[J].Scientia Silvae Sinicae,2023,59(3):152-166.
MENGG, LIUY F, ZHANGX F,et al.Sequential variation analysis of forest pest disasters in China from 1998 to 2018[J].Scientia Silvae Sinicae,2022,58(7):134-143.
XUX L, TAOH, LIC J,et al.Detection and location of pine wilt disease induced dead pine trees based on faster R-CNN[J].Transactions of the Chinese Society for Agricultural Machinery,2020,51(7):228-236.
LINW S, ZHANGJ S, HEN L.Real-time detection method of dendrolimus superans-infested Larix gmelinii trees based on improved YOLO v4[J].Transactions of the Chinese Society for Agricultural Machinery,2023,54(4):304-312,393.
DAIJ B, SONGC F, LINGC J,et al.Research on insect-bitten Zijin tea detection method based on YOLOv5s-SE and channel pruning[J].Journal of Henan Agricultural Sciences,2024,53(5):157-163.
SUJ J, ZHANGZ Y, XUJ J,et al.Forest pest identification method based on a deep bilinear transformation attention mechanism network[J].Scientia Silvae Sinicae,2023,59(2):121-128.
[15]
WANGC Y, BOCHKOVSKIYA, LIAOH Y M.YOLOv7:Trainable bag-of-freebies sets new state-of- the-art for real-time object detectors[C]//2023 IEEE/CVF Conference on Computer Vision And Pattern Recognition (CVPR),Vancouver,BC,Canada,August 22,2023.IEEE,2023:1063-6919.
[16]
ZHAOL L, ZHUM L.MS-YOLOv7:YOLOv7 based on multi-scale for object detection on UAV aerial photography[J].Drones,2023,7(3):188.
[17]
ZHANGX Y, ZHOUX Y, LINM X,et al.ShuffleNet:An extremely efficient convolutional neural network for mobile devices[C]//2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition,Salt Lake City,UT,USA,June 18-23,2018.IEEE,2018:6848- 6856.
[18]
HOWARDA G, ZHUM L, CHENB,et al.MobileNets:Efficient convolutional neural networks for mobile vision applications[EB/OL].arXiv.1704.04861v1[cs.CV](2017-04-17)[2024-10-08].
[19]
HUJ, SHENL, SUNG,et al.Squeeze-and-excitation networks[J].IEEE Transactions on Pattern Analysis and Machine Intelligence,2020,42(8):2011-2023.
[20]
WANGJ Q, CHENK, XUR,et al.CARAFE:Content-aware reassembly of features[C]// 2019 IEEE/CVF International Conference on Computer Vision (ICCV),Seoul,Korea (South),October 27 - November 02,2019.IEEE,2019:3007-3016.
[21]
LIUR, LEHMANJ, MOLINOP,et al.An intriguing failing of convolutional neural networks and the coordconv solution[EB/OL].arXiv.1807.03247v2[cs.CV](2018-12-03) [2024-11-05].
[22]
WANGQ L, WUB G, ZHUP F,et al.ECA-Net:Efficient channel attention for deep convolutional neural networks[C]//2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR),Seattle,WA,USA,June 13-19,2020.IEEE,2020:11531-11539.
[23]
WOO S, PARKJ, LEEJ Y,et al.CBAM:Convolutional block attention module[C]// Proceedings of 15th European Conference on Computer Vision (ECCV),2018:3-19.
[24]
KAURA,RAJ A, JAYANTHIN,et al.Inpainting of irregular holes in a manuscript using UNet and partial convolution[C]//2020 Second International Conference on Inventive Research in Computing Applications (ICIRCA),Coimbatore,India,July 15-17,2020.IEEE,2020:778-784.
[25]
QIY, HEY, QIX,et al.Dynamic snake convolution based on topological geometric constraints for tubular structure segmentation[C]// 2023 IEEE/CVF International Conference on Computer Vision (ICCV),Paris,France,October 01-06,2023.IEEE,2023:6047-6056.
[26]
WANGC Y, YEHI H, LIAOH Y M.YOLOv9:Learning what you want to learn using programmable gradient information[EB/OL].arXiv.2402.13616v2[cs.CV](2024-02- 29) [2024-11-05].
LIUS X, LIUS T, QUH X,et al.Multi-scale rice planthopper image recognition and classification based on lightweight MS-YOLO v7[J].Transactions of the Chinese Society for Agricultural Machinery,2023,54(1):212-221.