Journal of Textile Research ›› 2025, Vol. 46 ›› Issue (10): 227-236.doi: 10.13475/j.fzxb.20241203901

• Machinery & Equipment • Previous Articles     Next Articles

Design of fabric defect detection system based on high generalization image generation and classification algorithm

WU Weitao1,2, HAN Aobo1, NIU Kui3, JIA Jianhui3, YIN Bangxiong1, XIANG Zhong1()   

  1. 1. Faculty of Mechanical Engineering and Automation, Zhejiang Sci-Tech University, Hangzhou, Zhejiang 310018, China
    2. Zhejiang Sci-Tech University Xinchang Technology Innovation Research Institute, Shaoxing, Zhejiang 312000, China
    3. School of Information Science and Engineering, Zhejiang Sci-Tech University, Hangzhou, Zhejiang 310018, China
  • Received:2024-12-18 Revised:2025-03-06 Online:2025-10-15 Published:2025-10-15
  • Contact: XIANG Zhong E-mail:xz@zstu.edu.cn

Abstract:

Objective Rapid, real-time and accurate detection of fabric defects is an important step in the textile production process. Manual detection has problems such as low detection efficiency, high labor intensity, high detection rate, and low detection rate and poor real-time performance of existing mainstream target detection algorithms. Therefore, a fabric defect detection scheme covering hardware, sampling, training, detection, cloud and other links is proposed aiming at the development of a defect detection system based on machine vision to meet the requirements of high precision and real-time in practical applications.

Method A mask technology based fabric defect image generation algorithm is proposed. Based on CycleGAN network model, heterogeneous defect images are generated to solve the problem of unbalanced defect classes. Three network modules, including hook feature pyramid, are proposed. Starting with feature extraction network and information fusion module, the accurate extraction of differential defect features is realized based on YOLOv5 network model, which solves the problem of poor generalization of defect classification by previous target detection algorithms.The designed system can use TensorRT framework to optimize and accelerate, two-stage decision algorithm to realize high-speed detection, and build the defective data cloud analysis module.

Results The image size of the training dataset is 2 880×1 620. In the training phase, the network parameters are trained using a composite data set composed of defect original and defect clipping area images. The dataset has a total of 48 categories and 40 663 images, all of which use Labelim to mark the location of defects in the images, add labels, and finally generate a label file in PASCAL VOC format. The data set is divided into a training set, a validation set, and a test set according to the desired ratio of 8∶1∶1. The improved YOLOv5 model was used for training, the image size was adjusted to 640×640, the batch sample size was 32, and a total of 500 iterations were carried out. Training and testing was performed on a server equipped with Intel Core (TM) I9-1 2900HX, eight 24 GB GPU GeForce RTX4090 graphics cards, and 128 GB RAM. The experimental results show that both sample enhancement and improved detection network can improve the detection accuracy. Compared with the mainstream target detection network, the detection accuracy is up with 8 percentage points, and the detection rate is 95.1%. In the factory test, the detection rate is 93.88%, which meets the quality requirements of the factory.

Conclusion Artificial intelligence is used to generate defect images to solve the problem of uneven distribution of heterogeneous defect samples. The common morphological features of the same type defects are extracted by multistage feature aggregation to solve the problem of low detection rate and poor generalization due to the different morphology of the same name defects. A defect mask generator is designed to enable AI-based batch generation of highly realistic defect images, solving the issue of heterogeneous defect imbalance; network modules such as the hook-shaped feature pyramid are proposed to achieve precise extraction of differentiated defect features, addressing the challenge of poor generalization in defect classification. On this basis, a whole process scheme of fabric defect detection covering hardware, sampling, training, detection, cloud and other links is designed. Edge computer is used as the hardware platform, industrial cameras are used to collect defect images in real time, and the background data is comprehensively processed by mathematical modeling. This not only solves the problems of low efficiency, high labor intensity and high missed detection rate of manual fabric inspection.It also realizes the classified storage, management, traceability and analysis of data. Under the same quality requirements, the developed system can save at least 50% of the labor force, while improving the efficiency of the factory and reducing the economic cost.

Key words: textile quality, fabric defect detection, machine vision, digital upgrade, intelligent manufacturing

CLC Number: 

  • TP391.4

Fig.1

System modeling (a) and overall equipment (b) diagram"

Tab.1

Camera parameters"

参数名称 数值
分辨率 2 880像素×1 620像素
最大帧率 37.4帧/s
曝光时间 20 μs
焦距 (16±0.8)mm
视场角 36.8°×29.88°×22.6°
靶面尺寸 1.69 cm
光圈范围 F1.8~F14

Fig.2

Hardware equipment architecture diagram"

Fig.3

Structure diagram of masked CycleGAN network"

Fig.4

Defect appearance and software algorithm module structure diagram. (a) Schematic diagram of parallel dilated attention module; (b) Structural diagram of different shapes of KinkyFilling and ThinPlace; (c) Structural diagram of hook feature pyramid network module; (d) Structural diagram of multi-level aggregated field of view module"

Fig.5

Architecture diagram of "Intelligent Cloud" collaborative optimization model"

Fig.6

Schematic diagram of human-machine interaction interface"

Fig.7

Detection algorithm flowchart"

Tab.2

FID scores of fabric defect images generated by various network models"

类型 CycleGAN[9] StyleGAN2[10] 本文方法
断经 99.25 96.69 79.35
断纬 134.86 102.87 95.24
棉球 45.87 28.97 26.49
双纬 122.98 112.39 92.38
破洞 42.37 24.87 23.57
纬缩 69.48 67.54 60.39
错综 84.58 94.38 82.39
筘路 112.56 96.76 83.47
密路 86.95 65.84 65.25
稀路 74.28 62.37 46.37
平均 87.31 75.26 65.49

Fig.8

Comparison between original image (a) generated image (b)"

Tab.3

Detection accuracy data of various network models"

方法 EmAP/%
未加入生成图像
数据集
加入生成图像
数据集
SSD[12] 61.4 64.7
FasterRCNN[14] 61.5 63.9
YoloV5n[5] 85.3 87.8
YoloV7tiny[11] 84.5 86.7
YoloV8n[13] 91.8 93.4
本文算法 93.3 95.1

Tab.4

Performance comparison of various Modules"

方法 EmAP/% 帧率/
(帧·s-1)
YoloV5(Baseline) 85.3 30.2
YoloV5+PDAM 89.8 27.7
YoloV5+HookFPN 86.5 35.1
YoloV5+MAFV 88.7 28.6
YoloV5+PDAM+HookFPN 91.6 30.3
YoloV5+PDAM+HookFPN+MAFV 93.3 29.5

Tab.5

Comparison of detection data between system and workers"

织物编号 检测方式 准确度/% 检出率/% 同步率/%
150624A 工人 100
系统 100 207.69 207.69
190921A 工人 100
系统 92.86 216.67 205.71
170627A 工人 100
系统 95.4 244.12 218.42

Tab.6

Comparison of detection data between system and workers without introducing images from GAN"

织物编号 检测方式 准确度/% 检出率/% 同步率/%
z180923A 工人 100
系统 70 87.5 62.5
z241220A 工人 100
系统 60.61 83.33 45.83
z240834A 工人 100
系统 70 116.67 50

Tab.7

Extreme performance of real working condition system"

织物品名 实验对象 准确度/% 检出率/%
231216A-2 检测系统 93.54 93.34
240513A 检测系统 90.90 93.86
220522A 检测系统 95.83 93.88
[1] 郑小虎, 刘正好, 陈峰, 等. 纺织工业智能发展现状与展望[J]. 纺织学报, 2023, 44(8): 205-216.
ZHENG Xiaohu, LIU Zhenghao, CHEN Feng, et al. Current status and prospect of intelligent development in textile industry[J]. Journal of Textile Research, 2023, 44(8): 205-216.
[2] 乌婧, 江振林, 吉鹏, 等. 纺织品前瞻性制备技术及应用研究现状与发展趋势[J]. 纺织学报, 2023, 44(1): 1-10.
WU Jing, JIANG Zhenlin, JI Peng, et al. Research status and development trend of perspective preparation technologies and applications for textiles[J]. Journal of Textile Research, 2023, 44(1): 1-10.
doi: 10.1177/004051757404400101
[3] LUO X, NI Q, TAO R, et al. A lightweight detector based on attention mechanism for fabric defect detection[J]. IEEE Access, 2023, 11: 33554-33569.
doi: 10.1109/ACCESS.2023.3264262
[4] LIN G J, LIU K Y, XIA X K, et al. An efficient and intelligent detection method for fabric defects based on improved YOLOv5[J]. Sensors, 2023, 23(1): 97.
doi: 10.3390/s23010097
[5] JOCHER G, CHAURASIA A, STOKEN A, et al. Ultralytics/yolov5: v6. 1-TensorRT, TensorFlow edge TPU and OpenVINO export and inference[CP/OL]. [2022-02-22]. https://github.com/ultralytics/yolov5.
[6] ZHU J Y, PARK T, ISOLA P, et al. Unpaired image-to-image translation using cycle-consistent adversarial networks[C]// 2017 IEEE International Conference on Computer Vision (ICCV). New York: IEEE, 2017: 2242-2251.
[7] XIANG Z, SHEN Y J, MA M, et al. HookNet: efficient multiscale context aggregation for high-accuracy detection of fabric defects[J]. IEEE Transactions on Instrumentation and Measurement, 2023, 72: 5016311.
[8] ZHOU K L, JIA J H, WU W T, et al. Space-depth mutual compensation for fine-grained fabric defect detection model[J]. Applied Soft Computing, 2025, 172: 112869.
doi: 10.1016/j.asoc.2025.112869
[9] KARRAS T, LAINE S, AILA T M. A style-based generator architecture for generative adversarial networks[C]// 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). New York: IEEE, 2019: 4396-4405.
[10] KARRAS T, LAINE S, AITTALA M, et al. Analyzing and improving the image quality of StyleGAN[C]// 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). New York: IEEE, 2020: 8107-8116.
[11] WANG C Y, BOCHKOVSKIY A, LIAO H M. YOLOv7: trainable bag-of-freebies sets new state-of-the-art for real-time object detectors[C]// 2023 IEEE/CVF Conference on Computer Vision and Pattern Recogni-tion (CVPR). New York: IEEE, 2023: 7464-7475.
[12] LIU W, ANGUELOV D, ERHAN D, et al. SSD: single shot MultiBox detector[C]// Computer Vision-ECCV 2016. Cham: Springer International Publishing, 2016: 21-37.
[13] REN S Q, HE K M, GIRSHICK R, et al. Faster R-CNN: towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 39(6): 1137-1149.
doi: 10.1109/TPAMI.2016.2577031 pmid: 27295650
[1] REN Zhimo, ZHANG Wenchang, LI Zhenyi, YE He, YANG Chunliu, ZHANG Qian. Three-dimensional visual positioning method of textile cylindrical components via binocular structured light [J]. Journal of Textile Research, 2025, 46(07): 227-235.
[2] XU Lunyou, ZOU Kun, WU Haonan. Broken yarn detection on warp beam zone of sizing machine based on machine vision [J]. Journal of Textile Research, 2025, 46(06): 231-239.
[3] GU Mengshang, ZHANG Ning, PAN Ruru, GAO Weidong. Object detection of weaving fabric defects using frequency-domain convolution modules [J]. Journal of Textile Research, 2025, 46(05): 159-168.
[4] LI Jiguo, JING Junfeng, CHENG Wei, WANG Yongbo, LIU Wei. Design of machine vision-based system for detecting appearance defects in glass fiber yarn clusters [J]. Journal of Textile Research, 2025, 46(05): 243-251.
[5] WANG Jianping, WENG Yuxin, SHEN Jinzhu, ZHANG Fan, LIU Xianke. Automatic fabric flipping device based on soft fingers and its application effect [J]. Journal of Textile Research, 2025, 46(01): 197-205.
[6] REN Ke, ZHOU Hengshu, WEI Jinyu, YAN Wenjun, ZUO Yanwen. Dynamic aesthetic evaluation of pleated skirts based on machine vision technology [J]. Journal of Textile Research, 2024, 45(12): 189-198.
[7] LIU Yanping, GUO Peiyao, WU Ying. Research progress in deep learning technology for fabric defect detection [J]. Journal of Textile Research, 2024, 45(12): 234-242.
[8] REN Jiawei, ZHOU Qihong, CHEN Chang, HONG Wei, CEN Junhao. Detection method of position and posture of cheese yarn based on machine vision [J]. Journal of Textile Research, 2024, 45(11): 207-214.
[9] LI Yang, ZHANG Yongchao, PENG Laihu, HU Xudong, YUAN Yanhong. Fabric defect detection based on improved cross-scene Beetle global search algorithm [J]. Journal of Textile Research, 2024, 45(10): 89-94.
[10] CHEN Yufan, ZHENG Xiaohu, XU Xiuliang, LIU Bing. Machine vision-based defect detection method for sewing stitch traces [J]. Journal of Textile Research, 2024, 45(07): 173-180.
[11] WANG Jianping, SHEN Jinzhu, YAO Xiaofeng, ZHU Yanxi, ZHANG Fan. Review on automatic grasping technology and arrangement methods for garment pattern pieces [J]. Journal of Textile Research, 2024, 45(06): 227-234.
[12] WEN Jiaqi, LI Xinrong, FENG Wenqian, LI Hansen. Rapid extraction of edge contours of printed fabrics [J]. Journal of Textile Research, 2024, 45(05): 165-173.
[13] YANG Jinpeng, JING Junfeng, LI Jiguo, WANG Yuanbo. Design of defect detection system for glass fiber plied yarn based on machine vision [J]. Journal of Textile Research, 2024, 45(05): 193-201.
[14] BAI Enlong, ZHANG Zhouqiang, GUO Zhongchao, ZAN Jie. Cotton color detection method based on machine vision [J]. Journal of Textile Research, 2024, 45(03): 36-43.
[15] GE Sumin, LIN Ruibing, XU Pinghua, WU Siyi, LUO Qianqian. Personalized customization of curved surface pillows based on machine vision [J]. Journal of Textile Research, 2024, 45(02): 214-220.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!