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

Smart Agriculture

• •    

基于改进YOLOv10s的番茄成熟度及外观缺陷检测模型

李彦梅(), 颜猛, 汪雨, 杭琪, 汪胜   

  1. 安庆师范大学智能制造与机器人学院,安徽 安庆 246000,中国
  • 收稿日期:2026-05-06 出版日期:2026-07-17
  • 基金项目:
    国家自然科学基金项目(12204013)
  • 通信作者:
    李彦梅,硕士,教授,研究方向为智能控制与流量检测、机器学习。E-mail:

Improved YOLOv10s-Based Model for Tomato Ripeness and Surface Defect Detection

LI Yanmei(), YAN Meng, WANG Yu, HANG Qi, WANG Sheng   

  1. School of Intelligent Manufacturing and Robotics, Anqing Normal University, Anqing 246000, China
  • Received:2026-05-06 Online:2026-07-17
  • Foundation items:National Natural Science Foundation of China(12204013)
  • Corresponding author:
    LI Yanmei, E-mail:

摘要:

【目的/意义】 番茄成熟度的精细化分级与外观缺陷的精准识别是决定其市场定位与流通安全的关键环节,为解决现有番茄检测算法成熟度分级粒度不足、外观缺陷一体化识别缺失、检测精度与部署效率难以平衡的问题,匹配产业通用的四级成熟度采收标准,满足自动化采收与智能分拣的高精度、轻量化作业需求,本文提出一种改进的 YOLOv10s 番茄检测模型 ——Tomato-YOLO。 【方法】 该模型以YOLOv10s为基线框架,首先引入尺度感知上下文模块替换骨干网络中的C2f模块,强化对相邻成熟度细微差异特征的捕获能力;其次构建跨层级多尺度特征融合策略并拓展为四检测头架构,新增面向超小目标的P2检测层以增强复杂田间环境下的目标感知鲁棒性;采用形状交并比损失函数替代完全交并比损失函数损失并设计小目标自适应加权策略以优化边界框回归精度;最后引入层自适应幅度剪枝技术对冗余卷积层进行结构化裁剪。 【结果和讨论】 Tomato-YOLO模型的精确率、召回率及平均精度均值分别达到92.1%、92.0%与95.0%,较原始YOLOv10s模型分别提升6.9、11.6及6.8个百分点;经15%比例剪枝部署于Jetson Nano边缘计算平台后,模型权重压缩至15.1 MB,推理速度达30.4帧/s。 【结论】 Tomato-YOLO模型实现了番茄成熟度细粒度分级与外观缺陷一体化识别的高精度与高实时性统一,可为番茄产业智能化采收与分拣提供有效的视觉检测技术支持。

关键词: 番茄成熟度检测, 外观缺陷识别, YOLOv10s, 尺度感知上下文模块, 多尺度特征融合, 模型剪枝

Abstract:

[Objective] Tomato ripeness directly determines harvest timing, storage-transportation cycle and market pricing, while appearance defects not only reduce commercial value but also may cause cross-infection during storage, making them core mandatory indicators for automated equipment. Traditional manual detection suffers from low efficiency, strong subjectivity and high miss rate, while existing deep learning models generally have shortcomings of insufficient grading granularity, incomplete functional coverage and poor deployment adaptability, hardly balancing accuracy and real-time performance on low-power edge devices. The aim of this study is to propose a lightweight high-precision integrated tomato detection model to provide reliable visual technical support for automated harvesting and intelligent sorting. [Methods] An improved YOLOv10s tomato detection model named Tomato-YOLO was proposed, which simultaneously achieved fine-grained grading of 4 ripeness categories and integrated identification of 4 appearance defect categories. A tomato detection dataset containing 3 807 images was constructed for the study, integrating 2 221 public samples and 1 586 self-collected field samples and covering multiple complex field scenarios. The dataset was hierarchically and randomly split into training, validation and test sets at a 7:2:1 ratio, and five data augmentation strategies were adopted during training to improve generalization, with a total of 8 detection labels (4 ripeness + 4 appearance defects) set. Four improvements were implemented on the YOLOv10s baseline: First, the Scale-Aware Context Module (SACM) was introduced to replace the C2f module in the backbone network, enhancing the feature capture capability for subtle ripeness differences and micro defects while suppressing field background interference. Second, a cross-layer multi-scale bidirectional feature fusion strategy was constructed and extended to a four-detection-head architecture, with a P2 ultra-small target detection layer added to fill the scale coverage gap of the native architecture and boost perception robustness for small and occluded fruits in complex scenes. Third, the SIoU loss function was adopted to replace the native CIoU loss, paired with an adaptive weighting strategy for small targets, adding angle constraints to optimize bounding box regression accuracy for nearly circular tomatoes and raising the learning priority of hard samples. Fourth, Layer-Adaptive Magnitude Pruning (LAMP) technology was introduced to prune redundant convolutional layers, and the optimal pruning ratio was determined via gradient comparison to achieve lightweight performance with negligible accuracy loss. [Results and Discussions] Experiments were conducted on the RTX3070 platform, and the results showed that the precision, recall and mean average precision (mAP@0.5) of Tomato-YOLO reached 92.1%, 92.0% and 95.0% respectively, 6.9, 11.6 and 6.8 percentage points higher than those of the original YOLOv10s, with significant performance improvements for both defect and ripeness categories. Compared with mainstream models including Faster R-CNN, SSD, YOLOv5s/v8s/v11s/v12s, Tomato-YOLO achieved significantly higher detection accuracy, while its model size and inference speed were comparable to those of native YOLOv10s, striking a balance between accuracy and efficiency. Ablation experiments verified the independent effects and synergistic gains of the four improvements, and pruning experiments identified 15% as the optimal pruning ratio. At this ratio, the model weight was compressed to 15.1 MB, computational load reduced to 27.9 GFLOPs, and accuracy decreased by only 1.2 percentage points, achieving nearly lossless lightweighting. When the pruned model was deployed on the Jetson Nano edge platform, the inference speed reached 30.4 f/s, and the overall mAP@0.5 remained at 93.7%, far exceeding the ≥20 f/s real-time detection threshold for agricultural scenarios, meeting the continuous operation requirements of harvesting equipment. [Conclusions] The Tomato-YOLO proposed in this study effectively addresses the core limitations of existing tomato detection models, achieving a balance of high accuracy and real-time performance for fine-grained ripeness grading and integrated appearance defect identification. It can provide reliable technical support for intelligent harvesting and refined sorting in the tomato industry.

Key words: tomato maturity detection, appearance defect identification, YOLOv10s, scale-aware context module, multi-scale feature fusion, model pruning

中图分类号: