English

Journal of Chinese Agricultural Mechanization

Journal of Chinese Agricultural Mechanization ›› 2025, Vol. 46 ›› Issue (5): 79-85.DOI: 10.13733/j.jcam.issn.2095-5553.2025.05.011

• Research on Agricultural Intelligence • Previous Articles     Next Articles

Research on tomato maturity recognition technology based on improved YOLOv5s 

Liu Kun1,  2, Ji Hongya1, Huang Chengfei1, Wang Xiao1, Zhu Yifan1   

  1. 1. School of Automation Nanjing Institute of Technology, Nanjing, 211167, China;
    2. Jiangsu Provincial Key Laboratory of Advanced CNC Technology, Nanjing, 211167, China
  • Online:2025-05-15 Published:2025-05-14

基于改进YOLOv5s的番茄成熟度识别技术研究

刘坤1,  2,吉宏亚1,黄程菲1,王晓1,朱一帆1   

  1. 1. 南京工程学院自动化学院,南京市,211167; 2. 江苏省先进数控技术重点实验室,南京市,211167
  • 基金资助:
    江苏省高等学校基础科学(自然科学)研究重大项目(23KJA460008)

Abstract: Efficient automatic tomato harvesting requires accurately identifying the ripeness of tomatoes, making it a critical prerequisite for successful deployment. However, existing tomato ripeness detection algorithms often rely on highperformance hardware, which limits their effective application in mobile tomato harvesting robots. To address this challenge, this study proposed a lightweight tomato ripeness detection method based on an improved YOLOv5s. First, the original YOLOv5s backbone feature extraction network was replaced with ShuffleNetV2 network, while traditional convolutions in the feature fusion network were replaced with Ghost convolutions. These modifications significantly reduced computational complexity and model weight size. Second, to enhance ripeness detection performance, the lightweight Coordinate Attention (CA) mechanism was integrated into feature extraction, enabling the model to better capture horizontal and vertical spatial information related to tomato ripeness. Experimental results indicated that the improved model reduced memory usage by half compared to the original YOLOv5s model while improving precision, recall, and mean average precision (mAP) by 0.3%, 0.1% and 0.2%, respectively. Finally, the optimized model was successfully deployed on a Raspberry Pi 4B, ensuring efficient inference while maintaining high accuracy. These findings demonstrate the effectiveness of the proposed algorithm for lightweight, realtime tomato ripeness detection, making it wellsuited for integration into mobile harvesting robots.

Key words: tomato maturity, YOLOv5s, Ghost convolution, CA attention mechanism, raspberry Pi 4B

摘要: 在实现番茄自动高效采摘的过程中,精确识别番茄的成熟度至关重要。针对目前番茄成熟度识别算法皆依赖高性能硬件设备,限制实际番茄采摘机器人移动端的有效部署,提出一种基于改进YOLOv5s的轻量化番茄成熟度识别方法。首先,将YOLOv5s初始的骨干特征提取网络替换为ShuffleNetV2网络,将特征融合网络中的传统卷积替换为Ghost卷积,减少模型的参数计算量,同时降低模型权重的大小。接着,为提高模型对番茄成熟度的识别效果,在特征提取中引入轻量级注意力机制CA来捕捉番茄成熟度的横向与纵向信息。测试结果显示,改进后的模型内存为原始模型的1/2,且相比原始YOLOv5s模型,算法模型的精确率、召回率和平均精度均值分别提高0.3%、0.1%、0.2%。最后,将模型移植到树莓派4B中,保证番茄成熟度识别准确率前提下,优化模型推理过程,证明改进算法对番茄成熟度识别任务的有效性。

关键词: 番茄成熟度, YOLOv5s, Ghost卷积, CA注意力机制, 树莓派4B

CLC Number: