欢迎您访问《智慧农业(中英文)》官方网站! English

Smart Agriculture ›› 2023, Vol. 5 ›› Issue (2): 45-55.doi: 10.12133/j.smartag.SA202305002

• 专题--机器视觉与农业智能感知 • 上一篇    下一篇

融合ECA机制与DenseNet201的水稻病虫害识别方法

潘晨露(), 张正华(), 桂文豪, 马家俊, 严晨曦, 张晓敏   

  1. 扬州大学 信息工程学院(人工智能学院),江苏 扬州 225127
  • 收稿日期:2023-05-07 出版日期:2023-06-30
  • 基金资助:
    2020年江苏省现代农业发展项目(2020-SJ-003-YD03);扬州大学学科特区学科交叉课题(yzuxk202008);2022年江苏省大学生创新训练计划项目重点项目(国家级)(202211117065Z)
  • 作者简介:潘晨露,研究方向为计算机视觉。E-mail:2300935324@qq.com
  • 通信作者: 张正华,教授,研究方向为智慧农业、实时信号处理。E-mail:zhangzh@yzu.edu.cn

Rice Disease and Pest Recognition Method Integrating ECA Mechanism and DenseNet201

PAN Chenlu(), ZHANG Zhenghua(), GUI Wenhao, MA Jiajun, YAN Chenxi, ZHANG Xiaomin   

  1. College of information engineering (College of Artificial Intelligence), Yangzhou University, Yangzhou 225127, China
  • Received:2023-05-07 Online:2023-06-30

摘要:

[目的/意义] 针对传统人工识别病虫害存在的效率过低、成本过高等问题,提出一种融合ECA(Efficient Channel Attention)注意力机制与DenseNet201的水稻图像识别模型GE-DenseNet(G-ECA DenseNet)。 [方法] 首先在ECA机制上引入Ghost模块的思想构成G-ECA Layer结构,增强其提取特征的能力。其次,在DenseNet201原有的Dense Block前引入G-ECA Layer,使模型具有更优的通道特征提取能力。由于实验所用的数据集较小,将DenseNet201在ImageNet数据集上预训练的权重参数迁移到GE-DenseNet中。训练时,采用Focal Loss函数来解决各分类样本不均衡的问题。同时,使用Adam优化器以避免在模型训练初期由于部分权重随机初始化而导致反向传播的梯度变化剧烈的问题,在一定程度上削弱了网络训练的不确定性。[结果和讨论]在包含水稻胡麻斑病、水稻铁甲虫、稻瘟病与健康水稻的3355张图像数据集上进行了实验测试,识别准确率达到83.52%。由GE-DenseNet模型的消融对比实验可得,引入了Focal Loss函数与G-ECA Layer层之后,模型准确率上升2.27%。将所提模型与经典NasNet(4@1056)、VGG-16和ResNet50模型相比,分类准确率分别提高了6.53%、4.83%和3.69%;相较于原始的DenseNet201,对水稻铁甲虫的识别准确率提升达20.32%。 [结论] 加入G-ECA Layer结构能够使模型更为准确地捕捉适合于水稻病虫害识别的特征信息,从而使GE-DenseNet模型能够实现对不同水稻病虫害图像更为准确地识别,为及时防治病虫害,减少各类损失提供技术支持。

关键词: DensetNet201, ECA注意力机制, 病虫害识别, 迁移学习, 卷积神经网络, Ghost模块

Abstract:

[Objective] To address the problems of low efficiency and high cost of traditional manual identification of pests and diseases, improve the automatic recognition of pests and diseases by introducing advanced technical means, and provide feasible technical solutions for agricultural pest and disease monitoring and prevention and control, a rice image recognition model GE-DenseNet (G-ECA DenseNet) based on improved ECA (Efficient Channel Attention) mechanism with DenseNet201 was proposed. [Methods] The leaf images of three pests and diseases, namely, brownspot, hispa, leafblast and healthy rice were selected as experimental materials. The images were captured at the Zhuanghe Rice Professional Cooperative in Yizheng, Jiangsu Province, and the camera was used to manually take pictures from multiple angles such as the top and side of rice every 2 h, thus acquiring 1250 images of rice leaves under different lighting conditions, different perspectives, and different shading environments. In addition, samples about pests and diseases were collected in the Kaggle database. There were 1488 healthy leaves, 523 images of brownspot, 565 images of hispa, and 779 images of leafblast in the dataset. Since the original features of the pest and disease data were relatively close, firstly, the dataset was divided into a training set and a test set according to the ratio of 9:1, and then data enhancement was performed on the training set. A region of interest (ROI) was randomly selected to achieve a local scale of 1.1 to 1.25 for the sample images of the dataset, thus simulating the situation that only part of the leaves were captured in the actual shooting process due to the different distance of the plants from the camera. In addition, a random rotation of a certain angle was used to crop the image to simulate the different angles of the leaves. Finally, the experimental training set contains 18,018 images and the test set contains 352 images. The GE-DenseNet model firstly introduces the idea of Ghost module on the ECA attention mechanism to constitute the G-ECA Layer structure, which replaces the convolution operation with linear transformation to perform efficient fusion of channel features while avoiding dimensionality reduction when learning channel attention information and effectively enhancing its ability to extract features. Secondly, since the original Dense Block only considered the correlation between different layers and ignores the extraction of important channel information in the image recognition process, introducing G-ECA Layer before the original Dense Block of DenseNet201 gives the model a better channel feature extraction capability and thus improved the recognition accuracy. Due to the small dataset used in the experiment, the weight parameters of DenseNet201 pre-trained on the ImageNet dataset were migrated to GE-DenseNet. During the training process, the BatchSize size was set to 32, the number of iterations (Epoch) was set to 50, and the Focal Loss function was used to solve the problem of unbalanced samples for each classification. Meanwhile, the adaptive moment estimation (Adam) optimizer was used to avoid the problem of drastic gradient changes in back propagation due to random initialization of some weights at the early stage of model training, which weakened the uncertainty of network training to a certain extent. [Results and Discussions] Experimental tests were conducted on a homemade dataset of rice pests and diseases, and the recognition accuracy reached 83.52%. Comparing the accuracy change graphs and loss rate change graphs of GE-DenseNet and DenseNet201, it could be found that the proposed method in this study was effective in training stability, which could accelerate the speed of model convergence and improve the stability of the model, making the network training process more stable. And observing the visualization results of GE-DenseNet and DenseNet201 corresponding feature layers, it could be found that the features were more densely reflected around the pests and diseases after adding the G-ECA Layer structure. From the ablation comparison experiments of the GE-DenseNet model, it could be obtained that the model accuracy increased by 2.27% after the introduction of the Focal Loss function with the G-ECA Layer layer. Comparing the proposed model with the classical NasNet (4@1056), VGG-16 and ResNet50 models, the classification accuracy increased by 6.53%, 4.83% and 3.69%, respectively. Compared with the original DenseNet201, the recognition accuracy of hispa improved 20.32%. [Conclusions] The experimental results showed that the addition of G-ECA Layer structure enables the model to more accurately capture feature information suitable for rice pest recognition, thus enabling the GE-DenseNet model to achieve more accurate recognition of different rice pest images. This provides reliable technical support for timely pest and disease control, reducing crop yield loss and pesticide use. Future research can lighten the model and reduce its size without significantly reducing the recognition accuracy, so that it can be deployed in UAVs, tractors and various distributed image detection edge devices to facilitate farmers to conduct real-time inspection of farmland and further enhance the intelligence of agricultural production.

Key words: DensetNet201, attention mechanism, pest and disease identification, transfer learning, CNN, Ghost module

中图分类号: