Journal of Henan Agricultural Sciences ›› 2024, Vol. 53 ›› Issue (9): 150-158.DOI: 10.15933/j.cnki.1004-3268.2024.09.016

• Agricultural Information and Engineering and Agricultural Product Processing • Previous Articles     Next Articles

Lightweight Grape Object Detection Fusion Algorithm Based on Improved YOLOv5s

HU Junfeng1,LI Songqing1,HUANG Xiaowen1,2,LIU Dayang1,LI Baicong1,2   

  1. (1.College of Computer and Control Engineering,Northeast Forestry University,Harbin 150040,China;2.BYD Company Limited,Shenzhen 518000,China)
  • Received:2023-11-20 Published:2024-09-15 Online:2024-11-04

基于改进YOLOv5s 的轻量级葡萄目标检测融合算法

胡峻峰1,李松青1,黄晓文1,2,刘大洋1,李柏聪1,2   

  1. (1.东北林业大学 计算机与控制工程学院,黑龙江 哈尔滨 150040;2.比亚迪股份有限公司,广东 深圳 518000)
  • 通讯作者: 黄晓文(1995-),男,山东潍坊人,硕士,主要从事模式识别研究。E-mail:nefu_hxw@126.com
  • 作者简介:胡峻峰(1980-),男,黑龙江哈尔滨人,副教授,博士,主要从事模式识别研究。E-mail:nefuhjf@126.com
  • 基金资助:
    国家自然科学基金项目(32202147);中央高校基本科研专项资金项目(2572019BF09)

Abstract: A lightweight grape target detection network YM‑GDM(YOLOv5s‑MobileNetV3 grape detection model) was proposed to meet the requirements of accuracy,real‑time performance,and lightweight of target detection models for agricultural automatic harvesting machinery.MobileNetV3 was employed as the backbone network instead of CSPDarknet53 in YOLOv5s to achieve model lightweighting.The introduction of Res2Net_C2f module and BiFPN(Bi‑directional feature pyramid network)structure aimed to enhance the model’s multi‑scale feature fusion capability.Additionally,the VariFocalLoss loss function was adopted to train the model,mitigating the impact of imbalanced positive and negative samples.The self‑made data set containing five types of table grapes and the open data set(WGISD)containing five types of wine grapes were used as test data sets.The experimental results showed that the YM‑GDM network achieved a mAP50 of 90. 8% for the detection of 10 grape classes.Compared to YOLOv3‑tiny,and YOLOv5s,it improved by 6.2,and 2.2 percentage points respectively.The model size was 9.73 MB,which was reduced by 44.4% and 32.8% compared to YOLOv3‑tiny and YOLOv5s,respectively.Furthermore,by further reducing the number of parameters,a lightweight specialized model,YM‑GDM‑tiny,was obtained with a model size of 4.73 MB and a mAP50 of 86.8%,suitable for deployment on mobile devices with lower computing power.

Key words: Grape, Object detection, YOLOv5s, Lghtweight network, Feature fusion

摘要: 针对农业自动采摘机械对目标检测模型准确率、实时性及轻量化的需求,提出了一种轻量级葡萄目标检测网络YM-GDM(YOLOv5s-MobileNetV3 grape detection model)。使用MobileNetV3 代替CSPDarknet53 作为YOLOv5s 的主干网络,以实现模型的轻量化;引入Res2Net_C2f 模块和BiFPN(Bi‑directional feature pyramid network)结构,以提高模型的多尺度特征融合能力;同时,改用VariFocalLoss损失函数对模型进行训练,以减少正负样本不均带来的影响。使用包含5类食用葡萄的自制数据集与包含5类酿酒葡萄的公开数据集(WGISD)作为试验数据集进行测试。结果表明,YMGDM网络对10个品种葡萄的目标检测平均精度均值(mAP50)达到90.8%,比YOLOv3-tiny、YOLOv5s分别提升6.2、2.2百分点;模型体积为9.72 MB,相比YOLOv3-tiny、YOLOv5s分别缩小44.4%、32.8%。此外,进一步减少参数量得到了轻量特化模型YM-GDM-tiny,模型体积缩小到4.73 MB,mAP50 达到86.8%,以部署于算力更低的移动设备。

关键词: 葡萄, 目标检测, YOLOv5s, 轻量化网络, 特征融合

CLC Number: