Abstract
An effective defect detection scheme for textile fabrics is designed in this article. Interestingly, this approach is particularly useful for patterned fabric. In the proposed method, firstly, Gabor filter is adjusted to match with the texture information of non-defective fabric image via genetic algorithm. Secondly, adjusted optimal Gabor filter is used for detecting defects on defective fabric images and defective fabric images to be detected have the same texture background with corresponding defect-free fabric images. The significance of the proposed approach lies in selecting Gabor filter parameters with an abundance of choices to build the optimal Gabor filter by means of genetic algorithm and achieving accurate defect detection on patterned fabric. High success rate and accuracy with little computational time online are obtained in the defect detection on fabrics, which indicate that the suggested method can be put to use in practice.
Introduction
Flaws on textile fabrics have a great influence on selling price and price reduction ranges from 45% to 65% [1] in the original price of a product. At present, artificial detection occupies main position in the real fabric detection but has a lower detection success rate at the slower speed of 15–20 m/min [2]. It is investigated that the accuracy of artificial detection is merely 60–70% [3]. As a result, many commercial detection systems are considered to replace artificial detection, for instance, employment of I-TEX inspection system [4,5]. However, high hardware maintenances lead to the fact that application of I-TEX inspection system is limited. Realizing fabric detection method in software as well as turning costs lower on hardware equipments and maintaining from fabric detection systems are the goals to attain in the future.
A series of algorithms on the basis of software are presented in fabric detection now. Thereinto, three general types of fabric detection approaches are, respectively, based on the statistical, the model [6] and the spectral methods [7,8]. Statistical approach puts fabric images into the operation that the properties of texture features of input fabric images defined by a measurement of ‘energy’ [9] in a window about each pixel in every response image are captured. Conci and Proenca have utilized the estimation of fractal dimension (FD) [10] on input images for the sake of inspecting fabric defects. In order to dispose image information, different boxes are counted with a few modifications to minimize the complexity of computation and improve the efficiency. But the only weakness is poor localization accuracy in defect detection with high FA. The advantage of model method is that semblable textures can be structured to match the observed textures. Cohen from Drexel University of American devotes himself to automated inspection on textile fabrics using Gauss Markov random field [11] whose parameters could be obtained from defect-free fabric images with ideal detection results. But this method has its own disadvantage, such as hardly decreasing the complexity of analysis on input images. Therefore, fast detection on textile fabrics could not be realized. Spectral method is unsuitable for random textured materials. Tsai et al. [12,13] inspect defects in the directional textures with a combination of discrete Fourier transform, which can preserve the local defects and remove all homogeneous and directional textures from the initial gray-level images. However, manipulating the frequency components associated with homogeneous non-defective regions could bring enormous influences on frequency components of defective regions.
Proofs in many research works prove that Gabor filter widely used in the field of fabric defect detection uniquely has an optimal localization in both space domain and frequency domain with multiple orientations and dimensions. In general, defect detection methods based on Gabor function could be classified into two portions: one category is adding a succession of Gabor filters to characterize channels to draw a fine detection results on fabrics and the other method is selecting optimal filters. In fact, this article proposes an effective method by way of building optimal Gabor filter with selected parameters to solve encountered problems in fabric detection. Gabor filters are coordinated by stainless fabric images in objective function, and genetic algorithm is wielded to get the minimum of objective function, thus finding suitable parameters to generate optimal Gabor filters. Extracting effective texture features via optimal Gabor filters on textile fabrics can lead to an excellent consequence on fabric defect detection. The performance of Gabor filter depends on the parameters, which could be selected by genetic algorithm automatically. Based on this idea, the new method for defect detection on fabrics could be obtained. The whole proposed method includes the training part and the defect detection part, whose descriptions are shown in Figure 1. Escofet et al. [14] have used a mass of multi-scale and multi-orientation Gabor filters to detect fabric defects, which could prove that a bank of Gabor filters are suitable to characterize texture features from textile fabrics. The disadvantage of above-mentioned approach is that using plenty of filters causes a huge computational burden, thus preventing real-time effective implementation. Compared with Escofet’s method, two advantages of the proposed method are that ideal defect detection results on pattern fabrics are obtained and less calculated quantities are implemented.
Fabric defect detection method on constituting optimal Gabor filter by using genetic algorithm.
Gabor function
A two-dimensional (2-D) Gabor function is a complex exponential function assigned by the given sinusoidal wave frequency

Outline drawing for the real part (a) and imaginary part (b) of a basic Gabor function.
Structure optimal Gabor filter and flaws detection
Select proper Gabor function
Based on 2-D Gabor function equation (1), the real part of 2-D Gabor function is sufficient to defect detection, and thus only the real part is used as filter function. The main reason is that the imaginary part not only requires a mass of calculations but also contributes little to defect detection. Therefore, Gabor filter function can be formulated as equation (6):
2-D Gabor functions can be built by rotating and zooming the basic Gabor function. The specific direction and size have strong influence on fabric defects. Therefore it is important to search optimal Gabor filter in arbitrary orientations and sizes. The superb effect of real part of 2-D Gabor function via increasing center frequency with A group of Gabor filters from five dimensions (center frequencies) and six orientations in space.
Determine optimal Gabor filter parameters
A similar idea mentioned in the former research [19] is selecting optimal Gabor filter, According to this thought, it is concluded that optimal Gabor filter decided by parameters should own the most similar envelope with gray-level distribution of non-defective fabric images to conform to texture feature information. To build an optimal Gabor filter, the following objective function shown in equation (7) should be optimized:
Genetic algorithm
Genetic algorithm [20] is a random search method. It is structured by imitating genes. One of the characteristics of genetic algorithm is doing nothing with decisive variables straightforward but to intersect and mutate codes from individuals. Finally, optimal or approximate solution with higher fitness would be sought out by selection, crossover and mutation, thus practical problems can be solved. Genetic algorithm is used in the previous research [21] to search the optimal parameters. But unlike parameters and diverse way of individual, structures in proposed genetic algorithm are designed. Genetic algorithm can be divided into four steps as follows:
Initial population: Initial population [22] is constructed by binary codes in line with genes from chromosomes to achieve operations effortlessly in algorithms. Selection: Optimal group in population is inclined to the lower results of objective function Crossover: Crossover is mutual exchange in two selected individuals with a certain probability at some point of two individuals. The example recorded in Table 1 shows the process of crossing binary codes. Mutation: Mutation operator takes some point from each individual into a reverse operation with a certain probability, namely exchange 1 to 0 or 0 to 1 [23]. Crossover operation in two individuals.
The whole program of genetic algorithm is shown in detail in Figure 4. Through the process of genetic algorithm, the most suitable parameters would be obtained to make great contributions to the construction of optimal Gabor filters
Block diagram of genetic algorithm.
In genetic algorithm, Gabor filter parameters in objective function
(a) Expression of a minimum parameter group and (b) exhibition of a maximum parameter group.
ω is a coefficient for controlling the relationship of Gabor function and normal fabric.
λ is the variance ratio between
θ rotates the values
The experimental results show that the parameters obtained by genetic algorithm have to be dealt with the following procedure [24] in equation (8). The aim of operation is to adapt to fabric texture and end with perfect defect detection.
Filtering an image with optimal Gabor filter
For a sample fabric image
Binarization in filtered images
Before binarization, a simple
Thresholds determination
In this step, we choose central widow
Defects segmentation
In this procedure, gray values between thresholds
Experimental results
Numerous common fabric samples including 80 fabric images with 40 non-defective images are needed in defect detection experiments to evaluate the performance of the proposed method. The experimental images acquired by using a CCD camera satisfy the definition of fabric defects from TILDA database [27] in the textile industry.
In parameters selection procedure of genetic algorithm, the target is choosing a minimum result (a) normal patterned image, (a1), (a2) and (a3) homologous statistical results E of equation (7) from 300 parameter groups in genetic algorithm on image (a), (b) normal patternless image, (b1), (b2) and (b3) homologous statistical results 
Possible results from fabric defect detection obtained in binary images are of four types [28]: namely overall detection (OD), true detection (TD), misdetection (MD) and false alarm (FA). True detection (TD) is the white area of binary images as same as the corresponding defects in original fabric image. FA binary images contain the white area of the corresponding defect regions in the fabric image and include the other white regions away from the defective areas. OD is the combination of TD and FA. MD regards defects as normal textures, which has no white areas in the binary output image.
Fabric detection types in the output binary images.
Optimal Gabor filters with selected parameters gain from the training step by virtue of genetic algorithm. It is interesting that one optimal Gabor filter could only demonstrate the perfect defect detection on the specific fabric texture, and various defect inspections using the optimal Gabor filter on the specific texture fabric are pretty well. Perfect consequences of diversiform flaw detections on patterned fabric images distribute in Figure 6 including defect-free images, blemish images, filtered images and binarization images. Figure 7 shows corresponding experimental results from patternless fabric images. The whole images from detection results relate to 11 fabric textures and serve multifarious flaws on each fabric texture, for example, Figure 6(a) and (b) possess an identical fabric texture but disparate stains. The parameters of determined optimal Gabor filters from 11 unlike fabric textures are spread out in Table 4.
The TILDA database images: (a) c3r1edvn, (b) c3r1edzw, (c) c3r1eeaa, (d) c3r3eexn, (e) c4r1efqg, (f) c4r1e4n8, (g) c4r3egpa, (h) c4r3eglz, (i) lockeaal, (j) ziese1 and (k) ziese2. Corresponding consequences with Gabor filters include non-defective images, defective images. The TILDA database images: (a) c2r3eczc, (b) c2r2eckm, (c) c2r2econ, (d) c2r2ecme, (e) c1r1eajo, (f) c1r1eadd, (g) c1r1eajr, (h) c1r3ebnw, (i) c1r1e4n1, (j) c1r1eaep, (k) c1r3ebox, (l) c1r3ebmh, (m) c1r3ebrh and (n) c1r3ebmu. Corresponding consequences with Gabor filters include non-defective images, defective images, filtered images and binarization images (a–n). Parameters of optimal Gabor filters from 11 fabric textures.

The parameters of Table 4 in Gabor filter could obtain ideal defect detection results. Most diverse textures have different parameter groups. Sometimes, inequable textures may hold same parameter group. The main reason is that fabric images have relative similar pixel distributions, although textures are different. Compared with the same textures Figure 6(a) and (b), Figure 6(c) with a distinctive filtered image roots from the settings of parameters
Conclusion
A supervised method has been proposed in this article including training and detection. In the training section, Gabor filter
Footnotes
Funding
The authors gratefully thank the Scientific Research Program Funded by Shaanxi Provincial Education Department(Program 2013JK1084) and Xi'an Science and Technology Bureau Project (Project Numbers: CX1257).
