Fabric Defect Detection with Fine-tuned YOLOv7

Authors:

Abstract
The defect on the fabric surface is one of the important factors affecting the quality of fabrics. Defect detection becomes the core means of quality control. Current deep-Iearning-based defect detection methods present a significant challenge in detection accuracy due to the diversity of fabric patterns and the scarcity of defect samples. Inspired by the transfer-learning paradigm, this article proposes a novel YOLOv7-based fine-tuning method for fabric defect detection. Specifically, we first employ a well-trained object detection network (i.e. YOLOv7) as a benchmark model to locate and classify defect-picking points. Considering the fabrics are mostly occluded and shaded, we therefore introduce a multi-channel attention mechanism and design the corresponding loss function. Finally, we manually clean a fabric defect dataset and use it to fine-tune the YOLOv7. Extensive experiments tested on public datasets show that our fine-tuned YOLOv7 improves mAP by 3.5%, precision by 6.3%, and recall rate by 5.7% compared to the baseline model YOLOv7. Especially, our fine-tuning method leads to a 6 MB reduction in model size. Further ablation studies demonstrate the effectiveness and contribution of our designs toward the whole network model.