English

中国农机化学报

中国农机化学报 ›› 2024, Vol. 45 ›› Issue (11): 228-233.DOI: 10.13733/j.jcam.issn.2095‑5553.2024.11.035

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

基于YOLOv7-tiny的轻量级苹果实时检测算法

蒋兴宇,黄娟,顾寄南,范天浩,王化佳   

  1. 江苏大学机械工程学院,江苏镇江,212013
  • 出版日期:2024-11-15 发布日期:2024-10-31
  • 基金资助:
    江苏省重点研发计划重点项目(BE2021016—3)

Lightweight apple real time detection algorithm based on YOLOv7-tiny

Jiang Xingyu, Huang Juan, Gu Jinan, Fan Tianhao, Wang Huajia   

  1. College of Mechanical Engineering, Jiangsu University, Zhenjiang, 212013, China
  • Online:2024-11-15 Published:2024-10-31

摘要: 针对苹果生长所处的自然环境复杂程度高、网络模型过大、难以在移动端部署等问题,提出一种基于YOLOv7-tiny的轻量级苹果实时检测方法。该方法引入CG-Block模块代替原YOLOv7-tiny网络的部分卷积,对原网络的ELAN-tiny结构进行修改,极大地减少网络规模,并提高检测精度;使用Mish激活函数代替原激活函数,增强网络的提取特征能力;采用CARAFE轻量级上采样算子,进一步提升网络的特征融合能力。试验结果表明,改进后的算法与原算法相比,mAP@0.5提高1.9%,准确率提高4.1%,参数量降低45.4%,计算量降低46.2%,模型规模减少43.9%,FPS达到196.1 f/s。改进后的算法在保持良好实时性的同时,提升检测精度,极大地降低网络规模,为网络模型在移动端部署增添可行性。

关键词: 苹果, 轻量级, 实时检测, 激活函数, 上采样算子, 移动端部署

Abstract:  In response to the problems such as high complexity of the natural environment in which apples grow and too large network model which is  difficult to deploy on mobile devices, a lightweight real‑time apple detection method based on YOLOv7-tiny is proposed. This algorithm introduces the CG-Block module to replace the partial convolution of the original YOLOv7-tiny network, modifying the ELAN-tiny structure of the original network, greatly reducing the network size and improving detection accuracy. Using Mish activation function instead of the original activation function improves the features extraction ability of network. The use of CARAFE lightweight upsampling operator further enhances the feature fusion ability of the network.The experimental results show that compared with the original algorithm, the improved algorithm improves mAP@0.5 by 1.9%, accuracy by 4.1%, parameter count by 45.4%, computational complexity by 46.2%, model size by 43.9%, and FPS by 196.1 f/s. The improved algorithm not only maintains good real‑time performance, but also improves detection accuracy, greatly reduces network scale, and adds feasibility to the deployment of network models on mobile devices.

Key words: apple, lightweight, real time detection, activation function, upsampling operator, mobile deployment

中图分类号: