基于剪枝与蒸馏的轻量化玉米病害检测方法

    Method for lightweight corn leaf diseases based on pruning and distillation

    • 摘要: 为了解决以叶斑病、灰斑病、花叶病、锈病为代表的玉米病害严重影响玉米产量与质量的问题,以及在边缘计算设备上实现对玉米病害的实时检测,该文提出一种轻量化高精度模型YOLOv8-Corn。以YOLOv8n作为基线模型,首先添加可变性卷积(deformable convolutional networks,DCNv2)与上采样算子DySample(dynamic sample)模块提高精度。其次采用网络瘦身剪枝技术,对模型进行稀疏化训练,预先缓解后续剪枝对泛化能力的负面影响,再根据训练结果去除约25%的冗余参数量,得到相对轻量的剪枝模型后进一步使用回调训练,恢复与提高模型精度。再次,结合通道知识蒸馏(channel-wise knowledge dissillation,CWD),在保证模型轻量化的前提下,提高模型的精度。最终以轻量化的模型配合TensorRT完成在Jetson Nano上的实际部署。结果显示,YOLOv8-Corn相比其他网络有着较高检测精度与轻量化水平,精确率、召回率、平均精度均值分别达到99.78%、99.30%、99.20%。YOLOv8-Corn模型大小由6.35M减至4.40M,每秒帧数达到121.3;并实现大田检测,完成检测模型的实际部署与应用。研究设计的模型与网络实际部署为实现轻量化高精度玉米病害检测提供技术支持。

       

      Abstract: Maize, as one of the world's major food crops, faces a number of serious threats from various and awful diseases. These crop diseases, such as Leaf spot disease, Gray spot disease, Mosaic disease, and Rust disease, can lead to significant yield losses and quality degradation of maize, thus becoming a crucial constraint to maize production development. In the field of crop disease identification, YOLOv8 has gained widespread recognition as a representative lightweight model due to its excellent balance between accuracy and computational efficiency. However, despite its advantages, YOLOv8 still has room for improvement when it comes to practical detection deployment, especially in resource-constrained environments. To address issues such as the severe impact of corn diseases represented by leaf spot disease, gray spot disease, mosaic disease, and rust disease on corn yield and quality, as well as to enable real-time detection of corn diseases on edge computing devices, this paper proposes a lightweight, high-precision model called YOLOv8-Corn.First of all, This study uses YOLOv8n as the baseline model, first adding deformable convolutional networks (DCNv2) and the DySample (dynamic sample) upsampling operator module to improve accuracy. Then, we proposed the use of Network thinning and pruning techniques, which allowed us to remove approximately 25% of the redundant parameters from the model. Not only did this process reduce the model size but it also maintained its essential detection capabilities. After obtaining a relatively compact pruning model, we further employed callback training. This training strategy aims to supplement the weight removed by pruning, thereby restoring and even improving the accuracy of the model to a certain extent.Subsequently, we combined the model with the CWD(Channel-Wise Knowledge Distillation) feature distillation method. This step is of great significance as it enables further improvement of the model accuracy while ensuring lossless reduction of model parameters and calculation amount. Last but not the least, with the intention of achieving practical deployment, we integrated the lightweight model with TensorRT and completed the actual deployment on the Jetson Nano platform.The results of this study, in addition to their promising characteristics, demonstrate the effectiveness of our approach. Compared with other networks, the improved model of YOLOv8n shows superior performance in terms of detection accuracy and lightweight level. Specifically, the average accuracy rate, recall rate as well as average accuracy of the improved model reach 99.78%, 99.30%, and 99.20%, respectively. These high indicators highly indicate that the model can accurately identify maize diseases in practical applications. Moreover, the model size is reduced from 6.35 MB to 4.40 MB, making it more suitable for deployment on devices with limited resources. The number of frames per second reaches 121.3, ensuring real-time performance during detection. By realizing the joint with Jetson Nano, we have successfully completed the actual deployment and application of the detection model.In conclusion, the research presents a highly efficient and lightweight detection model for maize diseases. The designed model and the actual deployment of the network provide strong technical support for the realization of lightweight and high-precision detection of maize underleaf diseases. Apart from its conspicuously contribution to the advancement of crop disease identification technology, this work boasts practical significance for improving maize production and quality. The model's high accuracy and lightweight characteristics make it a valuable tool for real-time monitoring and management of maize diseases, effectively facilitating in a further step offering a promising solution for precision agriculture and sustainable crop production. Moreover, this research addresses a critical need in agricultural technology by providing a robust and efficient solution for maize pest and disease detection. Through the seamless integration of the combination of advanced model optimization techniques and practical deployment strategies makes this study a truly valuable contribution to the field of agricultural intelligent equipment engineering.

       

    /

    返回文章
    返回