# Research on Seamless Fabric Defect Detection Based on Improved YOLOv8n
## 2 YOLOv8 Algorithm  
YOLOv8 is the eighth-generation version of the YOLO (You Only Look Once) series, focusing on object detection, image segmentation, and classification tasks. It continues the fast, accurate, and lightweight features of the YOLO series while making significant improvements in model architecture, performance optimization, and inference speed, making it suitable for resource-constrained devices and real-time detection scenarios [20]. The  
\begin{table}
\begin{tabular}{c c c} \hline
**Author** & **Methods** & **Shortcomings** \\ \hline [PERSON] et al. [9] & Fabric texture classification and defect detection method based on LSTM. & It requires a large amount of data for training and has poor adaptability to small sample data. \\ \hline [PERSON] et al. [10] & Improved MobileNetV2 SSDLite system based on cloud–edge computing for fabric defect detection. & Applications that require high real-time performance are limited and require significant computing resources. \\ \hline [PERSON] et al. [11] & The FN Net method of lightweight CNN is used for fabric defect detection. & Insufficient adaptability to complex backgrounds or occlusion situations \\ \hline [PERSON] [4] & Fabric defect detection method based on integral image. & The computational cost is high, making it difficult to handle large-scale data. \\ \hline [PERSON] et al. [12] & Dual sparse low-rank decomposition method for defect detection of irregular printed fabrics. & Poor adaptability to situations with high background complexity may lead to missed detections. \\ \hline [PERSON] et al. [13] & Combining Gabor filters, genetic algorithms, and Faster R-CNN to improve detection accuracy. & The detection of subtle defects may not be accurate enough, and the calculation speed may be slow. \\ \hline [PERSON] et al. [14] & Proposed weakly supervised shallow network to reduce dependence on annotated data. & There are deficiencies in generalization ability and real-time performance. \\ \hline [PERSON] et al. [15] & Propose a fabric defect detection method based on Mobile-UNet to solve the real-time and data imbalance problems in deep learning applications. & Depending on the network architecture design, it may not be possible to flexibly adapt to different types of fabrics or complex defect features. \\ \hline [PERSON] et al. [16] & A self-adaptive fabric defect detection method based on the DenseNet-SSD algorithm is proposed. & DenseNet as a backbone network may result in a relatively slow model speed. \\ \hline \end{tabular}
\end{table}
Table 1: _Cont._structure of the model includes four key parts: image input module (Input), backbone network module (Backbone), neck network (Neck), and head network (Head). The backbone network refers to the design concept of YOLOv7 ELAN, replacing the C3 structure of YOLOv5 with a C2f structure with richer gradient flow and adjusting the number of channels for different scale models. On the other hand, the neck network (Neck) is composed of a FPN and a PAN. The detection Head has two major improvements compared to YOLOv5: firstly, a Decoupled Head structure is used to separate classification and regression tasks. Secondly, the transition to the Anchor Free mechanism simplifies the structure. The loss function has also been significantly optimized, abandoning the traditional IOU matching and one-sided proportional allocation methods, adopting the Task Signed Assign positive and negative sample matching method, and introducing Distribution Focal Loss (DFL), further improving the precision and efficiency of detection [21]. The YOLOv8n structure diagram is shown in Figure 1.