Research on Fine-Grained Image Recognition of Agricultural Light- Trap Pests Based on Bilinear Attention Network
YAO Qing,1, YAO Bo1, LÜ Jun1, TANG Jian,2,*, FENG Jin3, ZHU XuHua31School 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-21Accepted:2021-03-3 作者简介 About authors 联系方式:姚青,E-mail: q-yao@126.com。
摘要 【目的】智能虫情测报灯诱捕到的农业害虫因种类繁多、虫体姿态多样、鳞片脱落等原因造成有些害虫图像存在种间相似和种内差异的现象。为了提高农业灯诱害虫识别率,针对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. Keywords:agricultural light-trap pest;pest identification;fine-grained image;bilinear;attention mechanism
PDF (4143KB)元数据多维度评价相关文章导出EndNote|Ris|Bibtex收藏本文 本文引用格式 姚青, 姚波, 吕军, 唐健, 冯晋, 朱旭华. 基于双线性注意力网络的农业灯诱害虫细粒度图像识别研究. 中国农业科学, 2021, 54(21): 4562-4572 doi:10.3864/j.issn.0578-1752.2021.21.007 YAO Qing, YAO Bo, LÜ Jun, TANG Jian, FENG Jin, ZHU XuHua. Research on Fine-Grained Image Recognition of Agricultural Light- Trap Pests Based on Bilinear Attention Network. Scientia Agricultura Sinica, 2021, 54(21): 4562-4572 doi:10.3864/j.issn.0578-1752.2021.21.007
开放科学(资源服务)标识码(OSID):
0 引言
【研究意义】对农业害虫进行科学、快速、准确的测报是提高农作物产量和减少经济损失的前提。目前,我国农业害虫田间测报的方法主要包括人工田间调查、性诱剂、虫情测报灯等[1,2,3]。其中,智能虫情测报灯[4]利用灯光引诱害虫、远红外杀虫和机器视觉系统自动识别与计数害虫,具有测报数据实时、准确、历史数据可追溯等优点,已在田间获得应用。由于灯诱害虫种类繁多,虫体姿态多样,红外高温杀虫造成害虫鳞片脱离,图像中有些害虫存在种间差异小和种内差异大的现象,准确识别这些害虫具有较大的挑战性。为了提高灯诱害虫识别的准确率,需对相似灯诱害虫图像识别进行深入研究。【前人研究进展】害虫图像识别方法主要包括传统的模式识别方法和深度学习方法。传统的模式识别模型[5,6,7,8]存在鲁棒性不高,泛化能力差,无法在田间获得较好的应用与推广。近些年,随着深度学习在多个领域的图像分类任务中表现出色,许多****开始利用深度学习研究农业害虫的识别,取得了较好的识别结果[4,9-21]。针对灯诱害虫图像,LIU等[20]提出了一种基于区域的端到端害虫检测分类模型对水稻害虫进行检测,对16类较大体型害虫识别的平均精度为75.46%。YAO等[4]为了从灯诱害虫图像中识别微小害虫,先对目标害虫区域进行分割,再利用残差神经网络对水稻上3种螟虫和2种稻飞虱进行识别,平均识别率超过85%。【本研究切入点】将相似的农业灯诱害虫识别归为细粒度图像识别。针对细粒度图像,LIN等[22]提出的双线性网络(bilinear convolutional neural network,BCNN),通过两个独立的卷积神经网络得到的特征图模拟图像的位置和外观两个变量,将图像中同一个位置上的两个特征进行外积相乘,得到特征矩阵,经最大池化下采样、向量化得到双线性向量,最后对归一化后的特征矩阵进行分类和预测;结果表明BCNN对高度定位的局部特征具有强大的激活功能,在CUB200-2011鸟类数据集细粒度图像获得了弱监督细粒度分类模型的最高分类准确率。在此基础上,BCNN的改进与变型在多种细粒度图像识别研究中取得较好的识别效果,如鸟类[23]、鱼类[24]、车型[25]、果蝇[26]等。本文在BCNN模型的基础上进行改进,研究相似农业灯诱害虫细粒度图像识别。【拟解决的关键问题】本研究对6类相似的19种农业灯诱害虫,建立基于双线性和注意力机制的农业灯诱害虫细粒度图像识别网络(bilinear- attention pest net,BAPest-net)模型,提高农业灯诱害虫识别的准确率。
为了提高灯诱害虫细粒度图像识别精度,本文在LIN等[22]的BCNN基础上,添加注意力机制模块,建立基于双线性注意力网络的农业灯诱害虫识别模型(bilinear-attention pest net,BAPest-net),网络结构如图4所示。BAPest-net由双线性结构的特征提取层、注意力机制模块、全局平均池化和输出端的分类层组成。
LIN PJ, ZHANGZ, WANG XL, LIU DX, HUG, ZHANG YH. Population dynamic and trajectory simulation of migratory moths of fall armyworm Spodoptera frugiperda in Yangqing of Beijing in 2019 Journal of Plant Protection, 2020, 47(4):758-769. (in Chinese) [本文引用: 1]
WANG XH, JIAO YX, WANG SN, SUN YT, WANG HM, KONG DS. Application of Xiangchen intelligent pest situation forecasting lamp in field pest monitoring and forecasting Grassroots Agricultural Technology Extension, 2020, 8(8):43-45. (in Chinese) [本文引用: 1]
YAOQ, FENGJ, TANGJ, XU WG, ZHU XH, YANG BJ, LVJ, XIE YZ, YAOB, WU SZ, KUAI NY, WANG LJ. Development of an automatic monitoring system for rice light-trap pests based on machine vision , 2020, 19(10):2500-2513. DOI:10.1016/S2095-3119(20)63168-9URL [本文引用: 3]
EBRAHIMI MA, KHOSHTAGHAZA MH, MINAEIS, JAMSHIDIB. Vision-based pest detection based on SVM classification method , 2017, 137:52-58. DOI:10.1016/j.compag.2017.03.016URL [本文引用: 1]
XIAO DQ, FENG JZ, LIN TY, PANG CH, YE YW. Classification and recognition scheme for vegetable pests based on the BOF-SVM model , 2018, 11(3):190-196. [本文引用: 1]
DENG LM, WANG YJ, HAN ZZ, YU RS. Research on insect pest image detection and recognition based on bio-inspired methods , 2018, 169:139-148. DOI:10.1016/j.biosystemseng.2018.02.008URL [本文引用: 1]
ZHAOJ, CHENG XP. Field pest identification by an improved Gabor texture segmentation scheme , 2007, 50(5):719-723. DOI:10.1080/00288230709510343URL [本文引用: 1]
SHEH, WUL, SHAN LQ. Improved rice pest recognition based on SSD network model Journal of Zhengzhou University (Natural Science Edition), 2020, 52(3):49-54. (in Chinese) [本文引用: 1]
QIANR, KONG JJ, ZHU JB, ZHANGM, DONGW. Research on intelligent identification of rice pests based on VGG-16 convolutional neural network Journal of Anhui Agricultural Sciences, 2020, 48(5):235-238. (in Chinese)
LIANG WJ, CAO HX. Rice pest identification based on convolutional neural network Jiangsu Agricultural Sciences, 2017, 45(20):241-243, 253. (in Chinese)
ALFARISY AA, CHENQ, GUOM. Deep learning based classificationfor paddy pests & diseases recognition. Proceedings of 2018 International Conference on Mathematics and Artificial Intelligence , 2018: 21-25.
SHAO ZZ, YAOQ, TANGJ, LI HQ, YANG BJ, LÜJ, CHENY. Research and development of the intelligent identification system of agricultural pests for mobile terminals Scientia Agricultura Sinica, 2020, 53(16):3257-3268. (in Chinese)
YAOQ, WU SZ, KUAI NY, YANG BJ, TANGJ, FENGJ, ZHU XH, ZHUXM. Construction and verification of automatic detection method for rice planthoppers on light-trap insect images based on improved ConerNet Transactions of the Chinese Society of Agricultural Engineering, 2021, 37(7):183-189.
CHENGX, ZHANG YH, CHEN YQ, WU YZ, YUEY. Pest identification via deep residual learning in complex background , 2017, 141:351-356. DOI:10.1016/j.compag.2017.08.005URL
SUNY, LIU XX, YUAN MS, REN LL, WANG JX, CHEN ZB. Automatic in-trap pest detection using deep learning for pheromone- based dendroctonus valens monitoring , 2018, 176:140-150. DOI:10.1016/j.biosystemseng.2018.10.012URL
SHEN YF, ZHOU HL, LI JT, JIAN FJ, JAYAS DS. Detection of stored-grain insects using deep learning , 2018, 145:319-325. DOI:10.1016/j.compag.2017.11.039URL
NAQVI S DY, HAILEA, RAOS, TEWElDEMEDHINB, SHARMAV, NYENDE AB. Evaluation of husbandry, insect pests, diseases and management practices of vegetables cultivated in Zoba Anseba, Eritrea , 2017, 12(1):47-50.
FERENTINOS KP. Deep learning models for plant disease detection and diagnosis , 2018, 145:311-318. DOI:10.1016/j.compag.2018.01.009URL
LIUL, WANGR, XIEC, YANGP, WANGF, SUDIRMANS, LIUW. PestNet: An end-to-end deep learning approach for large-scale multi-class pest detection and classification , 2019, 7:45301-45312. DOI:10.1109/Access.6287639URL [本文引用: 2]
KONG JL, JIN XB, TAOZ, WANG XY, LINS. Fine-grained recognition of pests and diseases based on multi-stream Gaussian probability fusion network Transactions of the Chinese Society of Agricultural Engineering, 2020, 36(13):148-157. (in Chinese) [本文引用: 1]
LIN TY, ROYCHOWDHURYA, MAJIS. Bilinear cnn models for fine-grained visual recognition. Proceedings of the IEEE International Conference on Computer Vision , 2015: 1449-1457. [本文引用: 3]
LANJ, ZHOUX, HE XH, TENG QZ, QING LB. Fine-grained bird recognition based on cross-layer compact bilinear network Science Technology and Engineering, 2019, 19(36):240-246. (in Chinese) [本文引用: 1]
JIZ, ZHAO KX, ZHANG SP, LI MB. Fine-grained fish image classification based on a bilinear network with spatial transformation Journal of Tianjin University: Natural Science and Engineering Technology Edition, 2019, 52(5):475-482. (in Chinese) [本文引用: 1]
LIUH, ZHOUY, YUAN JB. Fine-grained vehicle recognition under multiple angles based on multi-scale bilinear convolutional neural network Journal of Computer Applications, 2019, 39(8):2402-2407. (in Chinese) [本文引用: 1]
KRIZHEVSKYA, SUTSKEVERI, HINTON GE. Imagenet classification with deep convolutional neural networks , 2012, 25:1097-1105. [本文引用: 1]
ZHUQ, ZHENG HF, WANG YB, CAO YG, GUO SX. Study on the evaluation method of sound phase cloud maps based on an improved YOLOv4 algorithm , 2020, 20(15):4313-4330. DOI:10.3390/s20154313URL [本文引用: 1]
HOUJ, SU HY, YANB, ZAHNGH, SUNZ, CAIX. Classification of tongue color based on CNN. IEEE 2nd International Conference on Big Data Analysis , 2017: 725-729. [本文引用: 1]
SZEGEDYC, LIUW, JIAY, SERMANETP, REEDS, ANGUELOVD, ERHAND, VANHOUCKEV, RABINOVICHA. Going deeper with convolutions. Proceeding of the IEEE Conference on Computer Vision and Pattern Recognition , 2015: 1-9. [本文引用: 1]
HE KM, ZHANGX, REN SQ, SUNJ. Deep residual learning for image recognition. Proceeding of the IEEE Conference on Computer Vision and Pattern Recognition , 2016: 770-778. [本文引用: 2]
MMIHV, HEESSN, GRAVESA. Recurrent models of visual attention. Advances in Neural Information Processing Systems , 2014: 2204-2212. [本文引用: 1]
SRIVASTAVAN, HINTONG, KRIZHEVSKYA, SUTSKEVERI, SALAKHUTDINOVR. Dropout: A simple way to prevent neural networks from overfitting , 2014, 15(1):1929-1958. [本文引用: 1]