基于Swin Transformer和归一化流的色织物表面缺陷检测OA
Defect detection of yarn-dyed fabric based on Swin Transformer and normalizing flow
针对传统深度学习方法在色织物缺陷检测中受限于缺陷样本稀缺、背景复杂和小目标缺陷难以识别的问题,提出一种基于Swin Transformer和归一化流的无监督色织物缺陷检测与定位方法.首先,在训练阶段,仅利用无缺陷色织物图像构建训练集,并采用Swin Transformer提取多尺度特征.接着,利用归一化流建立概率密度估计模型,对正常样本特征进行分布建模,使模型能够学习正常织物特征的潜在空间表示.在推理阶段,将待测色织物图像的特征投影到已学习的特征分布,并计算其异常分数.最后,通过异常分数实现色织物缺陷区域的检测和定位.实验结果表明,该方法能够有效学习正常色织物的特征分布,在复杂背景下准确检测和定位多种织物的缺陷.在YDFID-1数据集上,该方法实现了 98.4%的图像级AUROC和96.9%的像素级AUROC,显著优于现有无监督色织物缺陷检测方法.该方法无需缺陷样本和缺陷标注,仅依赖正常样本的特征分布即可进行缺陷判别,提高了检测的泛化能力和鲁棒性.
Traditional deep learning methods are limited by the scarcity of defect samples,complex background and difficult identification of small target defects in fabric defect detection.In response to the problems,an unsupervised fabric defect detection and location method based on Swin Trans-former and normalized flow was proposed.First,in the training stage,only defect-free fabric im-ages were used to construct the training set,and Swin Transformer was used to extract multi-scale features.Then,a probability density estimation model was established using the normalized flow to model the distribution of normal sample features,so that the model can learn the potential spatial representation of normal fabric features.In the inference stage,the features of the fabric image to be measured were projected onto the learned feature distribution and their anomaly scores were calculated.Finally,the defect area of fabric was detected and located by anomaly fraction diagram.The experimental results show that this method can effectively learn the feature distribution of nor-mal fabrics and accurately detect and locate various fabric defects under complex background.On the YDFI-1 data set,the proposed method achieves 98.4%image-level AUROC and 96.9%pixel-level AUROC,which is significantly better than the existing unsupervised fabric defect detection methods.This method does not need defect samples and defect labeling,and only relies on the fea-ture distribution of normal samples for defect identification,thus improving the generalization ability and robustness of detection.
张宏伟;张思怡;王海博
西安工程大学电子信息学院,陕西西安 710048西安工程大学电子信息学院,陕西西安 710048西安工程大学电子信息学院,陕西西安 710048
轻工纺织
织物缺陷检测色织物Swin Transformer无监督缺陷检测概率密度估计模型归一化流
fabric defect detectionyarn-dyed fabricSwin Transformerunsupervised defect detec-tionprobability density estimation modelingnormalizing flow
《纺织高校基础科学学报》 2025 (3)
39-47,9
国家自然科学基金青年项目(61803292)
评论