| As the world’s largest producer and consumer of apples,China’s apple industry plays an important role in the country’s economic development.Apple production and acreage rank first among all fruit crops in China and hold an irreplaceable position in agricultural development.Apple diseases have a significant impact on both the yield and economic profits of farmers.Diseases often occur on apple leaves,and timely and accurate identification and control of these diseases can minimize economic losses for farmers.However,traditional methods of manual or machine vision detection are time-consuming,labor-intensive,and low in efficiency and accuracy,with significant limitations.This article focuses on the low detection efficiency,high false alarm rate,and poor real-time performance of apple leaf disease defect detection.Specifically,the article studies six types of apple leaf diseases,including leaf spot,brown spot,black rot,flower spot,gray spot,and rust,and combines deep learning technology to conduct in-depth research on the following topics:(1)Due to the small size of the dataset,it is easy for the network to overfit.The article uses offline data augmentation techniques,such as image rotation,brightness adjustment,and noise addition,to augment the dataset.In addition,online data augmentation techniques,such as Mosaic,are used during the training process.Data augmentation techniques improve the network’s robustness and generalization ability,which leads to better learning.(2)The preset anchor boxes in YOLOv4 algorithm are generated using the COCO dataset and are not suitable for small object detection datasets such as apple leaf disease.Therefore,the article uses K-means algorithm to reset the anchor values to improve the detection accuracy on the apple disease dataset.The YOLOv4 algorithm uses CSPDarknet53 as its feature extraction network,resulting in a model size of 245 MB,which is not practical for daily use.Therefore,Dense Net121 is introduced as the main feature extraction network to make the model lighter while maintaining its accuracy.The improved algorithm is called DYOLOv4,which achieves an average precision of 97.40%,improving by 6.08% compared to the original algorithm.(3)Finally,the improved model is added with an attention mechanism to increase the attention to apple leaf diseases and improve the detection performance of the model.The final DAYOLOv4 algorithm is obtained by combining with the previous model.Compared with the YOLOv4 algorithm,the mean average precision of the algorithm reaches 97.76%,which is 6.44% higher than that before improvement.The model size is63.56 MB,which is 181.97 MB less than that before the improvement,and the detection speed is 23.30 FPS,which is 1.26 FPS lower than that before the improvement.The experimental results show that the proposed DAYOLOv4 algorithm can improve the efficiency and accuracy of apple leaf disease recognition and reduce model size,making it suitable for daily use.This algorithm provides a scientific method for identifying and preventing apple leaf diseases. |