论文详情
基于Swin Transformer和YOLOv5的无纺布瑕疵检测
辽宁石油化工大学学报
2024年 44卷 第No.3期
阅读:76
查看详情
Title
Non⁃Woven Fabric Defect Detection Based on the Combination of Swin Transformer and YOLOv5
Authors
Jiawei LIU
Jiangtao CAO
Xiaofei JI
单位
辽宁石油化工大学 信息与控制工程学院, 辽宁 抚顺 113001
沈阳航空航天大学 自动化学院, 辽宁 沈阳 110136
Organization
School of Information and Control Engineering,Liaoning Petrochemical University,Fushun Liaoning 113001,China
School of Automation,Shenyang Aerospace University,Shenyang Liaoning 110136,China
摘要
对无纺布进行瑕疵检测,可以帮助企业提升生产效率,节约成本,但是基于CNN的目标检测算法受限于卷积核的局部特性,缺乏对图像的全局建模,对尺度变化范围大的瑕疵检出效果不理想。因此,提出了基于Swin Transformer和YOLOv5的无纺布瑕疵检测方法,并引入了CBAM注意力机制,同时微调了预测目标框的anchor尺寸;在自制数据集上对所提方法的有效性进行了验证。结果表明,通过其强大的自我注意力对特征进行编码、解码,网络可以获得更大的感受野,充分联系上下文关系;Swin的基于特征金字塔的分层构建结构与YOLOv5的neck设计十分相似,可以帮助网络在多尺度特征图上对目标进行预测;网络对重要信息的关注度得到了提高;通过Mosaic和MixUp数据增强丰富了数据分布;模型的鲁棒性和对无纺布的检测性能得到提高,回归预测结果更精准。
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.
关键词:
Swin Transformer模型;
自我注意力;
CBAM注意力机制;
数据增强;
anchor尺寸;
Keywords:
Swin Transformer model;
Self?attention;
CBAM attention mechanism;
Data augmentation;
anchor dimension;
基金项目
辽宁省教育厅重点公关项目(LJKZZ20220033)
DOI
10.12422/j.issn.1672-6952.2024.03.011