# Fabric Defect Detection Method Using SA-Pix2 pix Network and Transfer Learning
## 3 Results
### Comparison of Experimental Results for Different Defect Detection Methods  
Under the same testing conditions, comparative experiments were conducted between the ReNet-D [21] method, the SDDM-PS [48] method, and the SA-Pix2 pix model. Initially, these three methods were employed to reconstruct defect images, followed by pixel-wise dissimilarity calculations between the reconstructed and defect images. Finally, the dissimilarity results underwent image segmentation, as illustrated in Figures 9-13. Figure 8: Comparison of detection results of different loss functions. (**a**) Image of the original defect; (**b**) detection results of CGAN loss; (**c**) detection results of original SSIM loss; (**d**) detection results of L1 loss; (**e**) detection results of SSIM loss; (**f**) L1 + SSIM loss detection results. Figure 9: Comparison of experimental results of oil defects by each method. (**a**) Defect sample; (**b**) detection result of ReNet-D; (**c**) detection result of SDDM-PS; (**d**) detection result of SA-Pix2 pix. In Figure 8, which displays the experimental results for oil stain defects using the three methods, the second column reveals the ReNet-D method's significantly poor detection accuracy for oil stain defects. In the third column, it can be observed that the SDDM-PS method provides incomplete detection of oil stain defect regions, and in some cases, it fails to detect the defect in sample 4. However, the fourth column demonstrates that the method recommended in this paper effectively detects oil stain defects. Figure 10 displays the experimental results for various methods of detecting foreign object defects. In the second column, it is evident that the ReNet-D method exhibits notably poor accuracy in detecting scratch defects. In the third column, the SDDM-PS method yields results with a substantial amount of noise points and even misinterprets the image texture background as defects, failing to effectively detect scratch defects. However, in the fourth column, our proposed approach demonstrates effective scratch defect detection. Nevertheless, for sample 4, the detection results exhibit a tendency for smaller detection areas. Figure 11 displays the experimental results for foreign object defects using various methods. From the second column, it is evident that the ReNet-D method exhibits significantly poor detection accuracy for foreign object defects. The third column reveals that the SDDM-PS method can detect most of the defect areas but performs poorly in the detection of defects in samples 1, 4, and 5. However, in the fourth column, the method recommended in this paper effectively detects foreign object defects, with only minor undetected areas in sample 1. Figure 10: Comparison of experimental results of bruise defects by each method. (**a**) Defect sample; (**b**) detection result of ReNet-D; (**c**) detection result of SDDM-PS; (**d**) detection result of SA-Pix2 pix. Figure 12 depicts the experimental results for pinhole defects using various methods. From the second column, it is evident that the ReNet-D method exhibits significantly poor detection accuracy for pinhole defects. The third column reveals that the SDDM-PS method detects pinhole defect areas but with some noise and incomplete detection areas. In the fourth column, the method recommended in this paper effectively detects pinhole defects. Figure 13 illustrates the experimental results for missing warp defects using various methods. From the second column, it is evident that the ReNet-D method exhibits significantly poor detection accuracy for the missing warp defects. The third column reveals that the SDDM-PS method fails to detect the missing warp defects completely. For samples 3, 4, and 5, it only detects a small portion of the defects, and for sample 1, it does not detect any defects. Sample 2 also experiences a few cases of false detection.