基于改进YOLOv8s的柑橘果实成熟度检测

    Detecting citrus fruit maturity using improved YOLOv8s

    • 摘要: 为了解决柑橘果实被枝叶和其他果实遮挡以及不同果实之间的成熟情况不同等导致识别果实成熟度困难的问题,该研究提出一种改进YOLOv8s模型的柑橘果实成熟度检测方法。首先,在网络主干中添加混合注意力变换器模块(hybrid attention transformer, HAT),使模型利用更多的像素信息以提高对果实成熟度特征的表征能力;然后,将检测头替换为四头的自适应空间特征融合检测头(four-adaptively spatial feature fusion, FASFF)实现果实成熟度特征的尺度不变性。改进YOLOv8s模型在测试集上的精确度P为94.8%,召回率R为88.6%,平均精度均值 \mathrmm\mathrmA\mathrmP_0.5 和 \mathrmm\mathrmA\mathrmP_0.5~0.95 分别为95.6%和88.9%,模型参数量为21.51 M,检测速度为52.9 帧/s。比Faster-RCNN、YOLOv3-spp、YOLOv7和原始YOLOv8s模型精确度分别提升26.0、5.8、4.8和5.5个百分点,平均精度均值 \mathrmm\mathrmA\mathrmP_0.5 分别提升0.5、1.7、1.6和1.6个百分点。改进YOLOv8s模型能够为柑橘采摘机器人的选择性采收提供有效支持。

       

      Abstract: Accurate and automatic identification of citrus fruit ripeness can greatly contribute to the fruit flavor and quality during intelligent harvesting. However, citrus fruits in the natural environment can not ripen at the same time, leading to the varying degree of ripeness on the same tree. It is also difficult to identify the maturity of citrus fruits, due to the occlusion by branches and leaves, as well as the overlapping occlusion among fruits. In this study, the national standard was developed for the pickable maturity of citrus fruits, with reference to the national standard of the Ministry of Agriculture, NY/T 716-2003, and the operating procedure of wide-skinned citrus for post-harvest storage and logistics, GH/T 1336-2021, according to the phenotypic characteristics of citrus fruits during the ripening period. The citrus fruits to be picked were classified into two categories: 1) Citrus fruits beyond the harvestable maturity of UM (unpickable maturity, UM); and 2) Citrus fruits reaching pickable maturity, PM (pickable maturity, PM). An improved YOLOv8s model was also proposed to identify the ripeness degree of citrus fruits. Firstly, a hybrid attention transformer (HAT) module was added into the network backbone. The low-quality citrus fruit images were reconstructed into the high-resolution images. More information was utilized to capture the ripeness features of the fruits, thus improving the accuracy of the detection; Secondly, the detection head was replaced with a four-head adaptive spatial feature fusion (FASFF) detection head. Adaptive spatial fusion weights were learned at different spatial locations. Thus, different levels of citrus fruit features were effectively fused together to improve the scale invariance of features. The improved YOLOv8s model was finally tested by 209 citrus fruit test images. The precision P of improved YOLOv8s model on the test set was 94.8%, the recall R was 88.6%, the mAP0.5 and mAP0.5~0.95 were 95.6% and 88.9%, respectively. Comparing with the Faster-RCNN, YOLOv3-spp, YOLOv7, and original YOLOv8s models, the precision of the improved YOLOv8s model was improved by 26.0, 5.8, 4.8, and 5.5 percentage points, respectively, while the mean average precision mAP0.5 was improved by 0.5, 1.7, 1.6, and 1.6 percentage points, respectively, and the mAP0.5~0.95 was improved by 26.4, 1.9, 4.5, and 3.0 percentage points. In terms of the number of parameters of the model, the improved YOLOv8s model was 21.51 M, although it was 10.38 M higher than that of the original YOLOv8s. The precision P, mAP0.5 and mAP0.5~0.95, were higher than those of the original YOLOv8s by 5.5, 1.6, and 3.0 percentage points, respectively. The number of transmitted frames per second of the model was 52.9, which was fully met the real-time detection requirements of the mobile edge device. The improved YOLOv8s model shared the high detection accuracy and real-time detection speed. Therefore, the improved YOLOv8s model can be expected to detect the ripeness of citrus fruits in the natural environment. The finding can provide the effective support to the selective harvesting of automatic picking robots.

       

    /

    返回文章
    返回