# A Real-Time Fabric Defect Detection Method Based on Improved YOLOv8
## 2 Related Work  
Currently, deep learning-based methods are widely applied in industrial defect detection, including fabric defects [7], metal surface defects [8], PCB board defects [9], and so on. Target detection methods in deep learning are generally divided into two categories: single-stage and two-stage networks, with the latter including models such as R-CNN [10], Fast R-CNN [11], and Faster R-CNN [12], etc. By first generating candidate regions and then classifying and localizing defects, these models typically offer higher detection accuracy. The high computational complexity of such networks results in slow processing, making real-time performance challenging. Consequently, researchers have proposed various improvements for two-stage networks. [PERSON] et al. [13] improved fabric defect detection in complex backgrounds by incorporating a Gabor filter within Faster R-CNN and optimizing training with a genetic algorithm. However, this method relies on a two-stage training approach of the genetic algorithm, resulting in a long model training time, which makes it difficult to meet the high real-time demand. [PERSON] et al. [14] enhanced Cascade R-CNN by integrating an adaptive fusion attention module (AFAM), which improves defect detection for small- and medium-sized fabrics with minor defects by augmenting feature mapping and attentional information flow across spatial and channel dimensions.  
The single-stage network simplifies target detection by using a single structure for classification and localization, achieving higher speed and making it ideal for real-time scenarios. As a representative single-stage model, the YOLO series enhances detection speed and accuracy by optimizing network architecture and feature extraction. In recent years, YOLO-based methods have been increasingly applied to fabric defect detection. [PERSON] et al. [15] proposed an improved fabric defect detection algorithm based on YOLOv8, which improves the feature response to small targets by introducing the GS-Conv and Slim-neck feature fusion module, adds a P2 detection layer to enhance the detection of small defects,and adopts the EMA-Slide Loss function to improve the classification stability and model training effect, which outperforms the original YOLOv8n model in terms of both mAP and detection speed. [PERSON] et al. [6] introduced PEI-YOLOv5 for fabric defect detection, which improves the efficiency of spatial feature extraction by introducing particle depth convolution, enhances the BiFPN module to improve the multi-scale feature fusion effect, and improves the loss function by adopting IN loss function to improve the detection accuracy for small targets while accelerating model convergence. [PERSON] et al. [16] developed an anchorless YOLOv8 network using DsPAN, which boosts the detection of small defects in multi-scale environments by leveraging the lightweight PAN and LCBHAM modules while preserving local details and location information during deep feature extraction. [PERSON] et al. [17] developed a lightweight multi-type defect detection approach using DCP-YOLOv8, improving accuracy through deformable convolution and feature fusion while optimizing efficiency for real-time performance. [PERSON] et al. [18] introduced the ABG-YOLOv8n model, an improved version of YOLOv8n, which boosts detection performance with a lightweight network, bi-directional feature pyramid, and AFF mechanism, resulting in a 4.5% increase in mAP to meet the real-time monitoring needs of smart grids.