辽宁石油化工大学学报 ›› 2024, Vol. 44 ›› Issue (3): 80-88.DOI: 10.12422/j.issn.1672-6952.2024.03.011

• 信息与控制工程 • 上一篇    下一篇

基于Swin Transformer和YOLOv5的无纺布瑕疵检测

刘佳玮1(), 曹江涛1(), 姬晓飞2   

  1. 1.辽宁石油化工大学 信息与控制工程学院, 辽宁 抚顺 113001
    2.沈阳航空航天大学 自动化学院, 辽宁 沈阳 110136
  • 收稿日期:2023-05-15 修回日期:2023-06-20 出版日期:2024-06-25 发布日期:2024-06-17
  • 通讯作者: 曹江涛
  • 作者简介:刘佳玮(1994-),男,硕士研究生,从事图像处理和模式识别方面的研究;E-mail:591926313@qq.com
  • 基金资助:
    辽宁省教育厅重点公关项目(LJKZZ20220033)

Non-Woven Fabric Defect Detection Based on the Combination of Swin Transformer and YOLOv5

Jiawei LIU1(), Jiangtao CAO1(), Xiaofei JI2   

  1. 1.School of Information and Control Engineering,Liaoning Petrochemical University,Fushun Liaoning 113001,China
    2.School of Automation,Shenyang Aerospace University,Shenyang Liaoning 110136,China
  • Received:2023-05-15 Revised:2023-06-20 Published:2024-06-25 Online:2024-06-17
  • Contact: Jiangtao CAO

摘要:

对无纺布进行瑕疵检测,可以帮助企业提升生产效率,节约成本,但是基于CNN的目标检测算法受限于卷积核的局部特性,缺乏对图像的全局建模,对尺度变化范围大的瑕疵检出效果不理想。因此,提出了基于Swin Transformer和YOLOv5的无纺布瑕疵检测方法,并引入了CBAM注意力机制,同时微调了预测目标框的anchor尺寸;在自制数据集上对所提方法的有效性进行了验证。结果表明,通过其强大的自我注意力对特征进行编码、解码,网络可以获得更大的感受野,充分联系上下文关系;Swin的基于特征金字塔的分层构建结构与YOLOv5的neck设计十分相似,可以帮助网络在多尺度特征图上对目标进行预测;网络对重要信息的关注度得到了提高;通过Mosaic和MixUp数据增强丰富了数据分布;模型的鲁棒性和对无纺布的检测性能得到提高,回归预测结果更精准。

关键词: Swin Transformer模型, 自我注意力, CBAM注意力机制, 数据增强, anchor尺寸

Abstract:

The defect detection of non-woven fabrics can help enterprises improve production efficiency and save costs. Due to the local characteristics of the convolution kernel, the object detection algorithms based on CNN lack the global modeling of the image, and the detection effect is not ideal for defect detection with a large range of scale changes. Therefore, a non-woven fabric defect detection method is proposed based on the combination of Swin Transformer and YOLOv5, which encodes and decodes features through its powerful self-attention. The network can obtain a larger receptive field and fully relate to the context. The layered construction based on the feature pyramid of Swin coincides with the design of the neck of YOLOv5. It can help the network predict the target on the multi-scale feature map. On this basis, CBAM attention mechanism is introduced to help the network focus on important information. Through Mosaic and MixUp data augmentation, the data distribution is enriched and the robustness is increased. Finally, the anchor size of the prediction target frame is fine-tuned to make the regression prediction more accurate. The effectiveness of the proposed method is verified on the self-made data set, and the detection performance of non-woven fabrics is improved.

Key words: Swin Transformer model, Self-attention, CBAM attention mechanism, Data augmentation, anchor dimension

中图分类号: 

引用本文

刘佳玮, 曹江涛, 姬晓飞. 基于Swin Transformer和YOLOv5的无纺布瑕疵检测[J]. 辽宁石油化工大学学报, 2024, 44(3): 80-88.

Jiawei LIU, Jiangtao CAO, Xiaofei JI. Non-Woven Fabric Defect Detection Based on the Combination of Swin Transformer and YOLOv5[J]. Journal of Liaoning Petrochemical University, 2024, 44(3): 80-88.

使用本文

0
    /   /   推荐

导出引用管理器 EndNote|Ris|BibTeX

链接本文: https://journal.lnpu.edu.cn/CN/10.12422/j.issn.1672-6952.2024.03.011

               https://journal.lnpu.edu.cn/CN/Y2024/V44/I3/80