A Novel Deep Learning Approach for Yarn Hairiness Characterization Using an Improved YOLOv5 Algorithm  
[PERSON]  
1 MERICs Research Center, University of Minho, Campus of Azurem, 4800-058 Guimaraes, Portugal; [EMAIL_ADDRESS]
2  
[PERSON]  
1 MERICs Research Center, University of Minho, Campus of Azurem, 4800-058 Guimaraes, Portugal; [EMAIL_ADDRESS]  
[PERSON]  
32 Aj, School of Technology, IPCA, 4750-810 Barcelos, Portugal; [EMAIL_ADDRESS]  
[PERSON]  
22C2T Research Centre, School of Engineering, University of Minho, 4800-058 Guimaraes, Portugal; [EMAIL_ADDRESS]  
Rosa Vasconcelos  
42C2 can be found in yarns, including protruding and loop fibers. The short fibers that protrude from the yarn surface, due to low-quality fibers or breakage during processing, are called protruding fibers. Loop fibers are loop-shaped structures that extend outward from the yarn surface, often caused by inadequate processing, such as improper fiber blending or carding. Both types significantly impact the fabric quality and processing. Protruding fibers are visible on the yarn surface, causing issues during textile processing, while loop fibers can create an uneven yarn appearance and may cause problems in the weaving or knitting process [3; 4; 5]. Given the importance of these defects, it is important to understand the challenges they introduce during production. Key problems caused by loops and protruding fibers [6; 7; 8; 9; 10; 11; 12; 13; 14] include difficulties in fabric processing (e.g., tangling or weaving failures), yarn wear and breakage, potential damage to machinery, interference with dyeing or printing, decreased strength and durability, and inconsistencies in quality, leading to an uneven and unappealing final product, as shown in Figure 2.  
To ensure yarn quality and minimize issues, it is essential to implement proper production practices, including quality control during manufacturing, the careful selection of raw materials, and the adoption of advanced processing technologies to reduce loops and protruding fibers [15]. Additionally, automatic inspection systems can help identify and remove defective yarns before they affect the final products. Although some commercial solutions, such as USTER TESTER 3 [16], can detect a few parameters related to yarn hairiness, there are currently no systems that utilize deep learning and image processing to fully characterize yarn hairiness [17; 18]. To address this gap, our research aims to develop a new methodology using artificial intelligence (AI) to characterize yarn hairiness. Coupled with a low-cost mechatronic  
Figure 1: Type of hairiness in yarn (loop fibers and protruding fibers) (cotton yarn with an average linear mass of 56.4 tex, with a magnification factor of 22\(\times\)). Figure 2: Problems in textile fabrics caused by yarn hairiness [13]. system, this methodology enables continuous yarn quality monitoring, precise defect detection, and seamless integration into industrial production lines [17; 18]. We have devised [19; 20] a system employing AI-driven algorithms for image acquisition, processing, and yarn analysis, offering the following key features:  
* The provision of statistical data on analyzed yarns, generating an analysis report. * Comprehensive yarn characterization in a production report with a user-friendly interface. * The complete characterization of defects, including hairiness, neps, and thin and thick places. * AI integration for the enhanced detection and automatic classification of yarn hairiness, improving accuracy and classification. To address these challenges, the deep learning YOLOv5s6 [21] detection algorithm was used to detect and characterize yarn hairiness. In recent years, deep learning has gained significant traction in various engineering domains [22; 23; 24; 25; 26; 27; 28; 29]. In target detection, it has introduced solutions like Fast RCNN, Faster RCNN, SSD, and the YOLO family of algorithms [30]. Initially proposed by [PERSON] et al.