中国农业科学 ›› 2021, Vol. 54 ›› Issue (21): 4562-4572.doi: 10.3864/j.issn.0578-1752.2021.21.007

• 耕作栽培·生理生化·农业信息技术 • 上一篇    下一篇

基于双线性注意力网络的农业灯诱害虫细粒度图像识别研究

姚青1(),姚波1,吕军1,唐健2,*(),冯晋3,朱旭华3   

  1. 1浙江理工大学信息学院,杭州 310018
    2中国水稻研究所稻作技术研究与发展中心,杭州 311401
    3浙江省托普云农科技股份有限公司,杭州 310015
  • 收稿日期:2020-12-21 接受日期:2021-03-03 出版日期:2021-11-01 发布日期:2021-11-09
  • 联系方式: 联系方式:姚青,E-mail: q-yao@126.com。
  • 基金资助:
    国家“863”计划(2013AA102402);浙江省公益性项目(LGN18C140007);浙江省自然科学基金(LY20C140008)

Research on Fine-Grained Image Recognition of Agricultural Light- Trap Pests Based on Bilinear Attention Network

YAO Qing1(),YAO Bo1,LÜ Jun1,TANG Jian2,*(),FENG Jin3,ZHU XuHua3   

  1. 1School of Information Science and Technology, Zhejiang Sci-Tech University, Hangzhou 310018
    2Rice Technology Research and Development Center, China National Rice Research Institute, Hangzhou 311401
    3Zhejiang Top Cloud-Agri Technology Co., Ltd., Hangzhou 310015
  • Received:2020-12-21 Accepted:2021-03-03 Published:2021-11-01 Online:2021-11-09

摘要:

【目的】智能虫情测报灯诱捕到的农业害虫因种类繁多、虫体姿态多样、鳞片脱落等原因造成有些害虫图像存在种间相似和种内差异的现象。为了提高农业灯诱害虫识别率,针对YOLOv4检测模型检测到且容易混淆的19种灯诱害虫,本文提出了基于双线性注意力网络的农业灯诱害虫细粒度图像识别模型。【方法】首先,根据灯诱害虫外观图像的相似性和检测误检的情况,将19种害虫分为6类;将所有害虫图像通过补边操作使得长宽相等,并缩放至统一尺寸224×224像素。为了提高模型的鲁棒性和泛化能力,对害虫图像进行镜像翻转、旋转180度、高斯噪声和均值滤波的数据增强,训练集、验证集和测试集样本量按照8:1:1比例划分。然后,针对6类19种农业灯诱害虫细粒度图像,建立了基于双线性注意力网络的农业灯诱害虫识别模型(bilinear-attention pest net,BAPest-net),模型包括双线性特征提取、注意力机制和分类识别3个模块;通过修改特征提取模块的下采样方式提高特征提取能力;添加注意力机制模块让整个模型更关注于局部细节的特征,将双线性结构中的上下两个注意力机制的输出进行外积运算增加细粒度特征的权重,提高识别的准确性和学习效率;模型优化器使用随机梯度下降法SGD,分类模块中使用全局平均池化,旨在对整个网络从结构上做正则化防止过拟合。最后,在同一个训练集训练VGG19、Densenet、ResNet50、BCNN和BAPest-net 5个模型,对6类相似的19种农业灯诱害虫进行识别,以精准率、Precision-Recall(PR)曲线和平均识别率作为模型的评价指标。【结果】BAPest-net对6类相似的19种农业灯诱害虫平均识别率最高,达到94.9%;BCNN次之,为90.2%;VGG19模型最低,为82.1%。BAPest-net识别的6类害虫中4类鳞翅目害虫的平均识别率均大于95%,表明该模型能较好地识别出鳞翅目害虫。测试结果中仍存在少数相似度较高的害虫误判,特别当害虫腹部朝上或侧身,种类特征不够明显的时候容易引起相似害虫的误判。对于区分度较低的相似害虫需要更多的训练样本以获取更多的特征,提高模型的识别率和泛化能力。【结论】基于双线性注意力网络的农业灯诱害虫细粒度图像识别模型可以自动识别6类相似的19种农业灯诱害虫,提高了农业灯诱害虫自动识别的准确率。

关键词: 农业灯诱害虫, 害虫识别, 细粒度图像, 双线性, 注意力机制

Abstract:

【Objective】Some agricultural pests trapped by the intelligent light traps show the intraspecies difference and interspecies similarity due to a variety of pest species, different pest poses and scale missing. To improve the identification rate of agricultural light-trap pests, a fine-grained image identification model of agricultural light-trap pests based on bilinear attention network (BAPest-net) was proposed to identify 19 pest species which were easily misjudged by YOLOv4 model.【Method】Firstly, according to the appearance similarity and false detection results, 19 light-trap pest species were divided into 6 similar classes. All the pest images were processed to be equal in length and width through the edge-filling operation. Then, they were scaled to a uniform size of 224×224 pixels. In order to improve the robustness and generalization ability of model, the pest images were enhanced by mirror and flipping, rotation by 180 degrees, Gaussian noise, and mean filtering. The proportions of training set, validation set, and test set in samples are 80%, 10% and 10% respectively. An agricultural light-trap pest identification model based on bilinear attention network (bilinear-attention pest net, BAPest-net) was developed to identify 19 pest species belong to 6 similar pest classes. The BAPest-net model consisted of three modules, which were a feature extraction module, an attention mechanism module and an identification module. The down-sampling step in the feature extraction module was post-handled to extract more features. The attention mechanism model could make the model focus on the local features, which could increase the identification rate and learning efficiency. The model optimizer used the stochastic gradient descent method, and the global average pooling was used in the classification module to avoid overfitting from the structure of the entire network. Finally, the five models, including VGG19, Densenet, ResNet50, bilinear model and BAPest-net, were training on the same training set and were used to test 19 light-trap pests in the 6 similar pest classes. Precision, Precision-Recall curve and average identification rate were used to evaluate the identification effects of different models on similar light-trap pests.【Result】 In five models, the BAPest-net model had the highest average identification rate of 94.9% on 19 light-trap pests in 6 similar pest classes. The bilinear model gained the second high identification rate of 90.2% and the VGG19 model had only the lowest identification rate of 82.1%. The average identification rates of Lepidoptera pests in four pest categories were greater than 95.0%. 【Conclusion】The fine-grained image identification model of agricultural light-trap pests based on bilinear attention network could automatically identify 19 agricultural light-trap pests in 6 similar pest classes and improve the automatic identification accuracy of agricultural light-trap pests.

Key words: agricultural light-trap pest, pest identification, fine-grained image, bilinear, attention mechanism