欢迎您访问《智慧农业(中英文)》官方网站! English

Smart Agriculture

• •    

基于改进YOLOv10和LAMP通道剪枝的串番茄成熟度检测算法研发

赵丽成1,2, 卢鑫羽2, 吴茜2, 任妮2, 周玲莉2, 程雅雯2, 胡安琦2, 戚超2()   

  1. 1. 淮阴工学院 化学工程学院,江苏 淮安 223003,中国
    2. 江苏省农业科学院 农业信息研究所,江苏 南京 210014,中国
  • 收稿日期:2025-07-30 出版日期:2025-12-09
  • 基金项目:
    国家自然科学基金青年基金(32201664); 动态非结构环境下番茄高效采摘机器人关键技术及系统创制(CX(24)1021); 设施番茄采收机器人平台研发应用(JSYTH08)
  • 作者简介:

    赵丽成,硕士研究生,研究方向为作物表型算法研究。E-mail:

  • 通信作者:
    戚 超,博士,助理研究员,研究方向为图像处理与机器视觉。E-mail:

An Improved YOLOv10-Based Tomato Ripeness Detection Algorithm with LAMP Channel Pruning

ZHAO Licheng1,2, LU Xinyu2, WU Qian2, REN Ni2, ZHOU Lingli2, CHENG Yawen2, HU Anqi2, QI Chao2()   

  1. 1. School of Chemical Engineering, Huaiyin Institute of Technology, Huai'an 223003, China
    2. Institute of Agricultural Information, Jiangsu Academy of Agricultural Sciences, Nanjing 210014, China
  • Received:2025-07-30 Online:2025-12-09
  • Foundation items:National Natural Science Foundation of China Youth Fund Program(32201664); Development of Key Technologies and System for Efficient Tomato Harvesting Robots in Dynamic and Unstructured Environments(CX(24)1021); Development and Application of a Robotic Platform for Facility-Grown Tomato Harvesting(JSYTH08)
  • About author:

    ZHAO Licheng, E-mail:

  • Corresponding author:
    QI Chao, E-mail:

摘要:

【目的/意义】 由于串番茄果实密集重叠、温室光照复杂多变及果实颜色连续渐变等因素,检测模型在对成熟度进行精准快速识别时面临挑战。因此,提出了一种基于改进YOLOv10(You Only Look Once version 10)的轻量级串番茄成熟度目标检测模型LampCT-YOLO (Cluster Tomato YOLO with Layer-wise Adaptive Mask Pruning),以提高检测精度、推理速度和鲁棒性。 【方法】 以YOLOv10为基线模型,在主干网络引入SegNeXt(Segmentation Next)注意力机制,通过自适应调整注意力权重,增强模型对3类不同成熟度串番茄关键区域(如边界、颜色深浅)的特征提取能力;在训练完成的模型基础上,通过基于梯度的全局通道重要性方法LAMP(Layer-wise Adaptive Mask Pruning)通道剪枝,显著压缩模型体积和计算复杂度,同时有效保持模型对串番茄3分类成熟度的高检测性能。[讨论与分析] 在NVIDIA A100显卡环境,LampCT-YOLO模型对串番茄红熟早期、中期、晚期的平均精度均值(Mean Average Precision, mAP)分别为84.6%、89.5%、88.4%,相比YOLOv10分别提升了5.5、7.7和0.9个百分点,对串番茄3个成熟度类别的平均检测精度mAP50为87.6%,相比YOLOv10提升了4.7个百分点。在应用LAMP通道剪枝技术后,模型的参数量和计算量分别减少63.07%和50.06%,推理速度提升23.1%。部署至自主研发的果蔬巡检机器人后,在边缘设备NVIDIA Jetson AGX Orin上达到9.1 FPS(Frame Per Second)的推理速度,实现了检测精度和实时性的有效平衡。 【结论】 研究结果为基于巡检机器人的串番茄成熟度精准快速识别提供坚实的技术支撑。

关键词: 串番茄, 成熟度检测, 注意力机制, 通道剪枝, 果蔬巡检机器人

Abstract:

[Objective] As a major crop in protected horticulture, cluster tomatoes grow in clusters with dense overlapping fruits. In greenhouse environments, light conditions are complex and variable, and the fruit color transitions continuously from green to red across different ripening stages, showing continuous gradation characteristics. These factors result in low efficiency and strong subjectivity of traditional manual recognition methods. Meanwhile, deep learning-based detection models often suffer from decreased detection accuracy, large localization errors, and slow inference speed when facing complex backgrounds and color interference, making it difficult to meet the dual requirements of real-time performance and high precision in practical applications. Therefore, to meet the practical application requirements of high accuracy, high real-time performance, and strong robustness for cluster tomato ripeness detection, this paper proposes a lightweight target detection model for cluster tomato ripeness, namely LampCT-YOLO (Cluster Tomato YOLO with LAMP pruning), which is based on improved YOLOv10. Through structural optimization and lightweight transformation of the baseline model, the detection accuracy, inference speed, and robustness are effectively improved, providing a novel technical solution for cluster tomato ripeness detection. [Methods] Taking YOLOv10 as the baseline model, first, this study addressed the issue of insufficient feature extraction capability in complex scenarios by introducing the SegNeXt attention mechanism into the backbone network. By adaptively adjusting attention weights and calculating the correlation matrix between different feature channels, the mechanism automatically identified color channels strongly associated with the three ripeness levels of cluster tomatoes and assigned them higher attention weights, while suppressing feature responses from irrelevant background channels such as greenhouse frames, soil, and irrigation pipes. To achieve lightweight deployment of the model and meet the real-time detection requirements of edge devices, a gradient-based global channel importance method—LAMP channel pruning technology—was introduced after model training. The core principle of this technology was to evaluate the contribution of each channel to the model's detection performance by calculating the gradient magnitude of channels in each network layer, thereby eliminating redundant channels. This significantly reduced the model size and computational complexity while effectively maintaining the model's high detection performance for the three-category ripeness classification of cluster tomatoes. [Results and Discussions] Experiments showed that under the environment of NVIDIA A100 graphics card, for 240 cluster tomato images in the test set, the LampCT-YOLO model exhibited excellent detection performance. The mean Average Precision at 50 intersection over union (mAP50) for the early ripe, mid-ripe, and late ripe stages of cluster tomatoes was 84.6%, 89.5%, and 88.4%, respectively, which represented increases of 5.5, 7.7, and 0.9 percent points compared with YOLOv10. The average mAP50 for the three ripeness categories of cluster tomatoes reached 87.6%, a 4.7 percent points improvement over YOLOv10, demonstrating outstanding performance in both detection accuracy and stability. In addition, the model was found to maintain high recognition accuracy when facing variations in light intensity, fruit occlusion ratio, and background complexity, indicating good robustness and environmental adaptability. Regarding the lightweight effect, after applying the LAMP channel pruning technology, the number of model parameters and computational complexity were reduced by 63.07% and 50.06%, respectively, while the inference speed was improved by 23.1%. This effectively met the requirements of edge computing devices for real-time detection and low power consumption, alleviating the trade-off between model accuracy and inference speed. To verify the practical application value of the LampCT-YOLO model, the model was deployed on a self-developed fruit and vegetable inspection robot, which conducted field tests on 456 clusters of tomatoes in a real greenhouse environment. The results showed that the inspection robot successfully identified 78, 61, and 248 clusters of early ripe, mid-ripe, and late ripe cluster tomatoes, respectively, with detection accuracies of 84.8%, 87.1%, and 84.4%, and an average accuracy of 85.4%. Meanwhile, there were 5, 7, and 10 false detections, as well as 9, 2, and 36 missed detections for the early ripe, mid-ripe, and late ripe stages respectively, which to a certain extent reflected the practical application potential of the model. [Conclusions] The optimized LampCT-YOLO model not only significantly improves the recognition accuracy of cluster tomatoes at different ripening stages but also greatly reduces the model complexity, successfully achieving efficient deployment in resource-constrained scenarios. This model effectively balances the dual requirements of detection accuracy and real-time performance for inspection robots, and further constructs a reusable technical framework for the ripeness detection of protected horticultural fruits and vegetables. It provides strong support for the transformation of protected agriculture from labor-intensive to technology-intensive, and injects key innovative impetus into the large-scale and diversified implementation of smart agriculture.

Key words: cluster tomato, ripeness detection, attention mechanism, channel pruning, fruit and vegetable inspection robot

中图分类号: