基于改进YOLOv7的黄瓜叶片病虫害检测与识别

    Detection and identification of cucumber leaf diseases based improved YOLOv7

    • 摘要: 黄瓜叶片病虫害的检测与识别是科学防治病害的有效手段。为了提高对黄瓜叶片病斑细小特征的精准定位能力以及提高对早疫病叶片的检测性能,提出一种DCNSE-YOLOv7的深度学习算法。首先,将主干特征提取网络中对最后一个特征层的卷积2D convolution(Conv2D)改为可变形卷积2D Deformable convolution(DCNv2),提高模型对病斑细小特征的提取能力;其次,对主干特征提取网络输出的3个特征层结果添加Squeeze-and-Excitation networks(SENet)注意力机制模块构建网络模型,加强模型对发病早期相似病害特征的有效提取能力;同时,通过K-means++聚类算法对锚框重新聚类,避免算法在训练过程中盲目学习目标的尺寸和位置;最后,将原始YOLOv7的CIOU损失函数,更替为Focal-EIOU损失函数。试验结果表明,DCNSE-YOLOv7算法能够有效对黄瓜叶片病虫害进行检测,其平均精度均值为94.25%,比YOLOv5l、YOLOv7、Faster-RCNN、SSD和YOLOv7-tiny模型分别提高了2.72、2.87、0.28、12.04和7.02个百分点,改进模型的精确度为96.02%,检测速度为52.04帧/s。所提方法为黄瓜叶片病虫害的精准检测提供了一种有效的技术支持。

       

      Abstract: An accurate and rapid detection is one of the most important steps for the scientific prevention and control of cucumber leaf diseases. In this study, A DCNSE-YOLOv7 deep learning algorithm was proposed for the detection performance of the early blighted leaves, particularly for the high accuracy of the fine features on the cucumber leaf spots. Firstly, the convolution (Conv2D) of the last feature layer was changed to the deformable convolution (DCNv2) in the backbone feature extraction network, in order to extract the small features from the disease. Secondly, SENet attention mechanism modules were added at the output of the three feature layers in the backbone feature extraction network. The effective extraction was enhanced for the similar diseases in early stages of onset. Meanwhile, K-means++ clustering algorithm was used to re-cluster anchor boxes, in order to avoid the blind learning on the size and location of the target during training. Finally, the CIOU loss function of YOLOv7 was replaced with the Focal-EIOU to accelerate the convergence of the model. The test was conducted in Windows environment using Pytorch deep learning framework for network training. The network training parameters were set as follows: image input size 640×640, batch size 24, multi-threading set to 2, initial learning rate 0.01, and each training iteration (Epoch) was 1000 times. A weight parameter was saved for each 10 Epoch. Thus, a total of 100 training weight parameters were obtained, and then the best weight parameter was applied into the test data to evaluate the final performance of the model. Three experiments were designed in total, including mainstream model performance, different attention mechanism, and ablation experiments. The results showed that the DCNSE-YOLOv7 algorithm was effectively detected the cucumber leaf diseases in the mainstream model performance, with an average precision mean of 94.25%. Specifically, the average precision of DCNSE-YOLOv7 increased by 2.72, 2.87, 0.28, 12.04, and 7.02 percentage points, respectively, compared with the mainstream object detection models, YOLOv5l, YOLOv7, Faster-RCNN, SSD, and YOLOv7-tiny. The accuracy of DCNSE-YOLOv7 was 96.02%, and the detection speed was 52.04 frames per second. Furthermore, the SENet attention mechanism in the DCNSE-YOLOv7 algorithm performed the better detection accuracy than the CBAM and ECA ones. Accuracy and recall rates of 1000 iterations of DCNSE-YOLOv7 and YOLOv7 models were plotted into the P-E and R-E curves, respectively. Among them, an initial non-zero ordinate was observed in the R-E curve of the DCNSE-YOLOv7 model. There were no pre-trained weights during the first training, due to the modification of the main feature extraction network. The trained weights were then used to train the model with YOLOv7 for 1000 iterations after 300 iterations of training. The accuracy of the model was stabilized after the 500th iteration, indicating the better fitting network. There was also the significant oscillation trend in the recall rate of the model at the 600th iteration. Finally, the ablation experiment showed all positive performances of DCNv2, SENet attention mechanism, K-means++ anchors, and Focal-EIOU loss function. At the same time, the different models were selected to detect the cucumber leaf diseases, in order to verify the performance of the model in the cucumber growth environment. The visualization also show that the DCNSE-YOLOv7 model shared the lower error and leakage detection rates than before. More importantly, the DCNSE-YOLOv7 can be expected to accurately distinguish the target spot disease and the powdery mildew disease with the similar yellow dot features in the early stage. In conclusion, the DCNSE-YOLOv7 model with the high detection accuracy and robustness can provide the effective technical support for the accurate detection of cucumber leaf diseases.

       

    /

    返回文章
    返回