English

中国农机化学报

中国农机化学报 ›› 2024, Vol. 45 ›› Issue (4): 100-107.DOI: 10.13733/j.jcam.issn.2095-5553.2024.04.015

• 农产品加工工程 • 上一篇    下一篇

基于改进YOLOv5算法的瓜蒌分级方法

霍正瑞1,孙铁波2   

  • 出版日期:2024-04-15 发布日期:2024-04-28
  • 基金资助:
    江苏省高等学校基础科学(自然科学)研究重大项目(23KJA520005)

A method for grading Trichosanthes based on improved YOLOv5 algorithm

Huo Zhengrui1, Sun Tiebo2   

  • Online:2024-04-15 Published:2024-04-28

摘要: 为解决瓜蒌检测技术存在的检测精度低且检测时间长的问题,提出一种基于改进YOLOv5算法的瓜蒌分级方法YOLOv5GCB。在主干网络引入Ghost卷积模块替换传统卷积,在保证准确率的同时减少模型的参数量;在特征提取网络和推理层之间添加CA注意力模块,增强模型对空间和通道信息的关注,提高检测精度;在颈部网络中引入双向加权特征金字塔网络(Bidirectional Feature Pyramid Network,BiFPN)替换原始结构,融合不同尺度特征提升多尺度目标的表达能力。结果表明:与原有的YOLOv5模型相比,改进的YOLOv5GCB算法对瓜蒌等级的检测准确率提高4%,达到95.3%,检测速度达到31.5 fps。该研究提出的算法在保证瓜蒌分级检测准确率的同时拥有更高的识别速度,为实际场景中的瓜蒌分级提供理论研究和技术支持。

关键词: 瓜蒌分级, 目标检测, 多尺度特征融合, CA注意力机制

Abstract: In order to solve the problems of low detection accuracy and long detection time of trichosanthes detection technology, a method of grading trichosanthes, YOLOv5GCB, based on improved YOLOv5 algorithm, is proposed. Firstly, the Ghost convolution module is introduced in the backbone network to replace the traditional convolution, which reduces the number of parameters of the model while guaranteeing the accuracy. Then, the CA attention is added between the feature extraction network and the inference layer module is added between the feature extraction network and the inference layer to enhance the models attention to spatial and channel information and improve the detection accuracy.  Finally, a Bidirectional Feature Pyramid Network (BiFPN) is introduced into the neck network to replace the original structure, and the fusion of different scale features improves the expression ability of multiscale targets. The results show that compared with the original YOLOv5 model, the improved YOLOv5GCB algorithm increases the detection accuracy of trichosanthes grades by 4% to 95.3%, and the detection speed reaches 31.5 fps. The algorithm proposed in this study guarantees the accuracy of trichosanthes grades detection with higher recognition speed, which provides theoretical research and technical support for trichosanthes grades grading in real scenarios.

Key words: target detection, trichosanthes classification, multiscale feature fusion, CA attention mechanism

中图分类号: