Table of Contents Author Guidelines Submit a Manuscript
Mathematical Problems in Engineering
Volume 2018, Article ID 3709821, 17 pages
https://doi.org/10.1155/2018/3709821
Research Article

Fabric Defect Detection Based on Pattern Template Correction

1Open Lab of Industrial Cloud for Intelligent Manufacturing, Changzhou College of Information Technology, Changzhou, China
2Changzhou Key Laboratory of Large Plastic Parts Intelligence Manufacturing, Changzhou, China
3School of Information Science and Engineering, Changzhou University, Changzhou, China

Correspondence should be addressed to Jiuzhen Liang; nc.ude.uzcc@gnailzj

Received 11 December 2017; Accepted 11 February 2018; Published 22 March 2018

Academic Editor: Ivan Giorgio

Copyright © 2018 Xingzhi Chang et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Abstract

This paper proposes a novel template-based correction (TC) method for the defect detection on images with periodic structures. In this method, a fabric image is segmented into lattices according to variation regularity, and correction is applied to reduce the effect of misalignment among lattices. Also, defect-free lattices are chosen for establishing an average template as a uniform reference. Furthermore, the defect detection procedure is composed of two steps, namely, defective lattices locating and defect shape outlining. Defective lattices locating is based on classification for defect-free and defective patterns, which involves an improved E-V method with template-based correction and centralized processing, while defect shape outlining provides pixel-level results by threshold segmentation. In this paper we also present some experiments on fabric defect detection. Experimental results show that the proposed method is effective.

1. Introduction

Fabric defect detection has drawn a lot of attention in recent years. Although many automated fabric defect detection methods have been proposed in [1, 2], these methods face the following questions: defect position locating, defect shape outlining, detection time consumption, and detected results evaluation.

In general, fabrics can be divided into two categories: unpatterned and patterned. Unpatterned fabrics are usually solid-colored with simple structures. There are many defect detection methods for this type of fabrics, including morphological filter [3], Fourier transforms [46], Gabor [7, 8], wavelet [912], Markov random field [13, 14], sparse dictionary reconstruction [1517], neural network [1820], and support vector machine [21, 22]. Patterned fabrics are in periodic variations with complicated pattern features. To deal with this kind of fabrics, many methods such as WGIS [23], BB [24], RB [25], ID [26], and ER [27] are proposed. For unpatterned fabrics, the key problem is to reduce the influence of texture features. This paper focuses on patterned fabric defect detection.

The patterned fabric detection methods can be further classified into three categories: partition-matching approach, statistical approach, and modal-based approach.

(1) Partition-matching approach includes the WGIS [23] and ER [27] methods. After Haar wavelet decomposition, the WGIS method uses a defect-free partition to perform moving subtraction operation on images to obtain decision boundaries. The ER method obtains the decision boundaries by random competitions. However, the detection results of these two methods are not stable because of the randomness of defect-free partition selection during the training phase.

(2) Statistical approach includes the BB [24] and RB [25] methods. By different combinations of moving average and standard deviation, the BB and RB methods obtain the decision boundaries. Although these methods carried out by threshold segmentation are effective, their excessive model parameters lead to overreliance on human experience.

(3) Modal-based approach includes the ID [26] method. The ID method decomposes an image into cartoon part and texture part. Then, the detection is realized by converting the decomposed cartoon image into a binary image. But this method is unpractical for requiring a defect-free image which is most similar to the defective image to obtain the optimized parameters for image decomposition.

We can see from the previously proposed methods that the features they obtained from defect-free partitions are only used to determine boundaries or optimize the parameters in image decomposition. After that, these methods directly detect image defects at pixel level, resulting in the false inspection of some pixels.

Based on the previous problems, we propose a novel two-step template-based correction method. Our contributions can be summarized as follows:

(1) We propose an adaptive lattice segmentation method, which can automatically segment the images with periodic structures into lattices. Segmented lattices contain roughly same pattern features, providing favorable conditions for feature extraction, analysis, and comparison.

(2) To make the detection results stable, we establish an average template as a uniform reference. Template-based correction which improves detection robustness and accuracy is used in process of template establishing and detection to reduce the effect of misalignment among lattices. Besides, it can also enhance the difference among normal and defective blocks to make feature extraction and defect detection more effective.

(3) In order to make the defect detection both efficient and accurate, we divide the detection process into two steps: defective lattices locating and defect shape outlining. The former provides lattice-level rough defect regions and the latter provides pixel-level outlining defect regions.

The experiments are conducted on fabric databases with ground-truth images, and our TC method achieves 0.7868 TPR and 0.2158 PPV for box-patterned fabrics using 26 defective images, 0.8914 TPR and 0.2089 PPV for star-patterned fabrics using 25 defective images, and 0.9811 TPR and 0.2209 PPV for dot-patterned fabrics using 30 defective images in defective lattices locating. Besides, the TC method achieves 0.5863 TPR and 0.5237 PPV for box-patterned fabrics, 0.4587 TPR and 0.5201 PPV for star-patterned fabrics, and 0.5901 TPR and 0.6459 PPV for dot-patterned fabrics in defect shape outlining. These results are comparable with the developed methods.

The rest of the paper is organized as follows. In Section 2, we introduce the original E-V method. The proposed TC method is introduced in Section 3. The performance of TC method and the comparison of WGIS, BB, RB, and ER methods are presented in Section 4. At last, Section 5 concludes the paper.

2. The Original E-V Method

The original E-V method [28, 29] is proposed for defective lattices classification and it evaluates the E and V values with a process of circular shift and moving subtraction method (similar to the GIS method [23]). For convenience, the key equations are outlined below.

Considering two lattices, a testing sample and a defect-free template size of pixels, the process of circular shift H of B produces new templates such that is defined as

is regarded as a process of replicating the matrix itself by shifting rows or columns. Then the 1-norm metric between and is defined as

Thus, the and values are defined as

The upper and lower decision boundaries of E-V value are trained to figure out defective lattices from testing lattices. The details of mathematical definitions and proofs are stated in [28].

Although overall detection success rate of the original E-V method has reached 93.28% [28, 29] in wallpaper groups, it is not suitable for the misalignment and distortion situation. When illumination of input images is not uniform, the detection accuracy declines seriously. Apart from this, it is also difficult for the original E-V method to detect small defects.

3. The TC Method

By applying circular shift, the proposed TC method can reduce the effect of misalignment and can also reinforce the sensitivity of defect detection. Through the introduction of a uniform template, the TC method changes the calculation method of E and V values to optimize the selection of decision boundaries and ensure the accuracy of defective lattice locating. Pixel-level detection result is achieved by threshold segmentation on the located defective lattices. In short, the TC method includes preprocessing phase, template establishing phase, training phase, and testing phase.

3.1. Preprocessing Phase

Preprocessing of the TC method includes grayscale conversion, mean filtering with window size of , and lattice segmentation. The grayscale conversion can simplify the detection and the mean filtering helps in smoothing the fabric image to make the subsequent threshold determination more reliable. After mean filtering, the image size is converted from to . Lattice segmentation can segment images into lattices to obtain lattice-level features.

The lattice segmentation of TC method can be briefly described as follows: For each patterned fabric image I with periodic structures, we define a loss function to obtain the ideal pattern sizewhere and are denoted as the size of segmented blocks; and are considered as the ideal pattern size. Image size of is segmented into blocks in the same size. Furthermore, is defined as follows: where represents the variance among the segmented blocks.

Consider , , and is the pixel value in the th row and th column of the image . Then, is defined as the mean matrix of all blocks:

Then, is defined as where , .

However, since the patterned fabric images are in periodic variations, there are many combinations of and that minimize (4). In order to find the proper pattern size, we suppose that the minimum values obtained in the vertical direction are and the minimum values obtained in the horizontal direction are and are defined as (8). Segmentation on images are shown in Figure 1.

Figure 1: Lattice segmentation. (a) Box-patterned fabric. (b) Star-patterned fabric. (c) Dot-patterned fabric.

In Figure 1, the size of the box pattern is , the size of the star pattern is , and the size of the dot pattern is . Partial image regions cannot be segmented because they are not satisfied with the size of a single cycle (at the right side and the bottom) and these parts will not be detected during the testing stage. Thus, the size of resultant box-patterned images is , the size of resultant star-patterned images is , and the size of resultant dot-patterned images is . In patterned fabric images, distortion is an unavoidable problem and it will result in slight misalignment between two lattices. Therefore, it is very necessary to correct the obtained segmented lattices.

3.2. Template Establishing Phase

In order to highlight the pattern features, we use defect-free lattices to establish an average template. To reduce the effect of misalignment mentioned in Section 3.1, we introduce a correction method based on circular shift.

(1) Definitions of Correction. The definitions of correction are concluded as follows. Suppose is a lattice to be corrected and is a defect-free lattice. To minimize the difference between and , the process of circular shift of the TC method is defined as the following model.where is the number of rows shifted in the vertical direction and is the number of columns shifted in the horizontal direction, , and . and are two matrices sizes of and , which are denoted as follows:

The specific process of correction is shown in Figure 2.

Figure 2: The process of correction.

After calculating and by (9), the lattice is divided into two parts in the horizontal direction size and size . Then, we move the former part to the right of the latter part to finish the horizontal shift. Similar to the process in the horizontal direction, the shift is also applied in the vertical direction. After that, we obtained corrected lattice.

(2) Template Establishing. After lattice segmentation and correction, we have finished the preparation of the uniform template establishing. Lattices selected from k different defect-free images (in our experiment, lattices are selected in the top left, bottom left, top right, and bottom right corner of each image), noted as ,  ,  , are used for establishing the template.where represents the template and , . which is corrected according to represents the corrected and . To reduce the impact of imbalanced illumination, the lattices we selected are from corners of defect-free images. When the parameter increases, the features extracted from the template will be more reliable and detection results will be more accurate.

3.3. Training Phase

The training phase of the TC method involves an improved E-V method. By quantifying the subtractions among defect-free lattices and the template, we can determine the decision boundaries by analyzing the numerical distribution of these values. The details of the improved E-V method are as follows. Suppose is a lattice that has been corrected by using the template . In order to reduce the influence of illumination variations, and have been centralized in advance. , , and in (2) and (3) are modified as where and are mean values of and , respectively.

Suppose is a defect-free lattice, the subtraction matrix between and can be denoted by where is a matrix of difference in grayness caused by the varying illuminations of input images or lattices. Therefore, in (12) can be modified as

Under the premise that the illumination is approximately the same in the neighborhood, . Similarly, .

Suppose is a lattice with defect, the subtraction matrix between and can be denoted bywhere is a matrix of defects. Then, can be denoted as

Because of the varying types of fabric defects, the matrix is unpredictable. In this case, the values of and are greater than 0. We can see from the definition of the improved E-V method that lattices which are more similar to the template have smaller and values (the minimum value is 0).

We use defect-free images for training and there is no overlapping with the k images used for template establishing (for dot-patterned and box-patterned fabric, ; for star-patterned fabric, ). After segmentation and correction, we compute the values of and between the corrected lattice and the template. The corrected lattices are denoted as , where . for box-patterned fabric, for star-patterned fabric, and for dot-patterned fabric. The maximum and values are denoted as and , and the boundaries and are defined as

3.4. Testing Phase

The testing phase of the TC method includes two steps: defective lattices locating and defect shape outlining.

(1) Defective Lattice Locating. With the and values between the testing lattices and the template, we can locate the defective lattices by taking advantage of the decision boundaries acquired during the training phase. The and values of each testing lattice are calculated by the improved E-V method, which are denoted as and , where .

If and , is considered defect-free. Otherwise, is considered defective.

(2) Defect Shape Outlining. In order to figure out pixel-level results after locating defective lattices in the images, we propose a segmentation method based on threshold. For each detected defective lattice , we can get a binary resultant lattice through following equation:where is the template in (11). represents the standard deviation of . is a constant. Thresholds are determined without centralized processing for the reason that mean value and standard deviation are good measures for indicating abnormity of a set of data; therefore the thresholds composed of mean value and standard deviation have a good tolerance for normal variations. Besides, the defect-free pixels in the lattice are greatly influenced by the defective pixels after the centralized processing if defects are large. Defect-free pixels will be false detected under this situation. Normally, is equal to 2 or 3 according to the three-sigma rule [30]. If is equal to 2, more pixels will be mistaken for defective and TPR values will increase while PPV values will decrease. If is equal to 3, some defective pixels will be mistaken for defect-free and TPR values will decrease while PPV values will increase.

Since is corrected, several rows and columns will be shifted. In order to make the testing results consistent with the original defects, we do the following operation on : where and are matrices defined in (10); and are the sizes of . For each detected defective lattice , and are calculated in (9).

4. Performance Evaluation

In our experiment, we use a total of 156 fabric images provided by Industrial Automation Research Laboratory from Dept. of Electrical and Electronic Engineering of Hong Kong University. In detail, 71 defective images of size in 24-bit depth from the box-, star-, and dot-patterned fabric databases are used for evaluation and 85 defect-free images are used in training phase. The box-patterned fabric database contains 30 defect-free and 26 defective images, the star-patterned database contains 25 defect-free and 25 defective images, and the dot-patterned fabric database contains 30 defect-free and 30 defective images. All defective images have corresponding binary ground-truth images that illustrate the defective regions as white (value 1) and the defect-free regions as black (value 0). There are 5 defect types for box and star pattern, that is, Broken End, Hole, Netting Multiple, Thick Bar, and Thin Bar. There is one more defect type called Knots for dot pattern. Moreover, WGIS (2005), BB (2006), RB (2009), and ER (2016) are implemented for comparison purpose. All the experiments are conducted on a desktop computer with an Intel Pentium J2900 2.41-GHz processor and 4.00 GB memory. The algorithm is implemented in Matlab 7.14.

The rest of this section is organized as follows. Section 4.1 introduces the description of evaluation metrics. Section 4.2 introduces the tuning of the parameters of the TC method. Section 4.3 introduces the results of the original and the improved E-V method. Section 4.4 introduces overall results of the TC method.

4.1. Description of Evaluation Metrics

A number of metrics are obtained for evaluation, true positive (TP), false positive (FP), true negative (TN), false negative (FN), accuracy (ACC), true positive rate (TPR), false positive rate (FPR), positive predictive value (PPV), and negative predictive value (NPV). Related definitions of these metrics can be found in [23], where ACC = (TP + TN)/(TP + FP + TN + FN), and usually the value of TN is larger than TP by more than one order of magnitude. Compared with TN, the value of TP is negligible. Thus, ACC is not a good evaluation metric if defective region is small. To evaluate the detection more correctly, we use the value ( measure) in this paper. where is the weight and is set to 1 in [31, 32]. Thus (23) can be modified as

The above equation shows that when the FN and FP increase, in other words, the detection results and manual-labeled results are not consistent, the value decreases. Smaller values of FN and FP indicate better detection results and the value is closer to 1. This evaluation index only considers TPR and PPV, which avoids the detection problem of the small defective regions mentioned above. Thus, ACC is replaced by value in this paper.

4.2. Tuning the Parameters of the TC Method

The TC method involves 2 parameters to be predefined, the number of images for establishing the template (mentioned in Section 3.2), and the number for threshold segmentations (mentioned in Section 3.4).

Experiments on the star-, box-, and dot-patterned fabrics are performed with of 4, 6, 8, 10, and 15 and of 2 and 3. Figure 3 illustrates the average values plots of box-patterned (Figure 3(a)), star-patterned (Figure 3(b)), dot-patterned fabrics (Figure 3(c)) with different parameters and .

Figure 3: value versus constant and for (a) box-patterned, (b) star-patterned, and (c) dot-patterned fabrics.

From Figure 3(a) for box-patterned fabrics and Figure 3(b) for star-patterned fabrics, the value plots are in a rising tendency when the parameter increases. As is mentioned previously, if the number of defect-free patterns for template establishing increases, the effect of random errors among defect-free patterns can be reduced, which makes the method more accurate. For star- and box-patterned fabrics, although value increases when parameter increases, the change rate of plots decreases.

Figure 3(a) shows that, for box-patterned fabrics, and provide the highest value. The maximal deviation is about 0.04 with different . For the box-patterned fabrics, except for Thin Bar and Thick Bar, pixel values of other defects are close to backgrounds, which makes it hard for a smaller to distinguish defect-free and defective pixels. That is why a larger provides higher values. Figure 3(b) shows that, for star-patterned fabrics, values of and are close, which means and provide similar detection results. When changes from 4 to 6, value decreases by 0.01, which is due to the slight differences among the patterns used for template establishing.

The regularity in Figure 3(c) is poor for dot-patterned fabrics because the dot-patterned defective images are mostly man-made. The maximal deviation in Figure 3(c) is about 0.01. The TC method achieves similar results with different parameters and .

Thus, in our experiments, is equal to 15 and is equal to 3.

Figure 4 shows detection results of several images when parameter k changes between 4, 6, 8, and 15 with . It is clear that when increases, some small white dots are removed. The detection results are more accurate as analyzed above.

Figure 4: Differences of several images when parameter k changes.
4.3. Results of the Original and the Improved E-V Method

Detection success rate (DSR) is defined as the percentage of fraction of the amount of correct detection of lattices over the total number of lattices [28], and the numerical results are presented in Table 1. The parameter is equal to 15 and is equal to 3. From Table 1, the improved E-V method (mentioned in training phrase) shows higher DSR than the original one in the overall results (0.9540 versus 0.8883 for box-patterned fabric, 0.9573 versus 0.8559 for star-patterned fabric, and 0.9251 versus 0.9153 for dot-patterned fabric).

Table 1: DSR of the original and improved E-V methods.

For original E-V method on box-patterned fabrics, DSR values achieve about 0.85 in Broken End, Hole, and Netting Multiple while DSR values achieve about 0.92 in Thin Bar and Thick Bar. Pixel values of Broken End, Hole, and Netting Multiple are close to backgrounds. However, defects of Thin Bar and Thick Bar are dark-colored, which are easy to be detected. The average DSR of the improved E-V method for box-patterned fabrics is about 0.94, which means this method can not only detect the obvious defects like Thin Bar and Thick Bar but also detect the defects similar to the backgrounds.

For star-patterned fabrics, this fabric is composed of white and black stars with simple structures. The original E-V method only achieves about 0.8 DSR in Hole, Thin Bar, and Thick Bar. The reason for this phenomenon is similar to the detection on box-patterned fabrics. It is hard for the original E-V method to detect defects which are similar to backgrounds.

For dot-patterned fabrics, defects are man-made with large areas. The original and the improved E-V methods achieve similar results. These two methods can detect large defects.

Figure 5 shows some results detected by the original E-V method and the improved E-V method. The 1st row displays the defective images. The 2nd row displays the corresponding ground-truth images. The 3rd row displays the defective lattices locating of the original E-V method. The 4th row displays the defective lattices locating of the improved E-V method. The 1st and 2nd columns are box-patterned fabrics. The 3rd and 4th columns are star-patterned fabrics. The 5th and 6th columns are dot-patterned fabrics.

Figure 5: Comparison of the original and the improved E-V method.

For box- and star-patterned fabrics, although some defective lattices can be located in the image, there are some missing and false cases for the original E-V method (3rd column). The main reason for missing detection is that defects are similar to the backgrounds. Moving subtraction will lead to insufficient sensitivity in detection. The reason for false detection lies in the misalignment and grayness differences. The improved E-V method can effectively improve the sensitivity of detection and ensure the DSR of defect detection (4th column).

For 5th and 6th rows of dot-patterned fabrics, the two methods can be correctly locating the defective lattices. However, there are false detection situations in 5th row. The proposed TC method contains a subsequent step of pixel-level detection, which can also improve the detection accuracy.

In summary, the improved E-V method proposed in this paper can not only detect large defects but also detect small defects.

4.4. Overall Results of the TC Method

In this section, results of the TC and other methods (WGIS, BB, RB, and ER) are presented in two ways, numerical and graphical results and TPR-PPV graphs. The former part shows numerical results of TPR, PPV, FPR, NPV, and value with some graphical detection results. The latter part shows TPR and PPV in the form of scatter plots. Besides, each scatter also can represent the value. In this way, the results are presented more intuitively.

(1) Numerical and Graphical Results. Detection of the TC method is divided into two parts: the defective lattices locating and defect shape outlining, short for TC locating and TC outlining, respectively. It must be noted that, because of the preprocessing phrase, the resultant images are smaller than the original images and the resultant images need to be zero padded into size of .

Figure 6 depicts the detection results (without zero padding) of TC locating (3rd row) and TC outlining (4th row) with randomly chosen defective images (1st row) and corresponding ground-truth images (2nd row), where the 1st and 2nd columns are the box-patterned defective fabric images; the 3rd and the 4th columns are the star-patterned defective fabric images; the 5th and 6th columns are the dot-patterned defective fabric images. For the star- and box-patterned fabric, the results obtained from TC outlining are close to the manual-labeled results. However, TC outlining on dot-patterned fabric is worse because some small white dots are false detected. Above all, TC outlining performs better than TC locating with more finely defected defect shapes.

Figure 6: Several detection results of TC locating and TC outlining.

Tables 2, 3, and 4, respectively, tabulate the numerical results of each defect type in box-, star-, and dot-patterned fabric images. The results of BB, RB, WGIS, and ER are presented as comparison with results of each part in TC method. For each table, each row represents the average result for a specific method and all rows are categorized based on the defective types.

Table 2: Numerical results of different methods on box-patterned fabric.
Table 3: Numerical results of different methods on star-patterned fabric.
Table 4: Numerical results of different methods on dot-patterned fabric.

From Table 2 of the box-patterned fabric, overall results of the TC method reach 0.7868 TPR, 0.2185 PPV, 0.0485 FPR, 0.9977 NPV, and 0.3359 value for TC locating and 0.5863 TPR, 0.5237 PPV, 0.0083 FPR, 0.9950 NPV, and 0.5469 value for TC outlining. According to the TPR of TC locating, most defective lattices are detected. However, about 0.2 PPV means only about one-fifth of detected pixels are real defective ones. For the results of TC outlining, TPR drops to 0.5863 (25 percent of decrease) but PPV rises to 0.5273 (141 percent of increase). That is the reason that value of TC outlining is higher than TC locating. The BB and RB provide about 0.05 TPR and PPV values in Broken End and Hole defect detection while these two methods are good competitive rivals for the proposed TC method in Thick Bar defect detection. Also, the BB and RB methods outperform the WGIS and ER methods in Thick Bar and Thin Bar defect detection. The BB and RB methods seem unable to detect small defects like Broken End and Hole but are good at detecting obvious defects like Thin Bar and Thick Bar. The TPR and PPV values of the WGIS method are around 0.35 and 0.02, which means although the WGIS method provides stable results on these five kinds of defects, it is still not practical because of much false detection. According to the results, it is difficult for the ER method to detect fabrics defects with complex structures. Figure 7 depicts the detection results (without zero padding) of the WGIS, RB, and TC outlining; TC outlining performs better than the WGIS and RB in defect types of Broken End, Thin Bar, and Thick Bar. However, TC outlining is not good at detecting defect types of Hole and Netting Multiple. Especially for Hole, only a few defective pixels are detected (2nd row in Figure 7).

Figure 7: Box-patterned fabric: (1st column) defective sample names; (2nd column) defective images; (3rd column) ground-truth image; (4th column) detection results of WGIS; (5th column) detection results of RB; (6th column) detection results of TC.

From Table 3 of the star-patterned fabric, overall results of the TC method reach 0.8914 TPR, 0.2089 PPV, 0.051 FPR, 0.9988 NPV, and 0.3291 value for TC locating and 0.4587 TPR, 0.5201 PPV, 0.0051 FPR, 0.9914 NPV, and 0.4754 value for TC outlining. TPR value of TC outlining drops sharply (48 percent of decrease), especially for defect types of Broken End (0.9249 versus 0.5142), Netting Multiple (0.9270 versus 0.4167), and Thick Bar (0.8802 versus 0.3614). This means although the TC method on star-patterned fabric can locate defective lattices correctly, it is difficult to outline the defect shapes. According to the numerical results of other methods, the BB, RB, WGIS, and ER methods provide lower TPR and FPR values than the TC method in Broken End, Hole, Netting Multiple, and Thin Bar defect detection. The ER method shows higher TPR and value than TC outlining in Thick Bar defect detection. The average TPR values of BB and RB methods are less than 0.2. The BB and RB method detect defects by different combinations of moving average and standard deviation and the star-patterned fabrics consist of black and white stars. It is hard for these statistical approaches to detect dark-colored defects. The ER method has good performances except for Broken End because this kind of defect is small. In Figure 8, TC outlining provides good results of Hole and Thin Bar. However, it is hard to detect dark defects in black backgrounds, such as Netting Multiple (3rd row). Besides, TC outlining provides many false detected white dots, such as Thick Bar (5th row).

Figure 8: Star-patterned fabric: (1st column) defective sample names; (2nd column) defective images; (3rd column) ground-truth image; (4th column) detection results of WGIS; (5th column) detection results of RB; (6th column) detection results of TC.

From Table 4 of the dot-patterned fabric, overall results of the TC method reach 0.9811 TPR, 0.2209 PPV, 0.1963 FPR, 0.9992 NPV, and 0.3521 value for TC locating and 0.5901 TPR, 0.6459 PPV, 0.0126 FPR, 0.9723 NPV, and 0.5952 value for TC outlining. TPR values of TC outlining drop sharply on Broken End (0.9737 versus 0.3611) and Netting Multiple (0.9390 versus 0.2967) but it provides highest PPV values on Thick Bar (0.9347). Defects of dot-patterned fabrics are usually large, such as Thick Bar and Knots. However, with obvious texture features, it is hard for these methods to maintain TPR and PPV values. The BB and RB methods provide higher PPV values than the TC, WGIS, and ER methods while the TC, WGIS, and ER methods provide higher TPR values than the BB and RB methods. According to values, the TC and ER outperform other methods. In Figure 9, the WGIS method provides a better result than RB and TC outlining on Netting Multiple (3rd row) and Knots (6th row). The WGIS and TC outlining perform better than RB on Broken (1st row) and Hole (2nd row) end. These three methods are all good at detection on Thin Bar (4th row) and Thick Bar (5th row) while the WGIS method provides many false detected pixels.

Figure 9: Dot-patterned fabric: (1st column) defective sample names; (2nd column) defective images; (3rd column) ground-truth image; (4th column) detection results of WGIS; (5th column) detection results of RB; (6th column) detection results of TC.

(2) TPR-PPV Graphs with Optimized Parameters. Figure 10 shows TPR-PPV graphs between the WGIS, BB, RB, ER, and TC (including TC locating and TC outlining). The TPR-PPV graphs are formulated by the average TPR and PPV values of each defective sample of the dot-, star-, and box-patterned fabrics. TPR estimates how many true defective pixels are detected among the manually labeled defective pixels while PPV estimates how many true defective pixels are among the detected pixels. For performance evaluation, PPV values are much better than FPR. Furthermore, TPR and PPV are usually called recall and precision in information retrieval and natural language processing. In TPR-PPV graphs, a point located closer to the top right corner is regarded as an optimized result.

Figure 10: TPR-PPV graphs of detection results on different kinds of fabric. (a) Box-patterned fabric, (b) star-patterned fabric, and (c) dot-patterned fabric.

The magenta stars represent TC locating and the blue crosses represent TC outlining. The red squares, green pentagrams, cyan diamonds, and black hexagrams represent the BB, RB, WGIS, and ER method, respectively. Each mark represents TPR-PPV value of a defect type.

The locating and outlining of the TC method show good results for these three fabrics. The TC locating shows good TPR distributions. The TC outlining maintains the TPR and PPV, which makes the values higher than the TC locating. For the box-patterned fabric, the blue crosses in Figure 10(a) clearly show the TPR-PPV points of the TC outlining are close to the top right corner of the graph, which means the TC outlining performs better than the other methods. Besides, magenta stars (the TC locating) are close to the right bottom corner of the graph with higher TPR values and lower PPV values than the TC outlining. For the star-patterned fabric (Figure 10(b)), the TC outlining does not perform as well as that in the box-patterned fabric. Most blue crosses are around (0.45, 0.55), which means only about a half of defective pixels are detected and only about a half of detected pixels are real defective ones. For the dot-patterned fabric (Figure 10(c)), the TPR-PPV points of the TC outlining are dispersed. Four blue crosses are around (0.45, 0.6) and two blue crosses are around (0.9, 0.8).

5. Conclusion

This paper presents a new method of patterned fabric inspection called the TC method. With an adaptive method of lattice segmentation, fabric images are segmented into lattices automatically. A method of correction is used to reduce the effect of misalignment among lattices. Detection is then carried out in two steps: defective lattices locating and defects shape outlining. The former step is good at locating the defective lattices in the images (over 0.92 DSR and over 0.78 TPR) and the latter step provides finely defected defect shapes. When it comes to unpatterned fabric defect detection, the proposed TC method is not suitable because most unpatterned fabrics do not contain periodic variations. Thus, lattice segmentation and template-based correction are not necessary. The TC outlining achieves the highest values and the TPR and PPV values are over 0.45 and 0.52. For the definition of value, it can be regarded as the weighted harmonic average of TPR and PPV. The TC method performs worse in shape outlining for dot-patterned fabrics than in star- and box-patterned fabrics, which results in the fact that some defect-free pixels are false detected. The reason is that most of the dot-patterned fabric defective images are synthetic with large defects which are similar to backgrounds such as Knots, Netting Multiple, and Broken End. The TC method is too sensitive to deal with these defects. The TC method still has room for improvement in feature extraction such as LBP or Gabor. In the future, additional theoretical development involving feature extraction should be carried out. Such research will be beneficial for defect detection in the textile, tile, ceramics, and wallpaper.

Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.

Acknowledgments

The database employed in this research is kindly provided by Industrial Automation Research Laboratory from Department of Electrical and Electronic Engineering of Hong Kong University. This work was supported by Changzhou High-Tech Key Laboratory (CM20153001).

References

  1. H. Y. T. Ngan, G. K. H. Pang, and N. H. C. Yung, “Automated fabric defect detection—a review,” Image and Vision Computing, vol. 29, no. 7, pp. 442–458, 2011. View at Publisher · View at Google Scholar · View at Scopus
  2. A. Kumar, “Computer-vision-based fabric defect detection: a survey,” IEEE Transactions on Industrial Electronics, vol. 55, no. 1, pp. 348–363, 2008. View at Publisher · View at Google Scholar · View at Scopus
  3. K. L. Mak, P. Peng, and K. F. C. Yiu, “Fabric defect detection using morphological filters,” Image and Vision Computing, vol. 27, no. 10, pp. 1585–1592, 2009. View at Publisher · View at Google Scholar · View at Scopus
  4. C.-H. Chan and G. K. H. Pang, “Fabric defect detection by Fourier analysis,” IEEE Transactions on Industry Applications, vol. 36, no. 5, pp. 1267–1276, 2002. View at Publisher · View at Google Scholar · View at Scopus
  5. G.-H. Hu, Q.-H. Wang, and G.-H. Zhang, “Unsupervised defect detection in textiles based on Fourier analysis and wavelet shrinkage,” Applied Optics, vol. 54, no. 10, pp. 63–80, 2015. View at Publisher · View at Google Scholar · View at Scopus
  6. D.-M. Tsai and T.-Y. Huang, “Automated surface inspection for statistical textures,” Image and Vision Computing, vol. 21, no. 4, pp. 307–323, 2003. View at Publisher · View at Google Scholar · View at Scopus
  7. D.-M. Tsai, C.-P. Lin, and K.-T. Huang, “Defect detection in coloured texture surfaces using Gabor filters,” Imaging Science Journal, vol. 53, no. 1, pp. 27–37, 2005. View at Publisher · View at Google Scholar · View at Scopus
  8. Y. Zhang, Z. Lu, and J. Li, “Fabric defect detection and classification using gabor filters and gaussian mixture model,” in Proceedings of the 9th Asian Conference on Computer Vision - Volume Part II, vol. 5995, pp. 635–644, Springer, Heidelberg, Berlin. View at Publisher · View at Google Scholar
  9. K. Yildiz and A. Buldu, “Wavelet transform and principal component analysis in fabric defect detection and classification,” Pamukkale University Journal of Engineering Sciences, vol. 23, no. 5, pp. 622–627, 2017. View at Publisher · View at Google Scholar
  10. X. Z. Yang, G. K. H. Pang, and N. H. C. Yung, “Discriminative fabric defect detection using adaptive wavelets,” Optical Engineering, vol. 41, no. 12, pp. 3116–3126, 2002. View at Publisher · View at Google Scholar · View at Scopus
  11. Z. Wen, J. Cao, X. Liu, and S. Ying, “Fabric defects detection using adaptive wavelets,” International Journal of Clothing Science and Technology, vol. 26, no. 3, pp. 202–211, 2014. View at Publisher · View at Google Scholar · View at Scopus
  12. X. Yang, G. Pang, and N. Yung, “Robust fabric defect detection and classification using multiple adaptive wavelets,” IEE Proceedings-Vision, Image and Signal Processing, vol. 152, no. 6, pp. 715–723, 2005. View at Publisher · View at Google Scholar · View at Scopus
  13. F. S. Cohen, Z. Fan, and S. Attali, “Automated inspection of textile fabrics using textural models,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 13, no. 8, pp. 803–808, 1991. View at Publisher · View at Google Scholar · View at Scopus
  14. A. Dogandžić, N. Eua-Anant, and B. Zhang, “Defect detection using hidden Markov random fields,” in Proceedings of the AIP Conference, vol. 760, pp. 704–711, USA, July 2005. View at Publisher · View at Google Scholar · View at Scopus
  15. L. Tong, W. K. Wong, and C. K. Kwong, “Fabric Defect Detection for Apparel Industry: A Nonlocal Sparse Representation Approach,” IEEE Access, vol. 5, pp. 5947–5964, 2017. View at Publisher · View at Google Scholar · View at Scopus
  16. J. Zhou, D. Semenovich, A. Sowmya, and J. Wang, “Sparse dictionary reconstruction for textile defect detection,” in Proceedings of the 11th IEEE International Conference on Machine Learning and Applications, ICMLA 2012, pp. 21–26, USA, December 2012. View at Publisher · View at Google Scholar · View at Scopus
  17. J. Cao, J. Zhang, Z. Wen, N. Wang, and X. Liu, “Fabric defect inspection using prior knowledge guided least squares regression,” Multimedia Tools and Applications, vol. 76, no. 3, pp. 1–17, 2015. View at Publisher · View at Google Scholar · View at Scopus
  18. M. T. Habib and M. Rokonuzzaman, “Distinguishing feature selection for fabric defect classification using neural network,” Journal of Multimedia, vol. 6, no. 5, pp. 416–424, 2011. View at Publisher · View at Google Scholar · View at Scopus
  19. Z. Kang, C. Yuan, and Q. Yang, “The fabric defect detection technology based on wavelet transform and neural network convergence,” in Proceedings of the 2013 IEEE International Conference on Information and Automation, ICIA 2013, pp. 597–601, China, August 2013. View at Publisher · View at Google Scholar · View at Scopus
  20. P. Li, J. Liang, X. Shen, M. Zhao, and L. Sui, “Textile fabric defect detection based on low-rank representation,” Multimedia Tools and Applications, vol. 3, pp. 1–26, 2017. View at Publisher · View at Google Scholar
  21. H.-G. Bu, J. Wang, and X.-B. Huang, “Fabric defect detection based on multiple fractal features and support vector data description,” Engineering Applications of Artificial Intelligence, vol. 22, no. 2, pp. 224–235, 2009. View at Publisher · View at Google Scholar · View at Scopus
  22. A. Ghosh, T. Guha, R. B. Bhar, and S. Das, “Pattern classification of fabric defects using support vector machines,” International Journal of Clothing Science and Technology, vol. 23, no. 2, pp. 142–151, 2011. View at Publisher · View at Google Scholar · View at Scopus
  23. H. Y. T. Ngan, G. K. H. Pang, S. P. Yung, and M. K. Ng, “Wavelet based methods on patterned fabric defect detection,” Pattern Recognition, vol. 38, no. 4, pp. 559–576, 2005. View at Publisher · View at Google Scholar · View at Scopus
  24. H. Y. T. Ngan and G. K. H. Pang, “Novel method for patterned fabric inspection using Bollinger bands,” Optical Engineering, vol. 45, no. 8, Article ID 087202, 2006. View at Publisher · View at Google Scholar · View at Scopus
  25. H. Y. T. Ngan and G. K. H. Pang, “Regularity analysis for patterned texture inspection,” IEEE Transactions on Automation Science and Engineering, vol. 6, no. 1, pp. 131–144, 2009. View at Publisher · View at Google Scholar · View at Scopus
  26. M. K. Ng, H. Y. T. Ngan, X. Yuan, and W. Zhang, “Patterned fabric inspection and visualization by the method of image decomposition,” IEEE Transactions on Automation Science and Engineering, vol. 11, no. 3, pp. 943–947, 2014. View at Publisher · View at Google Scholar · View at Scopus
  27. C. S. C. Tsang, H. Y. T. Ngan, and G. K. H. Pang, “Fabric inspection based on the Elo rating method,” Pattern Recognition, vol. 51, pp. 378–394, 2016. View at Publisher · View at Google Scholar · View at Scopus
  28. H. Y. T. Ngan, G. K. H. Pang, and N. H. C. Yung, “Motif-based defect detection for patterned fabric,” Pattern Recognition, vol. 41, no. 6, pp. 1878–1894, 2008. View at Publisher · View at Google Scholar · View at Scopus
  29. H. Y. T. Ngan, G. K. H. Pang, and N. H. C. Yung, “Patterned fabric defect detection using a motif-based approach,” in Proceedings of the 14th IEEE International Conference on Image Processing, ICIP 2007, pp. II33–II36, USA, September 2007. View at Publisher · View at Google Scholar · View at Scopus
  30. F. Pukelsheim, “The three sigma rule,” The American Statistician, vol. 48, no. 2, pp. 88–91, 1994. View at Publisher · View at Google Scholar · View at MathSciNet
  31. N. Lazarevic-McManus, J. Renno, and G. A. Jones, “Performance evaluation in visual surveillance using the F-measure,” in Proceedings of the 4th ACM International Workshop on Video Surveillance and Sensor Networks (VSSN '06), pp. 45–52, Santa Barbara, California, USA, October 2006. View at Publisher · View at Google Scholar
  32. Y. J. Huang, R. Powers, and G. T. Montelione, “Protein NMR recall, precision, and F-measure scores (RPF scores): Structure quality assessment measures based on information retrieval statistics,” Journal of the American Chemical Society, vol. 127, no. 6, pp. 1665–1674, 2005. View at Publisher · View at Google Scholar · View at Scopus