Multiclass Classification of Denim Fabric Defects Using Convolutional Neural Networks
Resumo
In denim fabric manufacturing, quality assessment traditionally relies on visual inspection by weavers, as guided by ABNT NBR 13484. This manual, post-production process can delay defect detection, allowing issues to persist and recur, which disrupts the production chain. To address this, we developed a deep neural network for multiclass classification of common fabric defects, including double yarns, coarse ends, harness misdraws, slack ends, broken wefts, and soft wefts. Our model integrates convolutional layers for feature extraction and linear layers for classification. It was trained on 2,985 images captured using a low-cost camera mounted above a textile manufacturing loom in a denim manufacturing laboratory, replicating realworld inspection conditions. Our model achieved a classification accuracy of 89%, outperforming other state-of-the-art machine learning algorithms. These results demonstrate the potential for real-time defect detection during production, reducing material waste and improving overall fabric quality.
Referências
M. Hossain, M. Shahid, M. Limon, I. Hossain, and N. Mahmud, “Techniques, applications, and challenges in textiles for a sustainable future,” Journal Of Open Innovation: Technology, Market, And Complexity, 10, 100230, 2024. DOI: 10.1016/j.joitmc.2024.100230
Associação Brasileira de Normas Técnicas, “NBR 13484:2025: Tecidos planos - Método de classificação baseado em inspeção por pontuação de defeitos,” 3rd ed. 2025. Available at [link].
ABNT and SEBRAE, “Guia de implementação: Normas para confecção de jeans,” Convênio ABNT/SEBRAE, Rio de Janeiro, 2012. ISBN: 978-85-07-03612-8. Avaliable at [link].
X. J. Zhou and J. Wang, “A real-time computer vision-based platform for fabric inspection part 2: Platform design and real-time implementation,” The Journal Of The Textile Institute, 107:264–272, 2016. DOI: 10.1080/00405000.2015.1025559
X. Zhao, L. Wang, Y. Zhang, X. Han, M. Deveci, and Milan Parmar, “A review of convolutional neural networks in computer vision,” Artif Intell Rev, 99, 2024. DOI: 10.1007/s10462-024-10721-6
M. Eldessouki, “Computer vision and its application in detecting fabric defects,” In W. K. Wong, editor, Applications of Computer Vision in Fashion and Textiles, The Textile Institute Book Series, chapter 4, pages 61–101. Woodhead Publishing, 2018. DOI: 10.1016/B978-0-08-101217-8.00004-X
C. Li, J. Li, Y. Li, L. He, X. Fu, and J. Chen, “Fabric defect detection in textile manufacturing: A survey of the state of the art,” Security and Communication Networks, 2021(1):9948808, 2021. DOI: 10.1155/2021/9948808
Y. Kahraman and A. Durmuşoğlu, “Deep learning-based fabric defect detection: A review,” Textile Research Journal, 93(5-6):1485–503, 2023. DOI: 10.1177/00405175221130773
P. Guo, Y. Liu, Y. Wu, R. H. Gong and Y. Li, “Intelligent quality control of surface defects in fabrics: A comprehensive research progress,” IEEE Access, 12:63777–808, 2024. DOI: 10.1109/ACCESS.2024.3396053
S. Chakraborty, M. Moore, and L. Parrillo-Chapman, “Automatic defect detection for fabric printing using a deep convolutional neural network,” International Journal of Fashion Design, Technology and Education, 15(2):142–57, 2022. DOI: 10.1080/17543266.2021.1925355
X. Zhao, M. Zhang, and J. Zhang, “Ensemble learning-based CNN for textile fabric defects classification,” International Journal of Clothing Science and Technology, 33(4):664–78, 2021. DOI: 10.1108/ijcst-12-2019-0188
X. Jun, J. Wang, J. Zhou, S. Meng, R. Pan, and W. Gao, “Fabric defect detection based on a deep convolutional neural network using a two-stage strategy,” Textile Research Journal, 91(1-2):130–42, 2021. DOI: 10.1177/0040517520935984
L. Zheng, X. Wang, Q. Wang, S. Wang, and X. Liu, “A fabric defect detection method based on improved YOLOv5,” In 7th International Conference on Computer and Communications (ICCC), IEEE, 620–4, 2021. DOI: 10.1109/ICCC54389.2021.9674548
R. Seidel, H. Seibel Júnior, and K. Komati, “Textile defect detection using YOLOv5 on AITEX dataset,” in Anais do XIX Encontro Nacional de Inteligência Artificial e Computacional, Campinas/SP, 2022, pp. 763–74. DOI: 10.5753/eniac.2022.227396
M. Talu, K. Hanbay, and M. H. Varjovi, “CNN-Based Fabric Defect Detection System on Loom Fabric Inspection,” Tekstil Ve Konfeksiyon. 32:208–19, 2022. DOI: 10.32710/tekstilvekonfeksiyon.1032529
R. Thakur, D. Panghal, P. Jana, Rajan, and A. Prasad, “Automated fabric inspection through convolutional neural network: An approach,” Neural Computing and Applications, 35(5):3805–23, 2023. DOI: 10.1007/s00521-022-07891-1
H. M. Ferreira, D. R. Carneiro, M. Â. Guimarães, and F. V. Oliveira, “Supervised and unsupervised techniques in textile quality inspections, ” Procedia Computer Science, vol. 232, pp. 426–435, 2024, 5th International Conference on Industry 4.0 and Smart Manufacturing (ISM 2023). DOI: 10.1016/j.procs.2024.01.042
H. Mewada, I. M. Pires, P. Engineer, and A. V. Patel, “Fabric surface defect classification and systematic analysis using a cuckoo search optimized deep residual network,” Engineering Science and Technology, an International Journal, 53:101681, 2024. DOI: 10.1016/j.jestch.2024.101681
H. Lin, D. Cai, Z. Xu, J. Wu, L. Sun, and H. Jia, “Fabric4show: Real-time vision system for fabric defect detection and post-processing,” Visual Intelligence, 2(1), 2024. DOI: 10.1007/s44267-024-00047-w
T. Neves, D. Minatel, A. Saito, and M. Baffa, “Two-stage preprocessing approach for background normalization and defect segmentation on denim fabric image analysis,” in Anais Estendidos da XXXVII Conference on Graphics, Patterns and Images, Manaus/AM, 2024, pp. 179–185. DOI: 10.5753/sibgrapi.est.2024.31669
M. Grandini, E. Bagli, and G. Visani, “Metrics for multi-class classification: an overview,” arXiv preprint arXiv:2008.05756, 2020. DOI: 10.48550/arXiv.2008.05756
L. Breiman and J. H. Friedman and R. A. Olshen and C. J. Stone, “Classification And Regression Trees,” Routledge, 2017. DOI: 10.1201/9781315139470
L. Breiman, “Random Forests,” Machine Learning, 45(1):5–32, 2001. DOI: 10.1023/a:1010933404324
T. M. Cover and P. E. Hart, “Nearest neighbor pattern classification,” IEEE Transactions on Information Theory, 13(1):21–7, 1967. DOI: 10.1109/TIT.1967.1053964
C. Cortes and V. Vapnik, “Support-vector networks,” Machine Learning, 20(3):273–97, 1995. DOI: 10.1007/BF00994018
K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” In Proc. IEEE Conf. Comput. Vis. Pattern Recognit. (CVPR), Las Vegas, 770-8, 2016.
J. Deng, W. Dong, R. Socher, L. -J. Li, K. Li and L. Fei-Fei, “ImageNet: A large-scale hierarchical image database,” In 2009 IEEE Conference on Computer Vision and Pattern Recognition, Miami, 2009. DOI: 10.1109/CVPR.2009.5206848
L. van der Maaten and G. Hinton, ‘Visualizing data using t-SNE,” Journal of Machine Learning Research, 9:2579–605, 2008.
B. S. Anami and M. C. Elemmi, “Comparative analysis of SVM and ANN classifiers for defective and non-defective fabric images classification,” The Journal of The Textile Institute, 113(6):1072–82, 2022. DOI: 10.1080/00405000.2021.1915559
C. Chaudhari, R. K. Gupta, and S. Fegade, “A hybrid method of textile defect detection using GLCM, LBP, SVD and Wavelet Transform,” Internat. J. Recent Technol. and Engrg, 8(6):5356–60, 2020. DOI: 10.35940/ijrte.F9569.038620
M. Boluki and F. Mohanna, “Inspection of textile fabrics based on the optimal Gabor filter,” Signal, Image and Video Processing, 15(7):1617–25, 2021. DOI: 10.1007/s11760-021-01897-3
G. Bradski, “The OpenCV Library,” Dr. Dobb’s Journal Of Software Tools, 2000. URL: [link]
A. Paszke et al, “PyTorch: An imperative style, high-performance deep learning library,” 2019. DOI: 10.48550/arXiv.1912.01703
F. Pedregosa et al, “Scikit-learn: Machine Learning in Python,” Journal of Machine Learning Research. 12:2825–30, 2011.
