Abstract
Yarn-dyed Fabric have a wide variety of patterns. But in the production process, the defective yarn-dyed fabric is often a small amount, so the unsupervised defect detection method of yarn-dyed fabric is increasingly used. In this paper, we proposed an unsupervised defect detection network for yarn-dyed fabrics, which is called Masked Contrastive Generative Adversarial Network (MCGAN). MCGAN has two important parts: contrastive learning and NAM Mask Module. Contrastive learning can maximize the mutual information of features in the same position of input and output images and improve the training efficiency of the Convolutional Neural Networks (CNNs). However, both CNNs and contrastive learning lack the ability to model images globally and only focus on capturing local features. Therefore, Nam Mask Module is proposed. It combines masked convolution with Normalization-based Attention Module (NAM), which is a channel attention. Nam Mask Module reconstructs masked features through local features to allow the model to improve the ability to extract global features. Our proposed MCGAN model achieves excellent defect detection effect of yarn-dyed Fabrics on the public datasets YDFID and ZJU-Leaper.








Similar content being viewed by others
References
Zhang J, Jing J, Lu P, Song S (2022) Improved mobilenetv2-ssdlite for automatic fabric defect detection system based on cloud-edge computing. Measurement 201:111665. https://doi.org/10.1016/j.measurement.2022.111665
Zhao Y, Hao K, He H, Tang X, Wei B (2020) A visual long-short-term memory based integrated cnn model for fabric defect image classification. Neurocomputing 380:259–270. https://doi.org/10.1016/j.neucom.2019.10.067
Sheikhi F, Taghdiri A, Moradisabzevar D, Rezakhani H, Daneshkia H, Goodarzi M (2023) Automatic detection of covid-19 and pneumonia from chest x-ray images using texture features. J Supercomputing 79:21449–21473
Rasheed A, Zafar B, Rasheed A, Ali N, Mahmood MT (2020) Fabric defect detection using computer vision techniques: a comprehensive review. Mathematical Problems in Engineering 2020
Feng S, Qian H, Wang H (2023) A deep feature matching pipeline with triple search strategy. J Supercomputing 79:20878–20898
Yan F, Zhang G, Zhang D, Sun X, Hou B, Yu N (2023) Tl-cnn-ids: transfer learning-based intrusion detection system using convolutional neural network. J Supercomputing 79:17562–17584
Mei S, Yang H, Yin Z (2018) An unsupervised-learning-based approach for automated defect inspection on textured surfaces. IEEE Trans Instrum Measurement 67(6):1266–1277. https://doi.org/10.1109/TIM.2018.2795178
Zhang H, Zhang W, Wang Y, Lu S, Yao L, Chen X (2022) Colour-patterned fabric-defect detection using unsupervised and memorial defect-free features. Coloration Technol 138(6):602–620
Zhang H, Qiao G, Liu S, Lyu Y, Yao L, Ge Z (2023) Attention-based vector quantisation variational autoencoder for colour-patterned fabrics defect detection. Coloration Technol 139(3):223–238
Zhang H, Qiao G, Lu S, Yao L, Chen X (2023) Attention-based feature fusion generative adversarial network for yarn-dyed fabric defect detection. Text Res J 93(5–6):1178–1195
Zhang H, Xiong W, Lu S, Chen M, Yao L (2023) Qa-ustnet: Yarn-dyed fabric defect detection via u-shaped swin transformer network based on quadtree attention. Text Res J , 00405175231158134
Sabour S, Frosst N, Hinton GE (2017) Dynamic routing between capsules 30
Wang H, Lu S, Qiao L, Chen F, He X, Gao Y, Mei J (2022) Unsupervised contrastive learning for few-shot toc prediction and application. Int J Coal Geol 259:104046. https://doi.org/10.1016/j.coal.2022.104046
Ristea N-C, Madan N, Ionescu RT, Nasrollahi K, Khan FS, Moeslund TB, Shah M (2022) Self-supervised predictive convolutional attentive block for anomaly detection. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 13576–13586
Liu Y, Shao Z, Teng Y, Hoffmann N (2021) Nam Normalization-based attention module
Zhang H, Tang W, Zhang L, Li P, Gu D (2019) Defect detection of yarn-dyed shirts based on denoising convolutional self-encoder. In: 2019 IEEE 8th Data driven control and learning systems conference (DDCLS)
Zhang H, Tan Q, Lu S et al (2021) Yarn-dyed shirt piece defect detection based on an unsupervised reconstruction model of the u-shaped denoising convolutional auto-encoder. J Xidian Univ 48(3):123–130
Oord AVD, Li Y, Vinyals O (2018) Representation learning with contrastive predictive coding
Park T, Efros AA, Zhang R, Zhu J-Y (2020) Contrastive learning for unpaired image-to-image translation. In: Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part IX 16, pp. 319–345. Springer
Wu Z, Xiong Y, Yu SX, Lin D (2018) Unsupervised feature learning via non-parametric instance discrimination. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3733–3742
Tian Y, Krishnan D, Isola P (2019) Contrastive multiview coding
Isola P, Zhu J-Y, Zhou T, Efros AA (2017) Image-to-image translation with conditional adversarial networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1125–1134
Ioffe S, Szegedy C (2015) Batch normalization: Accelerating deep network training by reducing internal covariate shift. In: International conference on machine learning, pp. 448–456. pmlr
Zhang H, Chen X, Lu S, Yao L, Chen X (2023) A contrastive learning-based attention generative adversarial network for defect detection in colour-patterned fabric. Coloration Technol 139(3):248–264. https://doi.org/10.1111/cote.12642
H Z (2022) Yarn-dyed Fabric Image darasets. https://github.com/ZHW-AI/YDFID-1
Zhang C, Feng S, Wang X, Wang Y (2020) Zju-leaper: a benchmark dataset for fabric defect detection and a comparative study. IEEE Trans Artif Intell 1(3):219–232
Wei W, Deng D, Zeng L, Zhang C (2020) Real-time implementation of fabric defect detection based on variational automatic encoder with structure similarity. J Real-Time Image Processing 1–17
Guanghua Hu, Junfeng Huang, Qinghui Wang, Jingrong Li, Zhijia Xu (2019) Unsupervised fabric defect detection based on a deep convolutional generative adversarial network. Text Res J 90(3–4):247–270
Wang Q, Wu B, Zhu P, Li P, Hu Q (2020) Eca-net: Efficient channel attention for deep convolutional neural networks. In: 2020 IEEE/CVF Conference on computer vision and pattern recognition (CVPR)
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Zhang, H., Lu, Z., Chen, X. et al. Masked contrastive generative adversarial network for defect detection of yarn-dyed fabric. J Supercomput 81, 239 (2025). https://doi.org/10.1007/s11227-024-06711-8
Accepted:
Published:
DOI: https://doi.org/10.1007/s11227-024-06711-8