CottonBud-YOLOv5s轻量型棉花顶芽检测算法

    CottonBud-YOLOv5s lightweight cotton bud detection algorithm

    • 摘要: 针对棉花机械打顶作业过程中,边缘移动设备算力受限实时性差,运动模糊、小目标遮挡导致难以检测的问题。该研究基于YOLOv5s模型提出CottonBud-YOLOv5s轻量型棉花顶芽检测模型,该模型采用ShuffleNetv2主干网络和DySample动态上采样模块替换原始模块降低计算量,提高模型检测速度;头部(head)和颈部(neck)分别引入ASFFHead检测头和GC(global context)全局注意力模块增强模型尺度不变性和上下文特征提取能力,提高小目标遮挡和运动模糊图像的检测性能。通过消融试验和模型对比试验,验证CottonBud-YOLOv5s棉花顶芽检测模型的可行性。试验结果表明:引入ASFFHead检测头和GC全局注意力机制后,小目标平均精度AP0.5:0.95和平均召回率AR0.5:0.95值分别提升3.6、2.1个百分点,中目标平均精度AP0.5:0.95和平均召回率AR0.5:0.95值分别提升4.1、3.5个百分点,大目标平均精度AP0.5:0.95和平均召回率AR0.5:0.95值分别提升6.5、5.9个百分点;与Faster-RCNN、TOOD、RTDETR、YOLOv3s、YOLOv5s、YOLOv9s和YOLOv10s检测模型相比检测速度分别提升26.4、26.7、24.2、24.8、11.5、18.6、15.6帧,平均精度均值分别提升14.0、13.3、5.5、0.9、0.8、0.2、1.5个百分点,召回率分别提升16.8、16.0、3.2、2.0、0.8、0.5、1.2个百分点,CottonBud-YOLOv5s模型平均精度均值达到97.9%,召回率达到97.2%,CPU检测速度达到27.9帧/s。由模型可视化分析可知CottonBud-YOLOv5s模型在单株、多株、运动模糊、小目标遮挡的整体检测性能优于其他检测模型。该模型具有较高的检测精度、鲁棒性和检测速度,适用于密植环境下棉花顶芽的精准检测,可为棉花机械化打顶提供视觉检测基础。

       

      Abstract: In the context of cotton mechanical topping, several challenges arise due to the limitations of edge-moving devices, including restricted computing power and poor real-time performance. These issues, compounded by phenomena such as motion blur and small target occlusion, significantly hinder the detection process. The focus of this study is to address these challenges by proposing a novel, lightweight cotton bud detection model, named CottonBud-YOLOv5s, which is based on the well-known YOLOv5s architecture. This model incorporates several key improvements to optimize both performance and efficiency in detecting cotton buds in complex field environments. To enhance the model’s overall performance, the CottonBud-YOLOv5s model utilizes the ShuffleNetv2 backbone network, which is specifically chosen for its efficiency in reducing computational complexity while maintaining high detection accuracy. In addition, the DySample dynamic upsampling module is integrated to replace the original upsampling modules, further decreasing computational costs and improving detection speed. These innovations allow the model to run more efficiently on edge devices with limited computing power, addressing the real-time performance issues that often arise during practical applications in cotton mechanical topping. Moreover, the model is designed with an advanced detection head and attention mechanism to bolster its ability to handle varying object scales and complex contextual information. Specifically, the model introduces the ASFFHead detection head and the GC (global context) attention module in the head and neck components, respectively. The integration of these modules enhances the model's scale invariance and significantly improves its capacity for extracting context-based features, which is crucial for detecting small targets that may be occluded or blurred due to motion. These enhancements ultimately improve the model's robustness, enabling it to perform well in challenging real-world conditions. To validate the efficacy of the CottonBud-YOLOv5s model, a series of ablation studies and model comparison tests were conducted. The experimental results demonstrated that the introduction of the ASFFHead detection head and the GC global attention mechanism led to notable improvements in detection accuracy. Specifically, the average precision (AP) at 0.5:0.95 for small targets increased by 3.6 percentage points, while the average recall rate (AR) at the same threshold improved by 2.1 percentage points. For medium-sized targets, the average precision (AP) increased by 4.1 percentage points, and the average recall rate (AR) increased by 3.5 percentage points. For large targets, the average precision (AP) increased by 6.5 percentage points, and the average recall rate (AR) improved by 5.9 percentage points. These results underscore the effectiveness of the proposed enhancements in improving the detection of targets across a range of sizes. Furthermore, when compared to other state-of-the-art detection models, including Faster-RCNN, TOOD, RTDETR, YOLOv3s, YOLOv5s, YOLOv9s, and YOLOv10s, the CottonBud-YOLOv5s model showed significant improvements in detection speed. Specifically, it outperformed these models with speed increases of 26.4, 26.7, 24.2, 24.8, 11.5, 18.6, and 15.6 frames per second, respectively. Additionally, the mean average precision (mAP) was improved by 14.0, 13.3, 5.5, 0.9, 0.8, 0.2, and 1.5 percentage points in comparison to the aforementioned models. The recall rate also saw substantial increases of 16.8, 16.0, 3.2, 2.0, 0.8, 0.5, and 1.2 percentage points, respectively. Overall, the CottonBud-YOLOv5s model achieved a remarkable mean average precision (mAP) of 97.9%, a recall rate of 97.2%, and a CPU detection speed of 27.9 frames per second, demonstrating its exceptional performance in both accuracy and speed. Visual analysis of the model’s performance further confirmed that the CottonBud-YOLOv5s model excels in various detection scenarios, including single-plant, multi-plant, motion blur, and small target occlusion conditions. Its superior performance in these areas highlights its robustness and effectiveness in real-world agricultural environments, where such challenges are commonly encountered. In conclusion, the CottonBud-YOLOv5s model offers a promising solution for precise, real-time detection of cotton buds in densely planted environments. With its high detection accuracy, enhanced robustness, and efficient computational performance, it provides a solid visual detection foundation for cotton mechanized topping, contributing significantly to the advancement of automated agricultural practices.

       

    /

    返回文章
    返回