基于改进Yolo v5的花色布匹瑕疵检测方法
2023,31(4):56-62
摘要:花色布匹的瑕疵检测是纺织工业中必不可少的环节,实现快速、准确的花色布匹瑕疵检测对于提高生产效率具有重要意义;针对花色布匹瑕疵检测中大部分瑕疵目标较小、种类分布不均、部分瑕疵长宽比较为极端以及瑕疵与背景易混淆的检测难点,提出了一种基于YOLOv5网络改进的算法模型DD-YOLOv5;在骨干网络中采用上下文变换器网络(CoTNet,Contextual Transformer Networks),增强视觉表示能力;在颈部网络中引入卷积注意力模块 (CBAM,Convolutional Block Attention Module),使网络学会关注重点信息;在检测环节增加了一个高分辨率的检测头,加强对小目标的检测;并且使用α-IoU代替原网络中G-IoU方法;经实验证明,改进后的算法在花色布匹瑕疵数据集平均精度均值上 (mAP,mean Average Precision)达到了较原生算法相比提升了8.1%,检测速度也达到了73.6Hz。
关键词:瑕疵检测;深度学习;CoTNet;注意力机制;交并比
An improved Fabric defect detection method based on Yolov5
Abstract:The defect detection of cloth of suit color is an indispensable link in the textile industry. It is of great significance to realize the rapid and accurate defect detection of cloth of suit color to improve the production efficiency. In order to solve the detection difficulties in the detection of patterned cloth defects, such as most defect targets are small, the distribution of types is uneven, the comparison of length and width of some defects is extreme, and the defects are easily confused with background, an improved algorithm model DD-YOLOv5 based on YOLOv5 network was proposed. Contextual Transformer Networks (CoTNet, Contextual Transformer Networks) are used within the backbone to enhance visual presentation capabilities; By introducing CBAM (Convolutional Block Attention Module) into the neck network, the network learns to focus on the key information. A high resolution detection head is added in the detection link to strengthen the detection of small targets. In addition, α-IoU is used to replace the original G-IoU method. The experimental results show that the mAP (mean Average Precision) of the improved algorithm is 8.1% higher than that of the original algorithm, and the detection speed also reaches 73.6Hz.
Key words:Defects Detection;Deep Learning;CoTNet;Attention mechanism;IoU
收稿日期:2022-11-05
基金项目:国家自然科学基金青年项目(NO.6170185)项目资助
