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.