基于YOLOv11s的农作物叶片病虫害检测轻量化模型构建

Construction of a Lightweight Model for Crop Leaf Diseases and Pests Detection Based on YOLOv11s

  • 摘要: 现代农业的产业化、规模化发展对农作物病虫害检测提出新的要求。传统检测主要采用人工方式,识别效率和准确度较低。为解决上述问题,提出一种基于YOLOv11s的农作物叶片病虫害检测模型,并结合注意力机制与模型量化技术实现高效部署。以叶枯病、灰斑病和锈病三类常见病虫害为研究对象,采用随机旋转、翻转等方式构建包含13 770张图像的训练数据集。在YOLOv11s的基础上引入高效多尺度注意力(Efficient Multi-scale Attention,EMA)模块,强化模型的关键特征表达能力,在仅增加8%计算量的条件下使模型mAP50提升至0.749,较原模型提高0.026。采用开放式神经网络交换格式(ONNX)导出并启用自动图优化与FP16半精度量化,利用ONNX Runtime-tools对模型进行INT16静态量化,在CPU运行环境下将模型体积压缩49%(从36.1MB降至18.4MB),单帧推理时间降至105.6ms,精度损失可控。实验结果表明,该模型在保持较高检测精度的同时能够显著降低资源消耗,可有效部署于ARM架构的移动端设备,满足农业现场实时、精准的病虫害识别需求,为智慧农业中的边缘计算应用提供可行的技术方案。

     

    Abstract: The industrialization and large-scale development of modern agriculture have put forward new requirements for the detection of crop leaf diseases and pests. Traditional detection mainly relies on manual identification, which has relatively low identification efficiency and accuracy. To address the above issues, the crop leaf diseases and pests detection model based on YOLOv11s is proposed, and efficient deployment is achieved by combining the attention mechanism with model quantification technology. Taking three common diseases and pests, namely leaf blight, gray spot disease and rust disease, as the research objects, a training dataset containing 13 770 images was constructed by means of random rotation, flipping, etc. Based on YOLOv11s, a multi-scale lightweight EMA attention mechanism is introduced to enhance the key feature expression ability of the model. Under the condition of only increasing the computational load by 8% , the mAP50 of the model is improved to 0.749, which is 0.026 higher than the original model. The model is exported in ONNX format and automatic graph optimization and FP16 half-precision quantization are enabled. INT16 static quantization is performed on the model using ONNX runtime-tools. In the CPU environment, the model volume is compressed by 49% (from 36.1MB to 18.4MB), and the single-fr ame inference time is reduced to 105.6ms, the loss of accuracy is controllable. The experimental results show the lightweight model can significantly reduce resource consumption while maintaining high detection accuracy. It can be effectively deployed on mobile devices based on ARM architecture, meeting the real-time and precise disease identification requirements of agricultural sites, and providing a feasible technical solution for edge computing applications in smart agriculture.

     

/

返回文章
返回