《计算机应用》唯一官方网站

• •    下一篇

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

张勇进1,徐健2,张明星2   

  1. 1. 西安工程大学
    2. 陕西省西安市西安工程大学
  • 收稿日期:2023-07-19 修回日期:2023-09-22 发布日期:2023-10-26 出版日期:2023-10-26
  • 通讯作者: 徐健

Lightweight detection of cotton based on improved YOLOv7

  • Received:2023-07-19 Revised:2023-09-22 Online:2023-10-26 Published:2023-10-26

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

Abstract: Addressing the challenges posed by substantial throughput of raw cotton and prolonged impurity inspection duration in cotton mills, a solution was introduced wherein the algorithmic enhancement of the YOLOv7 model, incorporating lightweight modifications, was employed for impurity detection in raw cotton. Initially, redundant convolutional layers within YOLOv7 model were pruned, thereby optimizing detection speed. Following this, integration of Faster-Net convolutional layer within primary network mitigates algorithmic computational load, diminishes redundancy in feature maps, and consequently expedites detection process, enabling real-time capabilities. Ultimately, application of CSP-RepFPN (Cross Stage Partial Rep Feature Pyramid Networks) within secondary network facilitates reconstruction of feature pyramid, augmenting flow of feature information, minimizing feature loss, and elevating detection precision. Empirical results underscore enhanced YOLOv7 model's achievement of an aggregate detection accuracy of 96%, coupled with a 37.5% reduction in detection time. Accuracy of 82.5% on publicly DWC (Drinking Waste Classification) dataset with a detection time of only 29.8ms This refined YOLOv7 model presents a streamlined approach for impurity detection, yielding substantial time savings, and thus presents a viable avenue for discernment and classification of impurities in raw cotton.

中图分类号: