Abstract
Knitted sock defect detection is a critical step in ensuring sock quality. Due to the complex texture of knitted socks and the diverse forms of defects, traditional detection methods are inefficient and lack precision. While current deep-learning-based defect detection models show great potential, they still face challenges in detecting small defects in complex backgrounds and deploying them on resource-constrained devices. To address these challenges, this study proposes a lightweight knitted sock defect detection model called Sock-YOLO. First, RepViTBlock is introduced into the backbone network to construct the reparameterization-based feature extraction module C3k2-RVB, which enhances feature extraction capabilities and eliminates the computational overhead caused by skip connections. Second, a CA-HSFPN module is designed in the Neck section, which utilizes HSFPN to dynamically filter features and suppress background noise, while integrating coordinate attention to improve the localization accuracy of small-sized defects. Next, the lightweight and efficient detection head (LEDH) replaces the original detection head, utilizing a depth-separable convolution structure to reduce computational complexity. In addition, the MPDIoU loss function is introduced to improve the regression accuracy of bounding boxes. Finally, the LAMP channel pruning strategy is adopted to alleviate the deployment pressure on edge devices. Experimental results show that compared to YOLOv11n, the pruned Sock-YOLO reduces the number of parameters and computational complexity by 72% and 47%, respectively, to 700,000 and 3.3 GFLOPS, while improving mAP50 by 3.4% to 89.8%. The model weights were reduced by 65%, with a size of only 1.8 MB, and the inference speed reached 134.8 FPS. The research results indicate that the proposed method effectively improves the accuracy of knit sock defect detection while balancing detection accuracy and deployment costs, providing a reliable solution for knit sock defect detection tasks in industrial scenarios.
Get full access to this article
View all access options for this article.
