Keywords

1 Introduction

Textile fabric is manufactured with textile fibers and a widely used material in daily life. During manufacturing woven fabric, unexpected operations can form various defects on the surface. Defects can make the price of fabrics to be reduced by 45–65% [17]. It is natural with manufacturer to reduce the number of defects in the production process. To this end, a fabric defect inspection is necessary and essential task for the quality control in textile manufacturing. The traditional method usually is based on the human vision. Workers are requited to monitor for detecting potential defects, and then manually repair them. However, these defects usually are minor. Many kinds of defect are fine. It is not easy to detect by human eyes. Furthermore, human detecting will increase the working hours. Up to now, there are more than 70 defect types which have been defined in the textile industry [11]. For such s big number of defects, it thus necessary to develop an automated inspection model for not only improving fabric quality, but also reducing human costs. As mentioned in [4, 11], an automated inspection system can reach an accuracy rate of higher than \(90\%\), compared with just \(75\%\) by human. In recent years, utilizing the advantages of machine vision and image processing techniques, automated fabric defect detection has been received many attentions in researching community as well as industry. Many vision systems were developed to replace the traditionally manual methods. Figure 1 shows an example of automated inspection machinesFootnote 1.

Fig. 1.
figure 1

An example of automated inspection machine.

Fig. 2.
figure 2

Fabric samples (in the TILDA database) with different patterns.

Due to variety of fabrics, there is a wide range of different characteristics. All fabrics can be categorized into 17 classifications [11]. Each of them is structured under different shapes such as rectangular, square, or hexagonal (see Fig. 2 for some common fabric structures). For more than 70 types of defects, there are a lots of categories and characteristics of defects. Figure 3 shows five defect types in a fabric category. First two images are hole-type defects in which they are classified due to the size of hole. The third one is a cut defect, the fourth is sliced hole and the last one is sliced hole with a cut. Another challenge in the fabric defect detection is data collection. It is difficult to collect a large enough number of defect samples for each type. This makes incompleteness in datasets. Consequently, though many researchers have spent much efforts to the problem (as mentioned in the next section), a method proposed for a fabric category can not be extended to another. There are various vision systems proposed for surface defect inspections in industry, for instances ceramic [1] and sheet steel [18]. For fabric defect detections, many studies were carried out. A previous common approach is based on spectral analysis. Fourier transform was widely applied to defect detection [2]. Another is Wavelet based methods [3, 16, 19, 22]. Systematic reviews of existing methods can be found in [11] and also in [6].

Fig. 3.
figure 3

Different defects in a fabric (in the TILDA database), from left to right: medium hole, big hole, a cut, sliced hole, and sliced hole with cut.

Deep learning techniques are increasingly taken into account in recent years. It also is proved to be an increasingly important role in computer vision and its applications. This paper aims to investigate the use of deep learning techniques for fabric defect detection. Our main purpose is to toward a general model to overcome challenges mentioned above. To this end, we apply some state-of-the-art deep learning models for variety of defect types on a number of fabric categories. The models are tested and evaluated for the TILDA database.

The rest of the paper is organized as follows. The next section quickly reviews some recent learning-based methods proposed for fabric defect detection. Section 3 describes the use of deep learning models for the problem. Experimental results are given at the end of the section. Finally, Sect. 4 gives concluding remarks.

Fig. 4.
figure 4

A back-propagation model proposed by Kuo et al. in 2003 [11].

2 Learning-Based Detection

Neural networks has attracted attentions for fabric defect detection, beside of vision based inspection systems in other fields. In 2000, Huang and Chen introduced a back-propagation neural network coupling with fuzzy term to classify eight different categories of fabric defect [5]. Stojanovic et al. then proposed a three layer back-propagation model to reduce the computational cost [15]. Kumar, in 2003, gave a feed-forward network model for segmentation local defects [7]. In this model, the principal components analysis (PCA) using singular value decomposition (SVD) was used to reduce the dimension of feature vectors. Also in this year, Kuo et al. developed [8, 9] two other back-propagation models. They applied a nonlinear regression algorithm to model a high dimensional system and also introduced a pre-processed filtering step to improve the performance of defect detection, obtained at \(94.38\%\) accuracy. Figure 4 shows an overview of their model. For more complicated situations such as hole-type defects, poor quality, and unknown size samples, some neural network models also were developed to solve [20, 21]. In 2015, towards a wholly automated inspection system, Rebhi et al. presented a detection scheme which uses the local local homogeneity and neural network [12]. They compute a new homogeneity image. A discrete cosine transform (DCT) is then applied on the image to obtain different representative energy features of each DCT block. These features are finally used as inputs for training a back-propagation model.

Fig. 5.
figure 5

The deep CNN model proposed by Jing et al. in 2019 [6].

Very recently, deep neural networks have also been investigated for fabric defect detections. Mei et al., in 2018, presented an automated model to detect and localize defects [10]. The method is developed as a multi-scale convolutional denoising autoencoder (MSCDAE) architecture. A Gaussian pyramid is used to extract defect features in different sizes for the inputs of the network. This helps to train the model with small samples. Furthermore, the model can be conducted in unsupervised way, it does not need labelled ground truth and human intervention. Thanks to the powerful of convolutional neural network (CNN), Jing et al. developed a deep CNN model for automatic fabric defect detection [6]. In the model, the fabric image is decomposed local patches and then labelled. The labelled patches are used for a pretrained deep CNN model. Finally, a inspection phase is involved to detect defects by sliding over the whole image through the trained model. Defects and their positions are classified and prompted, respectively. Figure 5 is the architecture of this model. Although, proposed deep neural network models achieved a high accuracy results, they still need image processing tasks for the preprocessing purpose. Patches decomposition required to capture as many as possible features of defects, can make the deep CNN model to be more structurally complicated. Furthermore, as indicated in [6], a pretrained model with MNIST datasets is necessary to obtain better results.

3 Deep Networks for Fabric Defect Detection

In this section, we present an empirical study for fabric defect classification with two well-known CNN models, including VGG16 and Darknet tool. Experiments were conducted for the TILDA database which includes 8 categories of defects.

VGG16 was proposed by Simonyan and Zisserman [14] for large scale image classification and detection. In this model, filters of very small size of \(3 \times 3\) are used in convolutional layers. These filters are to extract image features located the left, right, up, down, and center positions. The model involves also five max-pooling layers for the pooling computations. There are three fully-connected layers following the pooling ones and the soft-max one at the end. Figure 6 shows the architecture of VGG16Footnote 2. We also perform experiments with the Darknet framework which is an open source neural network in C and Cuda [13].

Fig. 6.
figure 6

The architecture of the VGG16 neural network.

Dataset Organization

A folder, named tilda_data, is created for containing all files necessary for model training. This will contain all images of the dataset (located in folder ‘r1’, ‘r2’, and ‘r3’), a file listing paths to training examples (tilda_train.list), a file of all paths to testing examples (tilda_test.list), and a file specifying a list of labels of categories (tilda_labels.txt). The TILDA dataset, specifically, the c1 type of this one, is used for training for all proposed convolutional networks. Each image of the dataset is renamed to this format as order_defect_type.png, where

  • order: the order number of the image in the folder,

  • defect_type: type of defect in the image, where e0 means no defect, while e1 to e7 are labels of type of fabric defects. Figure 7 and see Fig. 8 are examples of such types.

Fig. 7.
figure 7

Samples of e0 with no defect

Fig. 8.
figure 8

Samples with different defects.

Hyper-Parameter Setting

  • Hyper-parameters for models

    • Batch size per sample: 1,

    • Image channels: 3,

    • Learning rate: 0.00001,

    • Momentum for the new gradient: 0.9.

  • Hyper-parameters for data augmentation:

    • Angle: 7,

    • Hue: 0.1,

    • Saturation: 0.75,

    • Exposure: 0.75,

    • Aspect: 0.75.

Table 1. Testing results.

Towards a general fabric defect classification, we did not label and localize the training dataset. Before the training, some fundamental image processing operators such as histogram equalization and Sobel filter, are applied to highlight defect objects. A training dataset consisting of 720 images of the TILDA database is used to train the models. Experimental results are given in Table 1. VGG16 gives higher performance than that by Darknet, since it takes advantages of the small filters (size of \(3\times 3\)) in convolutional layers. This helps VGG16 to capture features with small number of samples in training datasets. However, as a consequence, the time of training is worse to that of Darknet. The results obtained are not high, but acceptable for unlabelled and unlocalized defects in the training dataset. This also indicates that a state-of-the-art deep CNN model with suitable parameters can be potential for a general fabric defect classification. This means that different defect types in numerous fabric categories can be classified with few efforts of labelling and localization.

4 Conclusion

This paper investigated the use of deep network models for the general fabric classification problem. In particular, two models including VGG16 and Darknet were used to classify the defect fabric categories without data labelling and localization. The models are tested for the TILDA database. Experimental results were given and discussed. Currently, the accuracies in the tests are not hight yet, since few simple preprocessing tasks applied for the training data. This will be comprehensively studied in another topic for improvement.