English

中国农机化学报

中国农机化学报 ›› 2025, Vol. 46 ›› Issue (3): 253-260.DOI: 10.13733/j.jcam.issn.2095-5553.2025.03.037

• 农业智能化研究 • 上一篇    下一篇

基于迁移学习与轻量化YOLOv5s的草莓目标检测方法

郭敬涛1,吕凤1,章慧婷1,杨彪2,刘大洋1   

  1. (1. 东北林业大学计算机与控制工程学院,哈尔滨市,150040;2. 商洛学院电子信息与电气工程学院,陕西商洛,726000)
  • 出版日期:2025-03-15 发布日期:2025-03-13
  • 基金资助:
    国家自然科学基金(32202147);中国博士后基金面上项目(2021M690573);中央高校基本科研业务费专项资金(2572020BF05);陕西省科学技术协会青年人才托举计划项目(20220124)

Strawberry target detection method based on transfer learning and lightweight YOLOv5s 

Guo Jingtao1, Lü Feng1, Zhang Huiting1, Yang Biao2, Liu Dayang1   

  1. (1. College of Computer and Control Engineering, Northeast Forestry University, Harbin, 150040, China;
    2. Electronic Information and Electrical Engineering College, Shangluo University, Shangluo, 726000, China)
  • Online:2025-03-15 Published:2025-03-13

摘要:

为实现草莓采摘时精准检测,同时考虑到嵌入式设备内存小、计算能力低下,而当下目标检测模型参数量和计算量巨大的问题,提出一种基于YOLOv5s的轻量化网络模型。首先,对YOLOv5s进行轻量化处理,利用深度卷积(DWConv)替换普通卷积,同时用C3Ghost模块替换原网络模型中的C3模块,降低模型的复杂度。然后,为增强主干网络对特征信息的提取能力,加强输入特征图通道间的信息交互,在主干网络的C3模块中融合高效通道注意力(ECA)结构,在特征融合网络添加无参数注意力模块(SimAM),使网络聚焦更多的有效特征信息,达到不增加模型的参数量,同时又提升模型识别精度的目的。最后,结合迁移学习加快模型收敛速度并进一步提升模型检测精度。结果表明,轻量化后的网络模型体积减小55.8%,计算量减少55.1%,在自制草莓数据集上的平均精度均值mAP@0.75达到74.9%,比原模型提高3.1%,单张图片平均推理时间仅6.4 ms,能够实现在草莓采摘任务中的精准快速检测,为草莓生产智能化提供支持。

关键词: 草莓目标检测, 深度学习, 注意力机制, 轻量化模型, 迁移学习

Abstract:

To achieve the accurate detection of strawberry in agricultural harvesting, a lightweight network model based on YOLOv5s is proposed considering the limited memory and low computational power of embedded devices, as well as the huge parameters and computational demands of current target detection models. First, the YOLOv5s structure is lightweight processed by replacing ordinary convolutions with depthwise convolutions (DWConv) and substituting the C3 module in the original network with the C3Ghost module to reduce the model complexity. Second, to enhance the ability of the backbone network to extract feature information and improve the interaction between channels in the input feature maps, an efficient channel attention (ECA) structure is integrated into the C3 module of the backbone network. Additionally, a parameter-free attention module (SimAM) is added to the feature fusion network, so that the model can focus on more effective feature information without increasing the number of parameters of the model while improving the recognition accuracy. Finally, transfer learning is combined to accelerate the convergence speed of the model and further improve the detection accuracy. The results indicate that the lightweight model reduces network size by 55.8% and computation by 55.1%. The mAP@0.75 tested on a custom strawberry dataset reaches 74.9%, which is 3.1% higher than that of the original model. The average inference time per image is only 6.4 ms. This enables accurate and fast detection in strawberry picking tasks and provides support for the intelligent production of strawberries.

Key words: strawberry target detection, deep learning, attention mechanism, lightweight model, transfer learning

中图分类号: