|国家预印本平台
首页|基于改进YOLOv8s 的玫瑰鲜切花分级方法

基于改进YOLOv8s 的玫瑰鲜切花分级方法

Grading Method of Fresh Cut Rose Flowers Based on Improved YOLOv8s

中文摘要英文摘要

[目的/意义]针对当前玫瑰鲜切花分级仍依赖人工进行简单分级,造成效率低、准确率低等问题,提出 一种新的模型Flower-YOLOv8s来实现玫瑰鲜切花的分级检测。[方法]以单一背景下单支玫瑰花的花头作为检测 目标,将鲜切花分为A、B、C、D四个等级,对YOLOv8s(You Only Look Once version 8 small) 模型进行了优化改 进。首先,构建了一个全新的玫瑰鲜切花分级检测数据集。其次,在YOLOv8s的骨干网络分别添加CBAM(Con? volutional Block Attention Module) 和SAM(Spatial Attion Module) 两个注意力机制模块进行对比实验;选择SAM模 块并对其进一步优化,针对模型轻量化需求,再结合深度可分离卷积模块一起添加到C2f结构中,形成Flower- YOLOv8s模型。[结果和讨论]从实验结果来看YOLOv8s添加SAM的模型具有更高的检测精度,mAP@0.5达到 86.4%。Flower-YOLOv8s相较于基线模型精确率提高了2.1%,达到97.4%,平均精度均值(mAP) 提高了0.7%, 同时降低了模型参数和计算量,分别降低2.26 M和4.45 MB;最后使用相同的数据集和预处理方法与Fast-RCNN、 Faster-RCNN、SSD、YOLOv3、YOLOv5s和YOLOv8s进行对比实验,证明所提出的实验方法综合强于其他经典 YOLO模型。[结论]提出的基于改进YOLOv8s的玫瑰鲜切花分级方法研究能有效提升玫瑰鲜切花分级检测的精准 度,为玫瑰鲜切花分级检测技术提供一定的参考价值。

Objective The fresh cut rose industry has shown a positive growth trend in recent years, demonstrating sustained development. Considering the current fresh cut roses grading process relies on simple manual grading, which results in low efficiency and accuracy, a new model named Flower-YOLOv8s was proposed for grading detection of fresh cut roses. Methods The flower head of a single rose against a uniform background was selected as the primary detection target. Subsequently, fresh cut roses were categorized into four distinct grades: A, B, C, and D. These grades were determined based on factors such as color, size, and freshness, ensuring a comprehensive and objective grading system. A novel dataset contenting 778 images was specifically tailored for rose fresh-cut flower grading and detection was constructed. This dataset served as the foundation for our subsequent experiments and analysis. To further enhance the performance of the YOLOv8s model, two cutting-edge attention convolutional block attention module (CBAM) and spatial attention module (SAM) were introduced separately for comparison experiments. These modules were seamlessly integrated into the backbone network of the YOLOv8s model to enhance its ability to focus on salient features and suppressing irrelevant information. Moreover, selecting and optimizing the SAM module by reducing the number of convolution kernels, incorporating a depth-separable convolution module and reducing the number of input channels to improve the modules efficiency and contribute to reducing the overall computational complexity of the model. The convolution layer (Conv) in the C2f module was replaced by the depth separable convolution (DWConv), and then combined with Optimized-SAM was introduced into the C2f structure, giving birth to the Flower-YOLOv8s model. Precision, recall and F1 score were used as evaluation indicators. Results and Discussions Ablation results showed that the Flower-YOLOv8s model proposed in this study, namely YOLOv8s+DWConv+ Optimized-SAM, the recall rate was 95.4%, which was 3.8% higher and the average accuracy, 0.2% higher than that of YOLOv8s with DWConv alone. When compared to the baseline model YOLOv8s, the Flower-YOLOv8s model exhibited a remarkable 2.1% increase in accuracy, reaching a peak of 97.4%. Furthermore, mAP was augmented by 0.7%, demonstrating the models superior performance across various evaluation metrics. The effectiveness of adding Optimized-SAM was proved. From the overall experimental results, the number of parameters of Flower-YOLOv8s was reduced by 2.26 M compared with the baseline model YOLOv8s, and the reasoning time was also reduced from 15.6 to 5.7 ms. Therefore, the Flower-YOLOv8s model was superior to the baseline model in terms of accuracy rate, average accuracy, number of parameters, detection time and model size. The performances of Flower-YOLOv8s network were compared with other target detection algorithms of Fast-RCNN, Faster-RCNN and first-stage target detection models of SSD, YOLOv3, YOLOv5s and YOLOv8s to verify the superiority under the same condition and the same data set. The average precision values of the Flower-YOLOv8s model proposed in this study were 2.6%, 19.4%, 6.5%, 1.7%, 1.9% and 0.7% higher than those of Fast-RCNN, Faster-RCNN, SSD, YOLOv3, YOLOv5s and YOLOv8s, respectively. Compared with YOLOv8s with higher recall rate, Flower-YOLOv8s reduced model size, inference time and parameter number by 4.5 MB, 9.9 ms and 2.26 M, respectively. Notably, the Flower-YOLOv8s model achieved these improvements while simultaneously reducing model parameters and computational complexity. Conclusions The Flower-YOLOv8s model not only demonstrated superior detection accuracy but also exhibited a reduction in model parameters and computational complexity. This lightweight yet powerful model is highly suitable for real-time applications, making it a promising candidate for flower grading and detection tasks in the agricultural and horticultural industries.

严蓓蓓、邴树营、许金普、纪元浩、张玉玉

园艺计算技术、计算机技术农业科学技术发展

YOLOv8s玫瑰鲜切花分级检测深度学习SAM注意力机制

YOLOv8sfresh cut roseshierarchical detectiondeep learningSAMattention mechanism

严蓓蓓,邴树营,许金普,纪元浩,张玉玉.基于改进YOLOv8s 的玫瑰鲜切花分级方法[EB/OL].(2024-06-17)[2025-08-18].https://chinaxiv.org/abs/202406.00273.点此复制

评论