集成改进YOLOv8n与通道剪枝的轻量化番茄叶片病虫害识别方法

    Identifying tomato leaf diseases and pests using lightweight improved YOLOv8n and channel pruning

    • 摘要: 针对当前番茄叶片病害检测模型参数量、计算量过大的问题,该研究提出了一种基于YOLOv8n的轻量化高精度网络模型。通过StarBlock模块对原始的C2f(CSP bottleneck with 2 convolutions)进行重构,大幅降低参数量的同时增强模型表达能力;其次引入混合局部通道注意力机制(mixed local channel attention,MLCA),以捕捉更多的上下文信息和多尺度特征;同时,通过多级通道压缩方式改进了原有检测头,减少了沿通道维度的特征;最后通过融合通道剪枝算法对模型二次压缩,使其更加轻量化。试验结果表明,经处理的模型参数量、浮点计算量、模型权重大小分别降低了63.3%、72.8%、61.9%,模型精确率、召回率和平均精度均值(mean average precision(IoU=0.5),mAP0.5)分别为97.5% 、96.2% 和98.5%,性能方面,移动端设备检测帧率达到358.5帧/s,番茄叶片病虫害图像单幅推理时间平均为4.4 ms。证明了该算法可在大幅降低网络计算量的同时保持较高的检测性能,能够满足移动端和嵌入式设备的部署要求。

       

      Abstract: Timely and accurate identification of leaf diseases can greatly contribute to the effective pest prevention and control in the tomato growth cycle. In this study, a lightweight detection approach was proposed to balance between detection accuracy and computational efficiency. An enhanced version of the YOLOv8n (you only look once) model was augmented with a pruning algorithm, specifically designed to identify the various types of tomato leaf diseases. The YOLOv8n architecture was used to replace the conventional C2f (concatenated feature fusion) module with the more efficient StarBlock module. The number of parameters were was significantly reduced within the network. The complex features were represented to improve the overall expressive power of the improved model. Additionally, a mixed local channel attention mechanism (MLCA) was integrated to capture the richer set of contextual information and multi-scale features, which were critical to distinguishing among different types of leaf diseases. Furthermore, multi-level channel compression was used to reengineer the original detection head. The performance of the improved model was refined to reduce the dimensionality of the feature maps along the channel axis. Thus, the a more streamlined and computationally efficient structure was obtained after these architectural adjustments. Sparse training was then performed on the high-precision and lightweight model. Some weights were selectively eliminated within the network, according to their importance. A specified level of sparsity was achieved after training. Experimental results indicate that there was the best trade-off between data sparsity and model performance at a sparsity rate of 0.005. The redundant or less significant channels were removed using channel pruning. The final high-precision and lightweight models were obtained after training. A series of tests were carried out to validate the improved model. A dataset was comprised of 4,130 images. Nine distinct types of tomato leaf diseases were compiled. The developed model was then tested against this dataset. Compared with the baseline YOLOv8n, the improved model exhibited a substantial reduction in the parameter count (63.3%), floating point operations (72.8%), and model weight size (61.9%). The better performance of the improved model was achieved in the accuracy (97.5%), recall (96.2%), and average precision (mAP@0.5: 98.5%), with the a minimal average drop in the performance metrics of just 0.23 percentage points. Furthermore, the improved model was deployed on mobile devices, indicating the a remarkable detection frame rate of 358.5 frames per second, with an average inference time of 4.4 milliseconds per image. Once benchmarked against the popular object detection frameworks, such as Faster R-CNN and SSD, the improved model demonstrated a dramatic decrease in both the number of parameters (by 207.3 and 34.9 M, respectively) and computational complexity (by 497.2 and 280.6 G, respectively). The YOLOv8n was reduced by 20.0% and 59.3% in the parameters, corresponding to a 17% and 49.54% decrease in the computational complexity, compared with the more recent and lightweight models, like YOLOX Nano and YOLOv5Nano. The competitive accuracy levels were all preserved. In conclusion, the improved YOLOv8-SLMP model can offer a highly viable solution to the real-time detection of tomato leaf diseases. Particularly, the footprint was also minimized, in terms of the parameters, computations, and model size. An ideal candidate was deployed on the resource-constrained embedded systems, thus enabling more widespread and efficient monitoring of crop health.

       

    /

    返回文章
    返回