Journal of Computer Applications ›› 2024, Vol. 44 ›› Issue (7): 2271-2278.DOI: 10.11772/j.issn.1001-9081.2023070969

• Multimedia computing and computer simulation • Previous Articles     Next Articles

Lightweight algorithm for impurity detection in raw cotton based on improved YOLOv7

Yongjin ZHANG, Jian XU(), Mingxing ZHANG   

  1. School of Electronics and Information,Xi’an Polytechnic University,Xi’an Shaanxi 710048,China
  • Received:2023-07-19 Revised:2023-09-22 Accepted:2023-09-22 Online:2023-10-26 Published:2024-07-10
  • Contact: Jian XU
  • About author:ZHANG Yongjin, born in 1998, M. S. candidate. His research interests include artificial intelligence, deep learning.
    XU Jian, born in 1969, M. S., professor. His research interests include artificial intelligence, automation.
    ZHANG Mingxing, born in 1999, M. S. candidate. His research interests include artificial intelligence, 3D point cloud.
  • Supported by:
    Shaanxi Provincial Department of Science and Technology(2018GY-173);Xi’an Science and Technology Bureau(GXYD7.5)

面向轻量化的改进YOLOv7棉杂检测算法

张勇进, 徐健(), 张明星   

  1. 西安工程大学 电子信息学院,西安 710048
  • 通讯作者: 徐健
  • 作者简介:张勇进(1998—),男,陕西西安人,硕士研究生,主要研究方向:人工智能、深度学习;
    徐健(1969—),男,陕西西安人,教授,硕士,主要研究方向:人工智能、自动化;
    张明星(1999—),男,陕西西安人,硕士研究生,主要研究方向:人工智能、三维点云。
  • 基金资助:
    陕西省科技厅项目(2018GY-173);西安市科技局项目(GXYD7.5)

Abstract:

Addressing the challenges posed by high throughput of raw cotton and long impurity inspection duration in cotton mills, an improved YOLOv7 model incorporating lightweight modifications was proposed for impurity detection in raw cotton. Initially, redundant convolutional layers within YOLOv7 model were pruned, thereby increasing detection speed. Following this, FasterNet convolutional layer was integrated into the primary network to mitigate model computational load, diminish redundancy in feature maps, and consequently realized real-time detection. Ultimately, CSP-RepFPN (Cross Stage Partial networks with Replicated Feature Pyramid Network) was used within neck network to facilitate the reconstruction of feature pyramid, augment flow of feature information, minimize feature loss, and elevate the detection precision. Experimental results show that, the improved YOLOv7 model achieves a detection mean Average Precison of 96.0%, coupled with a 37.5% reduction in detection time on self-made raw cotton impurity dataset; and achieves a detection accuracy of 82.5% with a detection time of only 29.8 ms on publicly DWC (Drinking Waste Classification) dataset. This improved YOLOv7 model provides a lightweight approach for real-time detection, recognition and classification of impurities in raw cotton, yielding substantial time savings.

Key words: impurity detection in raw cotton, YOLOv7, Cross Stage Partial networks with Replicated Feature Pyramid Network (CSP-RepFPN), lightweight

摘要:

针对棉纺厂原棉吞吐量大、检测时间长而常见卷积神经网络无法实现高实时检测的问题,提出基于轻量化改进的YOLOv7模型对原棉杂质的检测算法,旨在快速高效地对棉杂质进行检测。首先通过删减YOLOv7模型冗余的卷积层从而提高检测速度;其次在主干网络内添加FasterNet卷积降低模型的计算负担,减少特征图的冗余性,实现高实时检测;最后在颈部网络内运用CSP-RepFPN(Cross Stage Partial networks with Replicated Feature Pyramid Network)重构特征金字塔,增加特征信息流通,减少特征损失,提高检测精度。实验结果表明:在自建棉杂数据集上改进的YOLOv7模型在棉杂检测精度上达到了96.0%,检测时间比YOLOv7减少了37.5%;在公开DWC(Drinking Waste Classification)数据集上整体精度达到82.5%,检测时间仅为29.8 ms。改进的YOLOv7模型能够为原棉杂质的实时检测和识别分类提供一种轻量化的检测方法,大幅节约了时间成本。

关键词: 棉杂检测, YOLOv7, CSP-RepFPN, 轻量化

CLC Number: