Abstract Fabric defect detection is crucial for ensuring product quality. However, the limited and diverse availability of defect samples for training presents a significant challenge. Manual annotation of defects is not only time‐consuming but often impractical. By contrast, while unlabelled normal data are more readily accessible, issues such as complex backgrounds, small targets and blurred fine features complicate detection. To address these challenges, we propose an unsupervised defect detection method that utilises only unlabelled normal data for training. The method incorporates the Normalisation‐based Attention Module attention mechanism to suppress minor texture variations and noise artefacts that naturally exist within normal fabric samples, achieving high detection accuracy and robust performance in noisy environments. Our approach leverages the strengths of the Swin Transformer, which efficiently captures global features through a local window multi‐head attention mechanism, and Normalising Flow, which generates anomaly scores by modelling probability distributions and effectively quantifying anomaly levels. We evaluate the proposed method on the publicly available MVTec‐AD and YDFID‐1 datasets, demonstrating superior performance in both defect detection and localisation tasks. On the MVTec‐AD dataset, our method outperforms existing approaches in most scenarios, exhibiting higher accuracy and enhanced noise robustness. On the YDFID‐1 dataset, we achieve an image‐level Area under the Receiver Operating Characteristic curve (AUROC) of 98.4% and a pixel‐level AUROC of 96.9%, significantly surpassing the performance of current unsupervised fabric defect detection methods, particularly in the detection and localisation of defects in colour‐patterned fabrics.
Wang et al. (Sun,) studied this question.