Fabric Defect Detection Based on Pattern Template Correction

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.


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: (1) defect position locating, (2) defect shape outlining, (3) detection time consumption, and (4) detected results evaluation.
The patterned fabric detection methods can be further classified into three categories: (1) partition-matching approach, (2) statistical approach, and (3) 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 twostep 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.

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.

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.
where  2 (, ) 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,  2 (, ) is defined as 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  1 ,  2 , . . .,   and the minimum values obtained in the horizontal direction are  1 ,  2 , . . .,   ,  and  are defined as (8).Segmentation on images are shown in Figure 1.
In Figure 1, the size of the box pattern is 24 × 26, the size of the star pattern is 16 × 21, and the size of the dot pattern is 36 × 27.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 240 × 234, the size of resultant starpatterned images is 240 × 252, and the size of resultant dotpatterned images is 252 × 243.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.

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,  * ∈ [0,  − 1], and  * ∈ [0,  − 1]. V and  ℎ are two matrices sizes of  ×  and  × , which are denoted as follows: The specific process of correction is shown in Figure 2.
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   ,  = 1, 2, . . ., ,  = 4 × , are used for establishing the template.
where TM represents the template and which is corrected according to  1 represents the corrected   and  1 =  1 .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.

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 TM.In order to reduce the influence of illumination variations,  and TM have been centralized in advance., , and  in ( 2) and ( 3) are modified as where  and TM are mean values of  and TM, respectively.
Suppose  is a defect-free lattice, the subtraction matrix between  and TM 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,  ,TM New ≈ (1/(×)) ∑ |−| ≈ 0. Similarly,  ,TM New ≈ 0. Suppose  is a lattice with defect, the subtraction matrix between  and TM can be denoted by where  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,  = 30 − ; for star-patterned fabric,  = 25 − ).After segmentation and correction, we compute the values of  and  between the corrected lattice and the template.The corrected lattices are denoted as   , where  = 1, 2, . . ., ,  = 1, 2, . . ., .  = 90 for box-patterned fabric,  = 180 for star-patterned fabric, and  = 63 for dot-patterned fabric.The maximum  and  values are denoted as   = max(   ,TM NEW ) and   = max(   ,TM NEW ), and the boundaries BE and BV are defined as 3.4.Testing Phase.The testing phase of the TC method includes two steps: defective lattices locating and defect shape outlining.
( (2) Defect Shape Outlining.In order to figure out pixellevel results after locating defective lattices in the images, we propose a segmentation method based on threshold.For each detected defective lattice LD, we can get a binary resultant lattice through following equation: where TM 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 LD 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 LD: where  V and  ℎ are matrices defined in (10);  and  are the sizes of LD.For each detected defective lattice LD,  and  are calculated in (9).

Performance Evaluation
In 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.

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 manuallabeled 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  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,  = 15 and  = 3 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  = 2 and  = 3 are close, which means  = 2 and  = 3 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  = 3.It is clear that when  increases, some small white dots are removed.The detection results are more accurate as analyzed above.

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).
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.
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.

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, (1) numerical and graphical results and (2) 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 256 × 256.
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 boxpatterned 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., 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.
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).
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  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.
(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.
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(

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 dotpatterned 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.

Figure 2 :
Figure 2: The process of correction.

Figure 4 :
Figure 4: Differences of several images when parameter k changes.

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

Figure 6 :
Figure 6: Several detection results of TC locating and TC outlining.
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).
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 256×256 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 starpatterned 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.

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

Table 2 :
Numerical results of different methods on box-patterned fabric.

Table 3 :
Numerical results of different methods on star-patterned fabric.