Abstract
This article deals with fabric defect detection. The quality control in textile manufacturing industry becomes an important task, and the investment in this field is more than economical when reduction in labor cost and associated benefits are considered. This work is developed in collaboration with “PARTNER TEXTILE” company which expressed its need to install automated defect fabric detection system around its circular knitting machines. In this article, we present a new fabric defect detection method based on a polynomial interpolation of the fabric texture. The different image areas with and without defects are approximated by appropriate interpolating polynomials. Then, the coefficients of these polynomials are used to train a neural network to detect and locate regions of defects. The efficiency of the method is shown through simulations on different kinds of fabric defects provided by the company and the evaluation of the classification accuracy. Comparison results show that the proposed method outperforms several existing ones in terms of rapidity, localization, and precision.
Introduction
As the global market puts higher and higher demand on product quality, automated inspection has increasingly developed in recent years in all areas such as manufacture of mechanical parts and electronic boards.1–6
Defect detection is one of the main steps in quality control in industry. Various defect detection systems are now installed in different production lines such as defect detection of tiles, 7 woods,8,9 ceramic, 10 and sheet steel. 11
In fabric manufacturing, about 85% of the defects found in the garment industry are caused by fabric defects. Consequently, it becomes imperative to detect and prevent any defect from appearing.
A fabric defect can be considered as a variation of the neighborhood property caused by a wired variation with respect to the overall surface aspect. In our country Tunisia, a large part of the national economy is based on textiles. Until now, some industries have not yet installed automated defect detection systems and they use simple human inspection. This leads to multiple errors due to many reasons, namely, the fatigue and fine defects. Automated fabric inspection is at least four times faster than visual inspection. 6 Hence, the automation of these operations helps to improve quality and to reduce labor costs.
In this framework, this work is developed in collaboration with “PARTNER TEXTILE” company from Tunisia. 12 This is later specialized in the manufacture of different fabric types. Due to the huge production capacity (about 6 tons/day), the company aims at equipping its machines by efficient defect detection systems that can be easily installed around circular knitting machines (Figure 1).

Circular knitting machines.
In literature, one can find variety of image processing methods and propositions for automated defect detection. Some of these methods cannot be easily used or installed in the production lines for several reasons, namely, the complexity, the limitation on a very special type of images, the non-robustness to noise and to reasonable variations of the image or the object shapes, and the imprecision.
To develop defect detection methods, several methods based on signal and image processing tools have been used in literature such as co-occurrence matrices, correlation and covariance matrices, Fourier and wavelet transform, and distance and gradient approximation.
In Latif-Amet et al., 13 authors proposed a combination strategy between wavelet transform and co-occurrence matrices to develop a defect detection algorithm for textile images. Gabor filters (GFs) have been likewise widely used in the field of fabric defect detection. Methods based on GFs can be classified into two types. The first consists in the use of a filter bank, such as in Kumar and Pang. 14 The second consists in the search for the optimal filters, such as in Hamid et al. 15 and Bodnarova et al. 16 Note that the use of a filter bank generates in general excessive data, which becomes sometimes hard to deal with.
Viewed as exceptional and robust classification tools, neural networks have been widely used in the field of defect detection. Indeed, by choosing appropriate features, an artificial neural network can be applied to classify and separate defects from defect-free regions. Due to their generalization capacities, neural networks can efficiently surpass the problem of feature variations in the same defect-free regions as well as in regions with defects. For example, Kumar 17 used a multilayer neural network to classify principal components of regions with defect and with no defects. Principal components are extracted directly from each pixel within its neighborhood. In Huang and Chen, 18 a neural network with fuzzy logic strategy was used to propose a classification algorithm of eight different fabric defects.
In this work, we develop a new defect detection method based on polynomial interpolation of a set of a pixel and its neighborhood to extract feature database to be used to train a multilayer perceptron (MLP). The presented method highlights several other existing methods in terms of rapidity, localization, and precision.
The efficiency of the method is shown through simulations, the evaluation of the classification accuracy (CA), and comparisons. For simulations, we used a set of 76 images provided by the company. In these images, defect areas are well known and localized by the experts of the company.
This article is organized as follows: in section “New defect detection scheme,” a description of the new defect detection scheme is provided, while in section “Newton form of the interpolating polynomial and its application to the
New defect detection scheme
The key issue in the texture defect detection field is to determine the way by which one can characterize the texture (i.e. the use of appropriate models or discriminant features). Then, the defect detection involves searching the variations in the model or its features.
Due to the wide variety of textures, an exhaustive determination of all feature sets to characterize these textures is a tedious task. In order to overcome these difficulties, we propose to characterize the texture by a set of interpolation polynomials for each pixel with respect to its neighboring pixels defined by a pre-chosen mask. In image processing, the choice of the appropriate mask is an important task and plays a significant role in the final results. In this work, we propose to use a

Definition of the neighborhood of a central pixel in a 7 × 7 macro window forming a
This

Approximation of the neighborhood directions of a pixel by interpolation polynomials: (a) texture example, (b) zoom of the masked part, and (c) principle of the approximation by polynomials in different directions.
The global defect detection scheme is shown in Figure 4.

The global defect detection scheme.
In Figure 4, we start by scanning the input image according to the chosen mask and eliminating the corresponding mean. After that, coefficients of the interpolating polynomials are computed for each pixel and then propagated to a neural network (trained beforehand to distinguish between pixels located in defect regions and those in defect-free regions). For the learning phase, different texture features for regions with and without defects are presented to the neural network. Supervised learning is used in order to force the network to recognize features of regions with defects and the others without defects.
In the following, the mathematical foundation of the polynomial interpolation and the computation of the different polynomial coefficients serving as input features to the neural network will be developed.
Newton form of the interpolating polynomial and its application to the V 24 neighborhood
Newton interpolation is the most commonly used method for obtaining the interpolating polynomial. Let’s give the following theorem:
Theorem 1
Let
This is equivalent to the determination of the set of reals
where
and
The polynomial
Definition 1
Let f be a function defined in real distinct points
Then, the following proposition comes.
Proposition 1
The following theorem (Newton form) allows to construct the interpolation polynomial using the divided differences.
Theorem 2
The interpolation polynomial
In each direction in the
To preserve the pixel dispersion properties (mainly distances between pixels), we use for directions 0 and

Definition of the steps and the corresponding interpolating points with respect to the mask directions for each pixel.
Functions
Let
Consequently, each pixel will be characterized, with respect to its neighbors, by 28 coefficients. Let us define for a pixel
For quick simulations and tests, we provided in Appendix 2 the mathematical expressions of the interpolating polynomial coefficients. For textures having some regular regions, there will be many redundant information when scanning the whole of the image. This observation helps at removing repetitive feature vectors and then reducing the number of the learning features for each texture. This will be very useful for the real-time implementation in a further work. In the following, the MLP as well as the learning algorithm are presented, and then, the simulation approach and the generalization results are given.
MLP description
The first step to use a neural network consists in preparing the learning database. Hence, the learning dataset must be formed with two types of feature vectors, namely, one type with defect-free regions and another type with multiple defects.
The neural network architecture is given in Figure 6. It is a fully connected feedforward neural network based on the connection of many single neurons as given in Figure 7.

Fully connected multi-layer perceptron.

A model for a single neuron (perceptron) in an MLP.
The subscript “
The learning algorithm used in this work is the modified backpropagation algorithm presented in Abid et al. 20 The major advantage of this algorithm lies in its rapidity of convergence for a quite small modification in the updating equations with respect to the standard backpropagation algorithm. It is based on the optimization of a cost function written as sum of the linear and the nonlinear errors of the output neurons.
The cost function (optimization criterion) is given by equation (16)
where
and
where
The different steps of the modified backpropagation algorithm are given in Appendix 3; for more details, see Abid et al. 20
Simulations
Database presentation
The database of images serving as benchmarks is provided by “PARTNER TEXTILE” company. It consists of mainly 76 images (256 × 256 pixels), having various fabric defects; 50 images are used for the training phase (about two-third of the dataset), and the other 26 are used for test. A summary of some fabric defect types used in this study and their related reasons for appearing are well described in a previous work. 21 Figure 8 gives some of these defects.

Some of fabric defect caused by a knitting machine.
Simulation description and results
All simulations were performed on personal computer (Intel Core i5-4210U CPU at 1.70 GHz, 2.40 GHz and 6Go of RAM). All programs were tested first in MATLAB language, and then, they were rewritten in C++ language for real-time implementation.
Each image is preprocessed by a median filter to eliminate pixels having high gray levels with respect to their neighborhoods. For each image, we fixed two sets of regions of interest (ROIs), one set corresponds to defect-free regions and the other set corresponds to regions of defects. For each pixel of these regions, we compute the polynomial coefficients and then we propagate them into the network.
In this work, we used a single hidden layer network with 28 inputs (which is the number of the polynomial coefficients) with an additional special input for the bias term, one hidden layer, and one output neuron. The activation function is the sigmoidal one. If the input feature corresponds to a defect-free region, then the desired output is equal to 0.8; otherwise, the network response is equal to 0.2. The different other network parameters are chosen after several simulations to maximize performances of the network (such as the number of the hidden neurons, the learning coefficient, and the sigmoidal slope).
Figure 9 shows the learning curve with respect to the iteration number. The maximum iteration number is chosen equal to 104. In simulations, we tried to avoid the overtraining (i.e. we avoid that the final global error

Representation of the learning curve with respect to the iteration number.
In the generalization (test) phase, we used two sets of images. The first contains the images themselves used in the training phase. This is to verify that the network gives good results for regions that were not selected by the ROIs in these images. The second set is formed with new images from the 26 ones that have not been used in the training phase. Figure 10 gives some simulation results for the second set of images.

Simulation results of the new defect detection scheme:
From the results of the generalization phase shown in Figure 10, one concludes that the new method allows good defect detection for different kinds of defects. Figure 10(c1)–(c3) shows good defect localization while preserving the defect shape. In the following, we shall evaluate the performance of this new approach.
It is important here to give some idea about the acquisition conditions of the different images. Indeed, each knitting machine has been equipped by one light-emitting diode (LED) Batten having the following characteristics: surface-mount device (SMD) LED, 50 W, 3900 Lumens, 1500 mm of length, and 120° lighting angle. Since images are taken while knitting, a progressive scan camera is chosen for each knitting machine. For this purpose, a monochrome digital progressive scan camera is chosen for each machine with time refresh equal to 1/30 s.
Performance evaluation and comparison results
The performance of the proposed approach is treated through the evaluation of the CA known also as the detection success rate. This is later defined as the ratio between the total number of correctly classified samples and the total number of samples
where
For this purpose, we used the 50 images used in the learning phase and the 26 images from the dataset reserved for the generalization phase as mentioned above. In these images, defects are known and well localized to be able to compute exactly the
Table 1 gives an evaluation of the CA for the different regions. Recall that in the learning phase, we select the ROIs, but in the generalization phase, we scan the entire image. These results show the very good classification of the new approach. We note that for the 50 images used in the training phase, we do not have 100% CA; this is due to some new regions (not selected by ROIs in the learning phase) which are characterized by an acute dissimilarity with respect to the general aspect of the texture while being considered defect-free regions. The general
The uniqueness of the interpolation polynomial for a given set of points
The slight variation of the related coefficients for a slight variation of
The classification accuracy of the new method for both training and test images.
Comparison with previous works
The performance of the proposed method is compared with previous works22–24 and the work of Rebhi et al.
21
The wavelet transform and morphological mathematics (WT/MM) were used with an MLP to develop a new approach for defect detection in textured images.
22
In this work, the Dempster–Shafer theory of evidence was used to combine different evidences and to decrease the value of uncertainty. For the same purpose, Zhang et al.
23
used the principal component analysis (PCA) of a matrix formed with the gray level of each pixel and a radial basis function (RBF) neural network (PCA/RBF). The obtained method reaches a
Comparison of the classification accuracy of the proposed method with respect to several existing ones.
WT/MM: wavelet transform and morphological mathematics; GF/SC: Gabor filter and sparse coding; PCA/RBF: principal component analysis/radial basis function; LHA/DCT: local homogeneity analysis/discrete cosine transform; PIC/MLP: polynomial interpolation coefficients/multilayer perceptron.
Conclusion and perspectives
In this work, we proposed a new method for defect detection in fabrics. This method provides good detection and localization of different types of defects. The CA reaches about 99% for the set of images provided by the company. This rate shows the superiority of the method with respect to several other methods. It is important to note that the proposed approach can be applied for plain fabrics as well as for printed fabrics. Nevertheless, for black colored fabrics, the method may not be suitable in this presented form, and other preprocessing operations must be applied such as histogram translation and/or contrast enhancement. The implementation of this new algorithm in the production line of “PARTNER TEXTILE” company imposes moreover several simplifications which will be presented in a further work.
Footnotes
Appendix 1
Appendix 2
Appendix 3
Acknowledgements
The authors would like to thank Mr Mohamed Ali Derbel, Manager of the “PARTNER TEXTILE,” for the opportunity he offered us to work in this company allowing us to see closely the real problems that the engineer may encounter, for the instructive discussion, and for the database he provided.
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.
