Journal of Textile Research ›› 2023, Vol. 44 ›› Issue (07): 103-109.doi: 10.13475/j.fzxb.20220405401

• Textile Engineering • Previous Articles     Next Articles

Defect reconstruction algorithm for fabric defect detection

FU Han1,2, HU Feng1,2(), GONG Jie1,2, YU Lianqing1,2   

  1. 1. School of Mechanical Engineering & Automation, Wuhan Textile University, Wuhan, Hubei 430074, China
    2. Hubei Digital Textile Equipment Key Laboratory, Wuhan Textile University, Wuhan, Hubei 430074, China
  • Received:2022-04-15 Revised:2023-01-12 Online:2023-07-15 Published:2023-08-10

Abstract:

Objective Defect has great influence on the accuracy of fabric quality evaluation. At present, the detection methods of fabric defect utilizing deep learning method, such as region convolutional neural networks (R-CNN) and YOLO, have insufficient detection accuracy for complex pattern fabric defects and are heavily dependent on the number of training samples. In order to solve the problem that the number of fabric defect samples with complex patterns has a large impact on the detection accuracy, a reconstruction method of fabric defect image is proposed for fabric defect detection.

Method The core idea of the proposed method is to consider the defect as a damage to the fabric texture. Firstly, the conditional generative adversarial neural network(CGAN) is adopted to repair the defective area of the image. Then, the difference is calculated as pixels-by-pixels comparison between the reconstructed image and the defect image. Lastly, the detection of fabric defect is perform by the image division of difference result.

Results In order to enhance reconstruction accuracy of the defect image by the generator, a self attention mechanism is used in the constitutional neural network, which can establish connections between distant pixels in the defect image. To solve the problem that the loss function of the generative adversarial neural network is weak in processing image details, the L1 loss function and the improved structural loss function are employed to construct the target loss function to improve the network's ability to process image details. Since the self attention mechanism is added to the generator, the neural network has the capability to coordinate the global features of the pattern fabric image and the local features around the defect area. The network is encouraged to reconstruct the defect according to the global features, so that the accuracy of image reconstruction is higher. Through the reconstruction experiment of oil defect images, the effectiveness of the method is proved (Fig. 1). The image reconstruction quality and image detail processing capability of the network are improved by introducing L1 loss function and improved structure loss function. L1 loss function can improve the image reconstruction quality of the network. The structural loss function can enhance the detail processing ability of the network. Two functions were simultaneously a dopted to strengthen the detection capability of defect edges and small defects (Fig. 3). ReNet-D method, SDDM-PS method and the proposed method are respectively used for the comparative experimental study of five kinds of fabric defects with different complex patterns. The results show that the ReNet-D method has a very poor performance in the detection of various defects of complex pattern fabrics, and can hardly detect the defects. The SDDM-PS method had a good detection effect on obvious defects such as oil stains and holes, but there were some cases of missed detection and false detection, and the detection effect was poor for defects such as rubbing damage and gaps with small differences from the background. It can be seen that the proposed method provides complete detection of oil, foreign matter, holes, rubbing damage and warp loss defects in the fabric (Fig. 6-Fig. 10). In terms of detection efficiency,our method takes 46.15 ms to detect an image, which is only a small increase in time consumption compared to 38.25 ms for ReNet-D and 43.82 ms for SDDM-PS.

Conclusion A defect detection method based on defect image reconstruction is proposed. This method combines GAN network and self attention mechanism, and makes full use of the advantages of both to improve the reconstruction accuracy of defect images. At the same time, aiming at the problem of weak image detail processing in the generation of adversarial neural network loss function, L1 loss function and improved structure loss function are introduced to construct the target loss function, so as to improve the ability of CGAN network to process image details. The experimental results show that the ReNet-D method has poor detection accuracy for all kinds of defects, and even the original background of the image is used as a defect. SDDM-PS method has certain detection ability for oil, foreign matter and holes, but there are cases of missed detection and false detection, and it can hardly detect rubbing damage defects, and the detection integrity of warp loss defects is also very low. Although there is some error in the detection of rubbing damage and warp loss defects, the proposed method has a high degree of completeness and accuracy compared to the above two methods.

Key words: defect detection, generative adversarial neural network, defect reconstruction, loss function, self attention mechanism, fabric quality

CLC Number: 

  • TS101.9

Fig. 1

Detection comparison chart with and without self attention mechanism. (a) Original defect image; (b) Reconstructed image without self attention mechanism; (c) Reconstructed image with self attention mechanism; (d) Detection result without self attention mechanism; (e) Detection result with self attention mechanism"

Fig. 2

Generator network structure"

Fig. 3

Comparison of detection results of different loss functions. (a) Image of original defect; (b) Detection results of CGAN loss; (c) Detection results of original SSIM loss; (d) Detection results of L1 loss; (e) Detection results of SSIM loss; (f)Detection results of L1+SSIM loss "

Fig. 4

Flow of defect detection process. (a) Original defect image; (b) Reconstruction image; (c) Defect image; (d) Denoising image; (e) Defect location image"

Fig. 5

Data set of defects used in experiment. (a) Sample 1; (b) Sample 2; (c) Sample 3; (d) Sample 4; (e) Sample 5"

Fig. 6

Comparison of experimental results of oil defects by different method. (a) Defect sample; (b) Detection result of ReNet-D;(c) Detection result of SDDM-PS;(d) Detection result of this paper"

Fig. 7

Comparison of experimental results of rubbing damage defects by different method. (a) Defect sample; (b) Detection result of ReNet-D; (c) Detection result of SDDM-PS;(d) Detection result of this paper"

Fig. 8

Comparison of experimental results of foreign matter defects by different method. (a) Defect sample; (b) Detection result of ReNet-D; (c) Detection result of SDDM-PS; (d) Detection result of this paper"

Fig. 9

Comparison of experimental results of hole defect by different method. (a) Defect sample; (b) Detection result of ReNet-D; (c) Detection result of SDDM-PS; (d) Detection result of this paper"

Fig. 10

Comparison of experimental results of warp loss defect by different method. (a) Defect sample; (b) Detection result of ReNet-D;(c) Detection result of SDDM-PS;(d) Detection result of this paper"

[1] WEIMER D, SCHOLZ-REITER B, SHPITALNI M. Design of deep convolutional neural network architectures for automated feature extraction in industrial inspection[J]. CIRP Annals, 2016, 65(1): 417-420.
doi: 10.1016/j.cirp.2016.04.072
[2] 刘娆. 卷积神经网络在纺织品缺陷检测中的应用研究[D]. 西安: 西安工程大学, 2019: 35-45.
LIU Xiao. The application of convolutional neural network in textile defect detection[D]. Xi'an: Xi'an Polytechnic University, 2019: 35-45.
[3] LI Yundong, ZHAO Weigang, PAN Jiahao. Deformable patterned fabric defectdetection with Fisher criterion-based deep learning[J]. IEEE Transactions on Automation Science and Engineering, 2016, 14(2): 1256-1264.
doi: 10.1109/TASE.2016.2520955
[4] MEI Shuang, YANG Hua, YIN Zhouping. An unsupervised learning-based approach for automated defect inspection on textured surfaces[J]. IEEE Transactions on Instrumentation and Measurement, 2018, 67(6): 1266-1277.
doi: 10.1109/TIM.2018.2795178
[5] 余文勇, 张阳, 姚海明, 等. 基于轻量化重构网络的表面缺陷视觉检测[J]. 自动化学报, 2020, 48(9):2175-2186.
YU Wenyong, ZHANG Yang, YAO Haiming, et al. Visual inspection of surface defects based on lightweight reconstruction network[J]. ACTA Automatica Sinica, 2020, 48(9):2175-2186.
[6] ZHANG D, SONG K, XU J, et al. An image-level weakly supervised segmentation method for no-service rail surface defect with size prior[J]. Mechanical Systems and Signal Processing, 2022, 165(15): 108334-108348.
doi: 10.1016/j.ymssp.2021.108334
[7] 李剑. 基于无监督学习的木地板缺陷检测方法研究[D]. 北京: 北京交通大学, 2021: 40-45.
LI Jian. Research on defect inspection of wooden floor based on unsupervised learning[D]. Beijing: Beijing Jiaotong University, 2021: 40-45.
[8] ZHAO Xinyu, WU Bin. Algorithm for real-time defect detection of micropipe inner surface[J]. Applied Optics, 2021, 60(29): 9167-9179.
doi: 10.1364/AO.438287
[9] 张哲源. 基于生成对抗网络的机织物疵点检测研究[D]. 上海: 东华大学, 2022: 1-7.
ZHANG Zheyuan. Research on woven fabric defect defection based on generative adversarial network[D]. Shanghai: Donghua University, 2022:1-7.
[10] HUANG R, DUAN B, ZHANG Y, et al. Priorguided GAN based interactive airplane engine damage image augmentation method[J]. Chinese Journal of Aeronautics, 2021, 35(10): 222-232.
doi: 10.1016/j.cja.2021.11.021
[11] ISOLA P, ZHU J Y, ZHOU T, et al. Image-to-image translation with conditional adversarial networks[C]// HONOLULU H I. Conference on Computer Vision & Pattern Recognition. New York: IEEE, 2016:5967-5976.
[12] LI Huan, TANG Jinglei. Dairy goat image generation based on improved self-attention generative adversarial networks[J]. IEEE Access, 2020, 8(99): 62448-62457.
doi: 10.1109/Access.6287639
[13] ZHANG H, GOODFELLOW I, METAXAS D, et al. Self-attention generative adversarial networks[J]. Computer Science, 2018. DOI: 10.48550/arXiv.1805.08318.
doi: 10.48550/arXiv.1805.08318
[14] LIU X, QIAO Y, XIONG Y, et al. Cascade conditional generative adversarial nets for spatial-spectral hyperspectral sample generation[J]. Science China Information Sciences, 2020, 63(4):77-92.
[15] ZHAO Hang, GALLO Orazio, FROSIO Luri, et al. Loss functions for image restoration with neural networks[J]. IEEE Transactions on Computational Imaging, 2017, 3(1): 47-57.
doi: 10.1109/TCI.2016.2644865
[16] WANG Z, BOVIK A C, SHEIKH H R, et al. Image quality assessment: from error visibility to structural similarity[J]. IEEE Trans Image Process, 2004, 13(4): 600-612.
doi: 10.1109/TIP.2003.819861
[17] 徐启永, 胡峰, 王传桐, 等. 改进频率调谐显著算法在疵点图像分割中的应用[J]. 纺织学报, 2018, 39(5): 125-131.
XU Qiyong, HU Feng, WANG Chuantong, et al. Segmentation of fabric defect images based on improved frequenytuned salient algorithm[J]. Journal of Textile Research, 2018, 39(5): 125-131.
[18] MAKHZANI A, SHLENS J, JAITLY N, et al. Adversarial autoencoders[J]. Computer Science, 2015. DOI: 10.48550/arXiv.1511.05644.
doi: 10.48550/arXiv.1511.05644
[19] ZHAO Z, LI B, DONG R, et al. A surface defect detection method based on positive samples[J]. PRICAI: Trends in Artificial Intelligence, 2018, 29(95): 473-481.
[1] YAN Benchao, PAN Ruru, ZHOU Jian, WANG Lei, WANG Xiaohu. Real-time detection of fabric defects based on use of improved Itti salient model [J]. Journal of Textile Research, 2023, 44(07): 95-102.
[2] LI Yang, PENG Laihu, LI Jianqiang, LIU Jianting, ZHENG Qiuyang, HU Xudong. Fabric defect detection based on deep-belief network [J]. Journal of Textile Research, 2023, 44(02): 143-150.
[3] WANG Bin, LI Min, LEI Chenglin, HE Ruhan. Research progress in fabric defect detection based on deep learning [J]. Journal of Textile Research, 2023, 44(01): 219-227.
[4] ZHENG Zhaolun, LU Yujun. Dual-algorithm for fabric defect detection based on singular value decomposition [J]. Journal of Textile Research, 2022, 43(11): 59-67.
[5] JIN Shoufeng, HOU Yize, JIAO Hang, ZHNAG Peng, LI Yutao. An improved AlexNet model for fleece fabric quality inspection [J]. Journal of Textile Research, 2022, 43(06): 133-139.
[6] LÜ Wentao, LIN Qiqi, ZHONG Jiaying, WANG Chengqun, XU Weiqiang. Research progress of image processing technology for fabric defect detection [J]. Journal of Textile Research, 2021, 42(11): 197-206.
[7] ZHU Lei, REN Mengfan, PAN Yang, LI Botao. Fabric defect detection based on similarity location and superpixel segmentation [J]. Journal of Textile Research, 2020, 41(10): 58-66.
[8] ZHOU Wenming, ZHOU Jian, PAN Ruru. Yarn-dyed fabric defect detection based on context visual saliency [J]. Journal of Textile Research, 2020, 41(08): 39-44.
[9] YANG Enjun, LIAO Yihui, LIU Andong, YU Li. Detection for fabric defects based on low-rank decomposition [J]. Journal of Textile Research, 2020, 41(05): 72-78.
[10] LU Hao, CHEN Yuan. Surface defect detection method of carbon fiber prepreg based on machine vision [J]. Journal of Textile Research, 2020, 41(04): 51-57.
[11] JING Junfeng, ZHANG Junyang, ZHANG Huanhuan, SU Zebin. Defect detection on surface of draw texturing yarn packages in gradient space [J]. Journal of Textile Research, 2020, 41(02): 44-51.
[12] ZHANG Huanhuan, MA Jinxiu, JING Junfeng, LI Pengfei. Fabric defect detection method based on improved fast weighted median filtering and K-means [J]. Journal of Textile Research, 2019, 40(12): 50-56.
[13] XIAO Zhitao, GUO Yongmin, GENG Lei, WU Jun, ZHANG Fang, WANG Wen, LIU Yanbei. Internal defect detection method for thin test pieces of woven laminated composites based on ultrasonic phased array [J]. Journal of Textile Research, 2019, 40(11): 81-87.
[14] ZHU Hao, DING Hui, SHANG Yuanyuan, SHAO Zhuhong. Defect detection algorithm for multiple texture hierarchical fusion fabric [J]. Journal of Textile Research, 2019, 40(06): 117-124.
[15] DU Shuai, LI Yueyang, WANG Mengtao, LUO Haichi, JIANG Gaoming. Fabric defect detection based on improved local adaptive contrast method [J]. Journal of Textile Research, 2019, 40(02): 38-44.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!