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.