# A Fabric Defect Segmentation Model Based on Improved Swin-Unet with Gabor Filter
## 2 Related Work
### Learning-Based Approaches  
In summary, traditional machine vision methods have certain limitations regarding detection performance and model complexity. In recent years, automatic learnable detection has gained popularity for fabric defect detection, with learning-Based methods, particularly those utilizing CNN models, showing natural advantages in handling complex fabric images. [PERSON] et al. [22] proposed a fabric defect classification method based on improved AlexNet. They extracted defect features gradually, fusing edge details through multiple convolution operations to obtain essential image features. An improved YOLO fabric defects detection algorithm [23] was proposed. This method adds a new prediction layer to yolo_head to improve the effect of small defects detection and uses the CEIOU loss function to achieve accurate classification and location of defects. [PERSON] et al. [3] proposed a two-stage segmentation plus decision network suitable for few-sample scenarios. [PERSON] et al. [24] followed this two-stage network and improved the pixel accuracy under the premise of few-sample scene detection. Several researchers have combined traditional methods with deep learning models to overcome complex surface texture interference in defect detection. In [25], the authors embedded a Gabor filter into a Faster R-CNN network to eliminate the texture background and used a genetic algorithm to determine the optimal Gabor parameters. In the field of fabric defect detection, another common solution is to model the defect detection problem as a semantic segmentation model. Fully Convolutional Networks (FCN) [26] and UNet [27] are the most classical image segmentation networks, both utilizing full convolutional architecture for advanced feature extraction and fusion. FCN classifies images at the pixel level, achieving semantic-level image segmentation. UNet first introduced an encoder-decoder structure with skip connections to enhance feature fusion at different levels. [PERSON] et al. [28] proposed a novel self-attention gating module embedded into standard UNet to better pay attention to foreground pixels in segmentation tasks. [PERSON] et al. [29] introduced nested and dense skip connections into UNet to reduce the semantic gap between the feature maps of the encoder and decoder subnetworks. On the other hand, the first transformer-based model revolutionized Natural Language Processing(NLP) text translation tasks, achieving state of the art result. Recent works have attempted to apply the transformer-based model to vision tasks. Vision Transformer (ViT) [30] solves the computational complexity problem by dividing the image into blocks for self-attention calculations rather than between all pixels of the entire image. ViT's development has challenged the dominance of CNNs, as transformers focus on global relationships to capture more contextual information, unlike CNNs' limited local information capture ability. However, transformers are prone to overfitting in the early stages of training, especially on small datasets. In [31], the authors provided a powerful segmentation model named SEgmentation TRansformer (SETR) based on a pure transformer design. However, its self-attention computational complexity is quadratic with the image size, impacting efficiency. Swin Transformer has emerged as an answer to this problem, as it computes attention within local windows, resulting in linear computational complexity relative to input size. In addition, it can replace classic CNN architectures, serving as a universal backbone in computer vision. [PERSON] et al. [32] proposed UniFormer, which aims to organically unify convolution and self-attention in the style of transformer, giving full play to the advantages of both and simultaneously solving the two major problems of local redundancy and global dependency to achieve efficient feature learning. [PERSON] et al.