1 Introduction

The economy of India depends mostly on apparel or fashion industries which are concerned mainly with yarn and fabric manufacturing [29]. Textile is one of the Indian economy’s oldest industries in India dating back to several centuries. India’s total textile exports in the financial year 2017–2018 stood at US$ 39.2 billions and was expected to rise from US$ 31.65 billions in the financial year 2020 (up to January 2020) to US$ 82.00 billion by 2022 [58].

The aim of all textile industries is to produce profitable fabrics with good quality and valuable materials than any industry. Due to faulty fabrics, there have been an increased number of failures in the textile industry. Any abnormality in the material is a textile defect and shade variation prohibits the users from accepting the fabric.

If the faults of fabrics are not accurately identified, the production process will have a huge impact upon the profit. The fabric texture typically consists of the repeat structure in the warp and weft. The warp is known as the longitudinal thread and the weft or filling are the lateral threads. This process of interwoven threads influences the properties of textiles [29]. Many defects are caused directly by machines, while others are produced by defective yarns [23]. The classifications of defect and their effects upon the fabric are shown in Fig. 1 [32, 62].

Fig. 1
figure 1

Classifications of defects and their effects

Some of the common cloth defects are shown in Fig. 2. It is a difficult task for inspectors to manually detect the defects in a fabric quality control system. It has been found that due to the flaws that occurr during manual operation, the cost of cotton fabric is decreased by 50% to 70% [72]. This manual identification by human beings work is extremely time consuming and repetitive. Small defects are to be identified in the field of vision in a wide field. The level of acceptance is only approximately 70% [47]. Early and reliable identification of fabric defects is an important aspect for the development of materials for further processing. Figure 3 presents a comparison of human visual inspection and automated inspection [52]. Taking into account, the inspection parameters like defect detection rate and response time, the automated inspection appears to be preferable method for defect detection in fabrics than the manual inspection. In recent years, a computer vision technique has been used for the design of automatic identification and classification systems for textured patterns [54].

Fig. 2
figure 2

Various types of fabric defects [52]

Fig. 3
figure 3

Comparison of human and automated defect inspection [52]

Automatic fabric defect detection systems primarily face two challenges: 1. defect detection 2. defect classification. Image processing plays an essential role in the evolution of automatic detection of defects by following the processes as like image collection, image segmentation and selection of features. The distinguishing characteristics should be strong and the amount of features should be low in order to choose an acceptable set of properties [46]. The neural networks and categories of decision making trees [2] are sufficient to develop real time systems because of their parallel processing power. In addition, neural networks have a strong capacity and reliability to deal with multi-class classification issues. Categorization, accuracy, complexity of model and training time are the four important performance metrics in neural network models. This paper deals with the major past attempts in designing cotton fabric inspection systems, computer vision platforms and machine learning algorithms like automated fabric defect neural networks and shade variation detection and it proposes a method of the fabric and shade variation detection using structural, statistical, spectral, learning approaches and some hybrid approaches. The performances of these approaches are analyzed.

2 Literature review

Different researchers have suggested different approaches for the identification of textile defects by using digital processing of images during the last decade. Hanbay et al. (2016) have studied the fabric defect detection techniques and compared all the techniques presented up to the year 2016 [21]. In this paper, the methods for detecting fabric defects are divided into six approaches as shown in Fig. 4. This paper is also structured in the same way to analyze the approaches as given in Fig. 4 for the years 2017 to 2020.

Fig. 4
figure 4

Different approaches for detecting fabric defects

2.1 Structural approach

Structural approaches view defects as a textural primitives composition. Analysis of the texture is carried out by obtaining the features of the texture and inferring their rules of replacement. According to structural approach, with the composition of basic texture structures, the overall texture of the fabric pattern can be obtained. Examination of structural texture involves two concurrent stages: detection of basic texture of cloth and the pattern of the overall texture of the material [21]. Different types of structural approaches are shown in Fig. 5.

Fig. 5
figure 5

Types of structural approach

2.1.1 Edge features

Edge detection is a type of non-continuity based image segmentation method. Image edge detection is one of the basic contents of image processing and analysis. The method of identification and extraction of the edges and outline features is popular task in the field of image processing and analysis [9].

Liang Jia et al. (2017) have developed the Isotropic Lattice Segmentation (ILS) based fabric defect detection. In this, the images are divided into a number of small images and then compared with the ground images and the detection rate of 95.5% is obtained. The system is limited as it suffers from longer computation time. Essentially, the results are derived mainly from the segmentation of the images which leads to the production of weaker results [27]. Liang Jia et al. (2018) also have proposed another method with a small modification in the previous one. In the study, the image is divided into texture classes. So the texture category is modeled by several models based on a priori defined metrics depending on their inspection efficiencies and the resulting areas under curves by receiver operating characteristic is 0.81 [41]. Liang Jia et al. (2019) have imposed a technique based on lattice segmentation and template statistics. In this new technique, the images of patterned fabric with simple repetitive texture are focused. A total detection rate of 97.7% is achieved by comparing the resultant and the ground truth images [42] .The limitation of the above technique is that it requires a huge number of training which leads to bigger memory size and it is a time consuming process.

2.1.2 Morphological filtration

Mathematical morphology is a method of extraction of features based on preliminary object geometry data. It is the basic operation of expansion, erosion, opening and closing [21]. A small cluster is designed to analyze a morphologic operation called the configuration element.

Namita Kure et al. (2017) have proposed a method for identifying fabric defects based on an analysis of local neighborhood. By shifting the local neighborhood window over the defect image, the complete image was checked in the local neighborhood algorithm. Coefficient of variance is used for the calculation of homogeneity. The peak value of coefficient of variance depicts that there is a flaw in the fabric. Thresholding is used to segment the defected fabric image. Deficient region and defect-free region are the parts of defect images. The defective region is an abnormal area being unevenly distributed by pixel grey mutation. Homogeneity reflects mainly the distribution of grayscale in relation to the fabric image of local information. The above-mentioned coefficient of variation can well reflect the distribution of data. Consequently, the variation coefficient can be used to test whether defects exist in the image or not. An image matrix of N rows and M columns can be seen for an image I of size MxN. I (x,y) is the appropriate coordinate grey value (x,y) where x = 1, 2,.., M, y = 1, 2, …. N. P(x, y) defines the pixel Local Homogeneity Measurements (LHM). Let W = 2 w + 1 for some integer and w be the size of a nearby window centered on the pixel P(x,y). The Coefficient of variance Cυ(x,y) is calculated using the Eqs. (1) to (3).

$$ {\mu}_{x,y}=\frac{\sum_{i=w}^w{\sum}_{j=-w}^wI\left(x+i,y+j\right)}{W\times W} $$
(1)
$$ {\sigma}_{x,y}=\sqrt{\frac{\sum_{i=w}^w{\sum}_{j=-w}^w{\left(I\left(x,y\right)-{\mu}_{x,y}\right)}^2}{W\times W}} $$
(2)
$$ {C}_{\upsilon}\left(x,y\right)=\frac{\sigma_{x,y}}{\mu_{x,y}}\times 100\% $$
(3)

where, 휇x,y is the gray value of pixels within the locality window, 휎x,y is the standard deviation and Cv(x, y) is the neighborhood homogeneity measure value. The morphological filtration of defect segmented image is used to boost faulty area and the accuracy of cross validation for this LHM method is obtained as 96.40% [33]. The window size is calculated by W = 2w + 1 and the calculation method used is not a standard one and thus there is a decrease in the accuracy [53].

Vladimir et al. (2019) have proposed a digital image processing method promising higher speed and accurate identification of defects and their origin than human vision. In this method the weft and warp pattern position are assessed for the presence of defect. Weft and warp patterns can differ depending on the type of fabrics. A good fabric test pattern is used to identify and diagnose the fabric defect with the same pattern. The experiment demonstrates the outcome of effective defect detection with a rate of 95% [65]. Five real fabric images are used for the experiment, which are not adequate to detect all the 34 types of commonly occurring fabric defects.

2.1.3 Low rank decomposition

Venkat Chandrasekaran et al. (2009) have proposed a low rank decomposition approach in which a complex system is broken down into simpler components for better understanding of the behavior of the system. Systems are represented as statistical model matrix in which matrices are created by adding sparse and low-rank matrices together. This helps to decompose the larger data into smaller data set [6]. It splits a matrix into three variables as given in Eq. (4).

$$ \mathrm{X}=\mathrm{L}+\mathrm{S}+\mathrm{N} $$
(4)

where X is a matrix of input, L is a matrix of low rank, S is a matrix of sparse whereas N is a matrix of Gaussian. The objective function of low rank decomposition is given in Eq. (5)

$$ \underset{L,S}{\min }{\left\Vert X-L-S\right\Vert}_F^2s.t.\mathit{\operatorname{rank}}(L)\le r,\mathit{\operatorname{card}}(S)\le k $$
(5)

where r and k indicate the upper rank of L and S (Cardinality), respectively [66].

Wang et al. (2017) have described a method based on the knowledge that textured fabrics typically form lower rank structures infringed by the existence of defects. This method considers that the defects are usually continuous regions and the measurement of defect levels is correctly solved by introducing an integration mechanism and the fault measure value for this method is 79.54%. [66]. Approximation of the low-rank matrix cannot be appropriate for complex, large-scale, damaged texture imaging. Huangpeng et al. (2018) have proposed an automatic identification of visual defects using prior and low ranking textures with a detection accuracy of 99%. The limitation of this method is that the output is partly dependent on the prior map’s value [24].

A novel method for detecting fabric defects based on the low-rank dual standard decomposition is proposed by Wang et al. (2019). By using Gabor transform, the matrix of features are generated. It causes the history to lie in a subspace of low rank. Then the method of low rank dual standard decomposition was adopted to divide the matrix into low-rank (background) and non-low-rank (defect) sections. In this method, the image based result is analyzed [67]. The model’s non-convexity can prevent a global solution. A patterned approach for detecting fabric defects is proposed by Li et al. (2019) based on a new descriptor of texture and a low-rank template of decomposition. First, an effective second order orientation aware descriptor, referred to as Gradient Histogram of Gradients (GHOG), is constructed by combining Gabor with an oriented GHOG histogram. Further, a spatial pooling technique based on human vision system is used to further boost the proposed descriptor’s ability to discriminate. The running time is 0.27 s for detecting one image [40]. The drawback of this method is that it requires an initial rank estimate.

A low rank decomposition method with noise normalization and gradient information (G-NLR) is proposed by Shi et al. (2019) which includes, noise classifiers that characterize the image’s noise portion and increases the gaps in the space of the function between faulty objects and background and the gradient information restricts the noise term adaptively to the current pixel point’s mutation degree in order to direct the decomposition of the matrix and reduce the noise misjudgment. The system produces overall noise reduction in effective an manner [59]. However, for dot patterned fabrics, G-NLR has a high False Positive Ratio. The comparisons of all the structural approaches are given in Table 1 where all the methods are analyzed in terms of detection rate, strength and weakness.

Table 1 Comparative study of fabric defect detection using structural approaches

2.2 Statistical approach

Statistical methods use first and second order statistics to extract textural features for the classification of texture. The co-occurrence of matrix, histogram characteristics, auto-correlation function and mathematical morphology approaches are mostly employed in statistical methods. The other statistical methods such as cross-correlation, statistical moments, saliency map, local binary patterns, other grey level statistics and the methods of the neural network are also available in the literature. The classification of the statistical methods based on the available surveys is shown in Fig. 6 [21].

Fig. 6
figure 6

Types of statistical methods

2.2.1 Co-occurrence matrix

Co-occurrence matrix methods characterize texture characteristics by calculating the color-intensity dependencies. The distribution of gradient orientations of the fabric image and the changes in the gradient orientations are used to communicate the texture of the fabric [21].

Hanbay et al. (2017) have presented an approach for real time detection of defects that compares the time performance of programming languages like Matlab and C++. In the proposed method the Co-occurrence Histograms of Oriented Gradients (CoHOG) method is used to obtain significant texture characteristics of the images of the fabric. The fabric defects are classified by the neural artificial system. The method developed is used to detect defects in knitting fabric on a circular knitting machine. For Matlab and C++ applications, an overall defect detection success rate of 93% is achieved [22]. Kaynar et al. (2017) have proposed another method of Local Binary Pattern Gray Level Co-occurrence Matrix (LBP-GLCM) based fault detection. In this artificial neural network, the datasets are obtained by applying LBP-GLCM feature extraction techniques on TILDA textile data. These datasets are used as training datasets and two different models are generated. The performance rates are compared and in the GLCM + YSA process, the detection accuracy of 91.10% is achieved. For these methods, the features extracted from the Co-occurrence matrix are sensitive to the changes in scale in the fabric texture which leads to have a disadvantage of using the above methods to all the fabric materials [28].

2.2.2 Local binary pattern

One of the most popular methods to describe texture is the Local Binary Pattern (LBP) operator. The LBP is a simple, yet efficient theoretical approach to characterize the texture’s local spatial structure. A patterned fabric defect detection method is proposed by Morales et al. (2019) using rule based classification system and local binary characteristics. By using a rough set technique, rules are immediately learned from fabric samples. The proposed system involves a combination of local binary features to determine the structure of fabrics, which have proven to be highly discriminatory. Rough-set-based Textile Analysis (RTA) obtains the higher detection rate of 97.66%, but the limitation is features extracted from the data produced by Local binary pattern are sensitive to noise [45].

2.2.3 Other gray level statistics

The basic statistical data of the image’s gray level pixel distribution is found in the histogram. In the warp and weft directions of an I(x, y) grey image with MxN dimensions, two histogram variables may be calculated using Eq. (6) and (7).

$$ {P}_{warp}(x)=\frac{1}{N}{\sum}_yI\left(x,y\right) $$
(6)
$$ {P}_{weft}(y)=\frac{1}{M}{\sum}_xI\left(x,y\right) $$
(7)

Figure 7 shows the defective and non-defective fabric images which are the histogram variables Pwarp(x) and Pweft(y). In both warp and weft knitted fabrics, fabric defects are effectively examined as shown in Fig. 7. The defective region begins at warp 122 in the fabric in Fig. 7 and finishes at warp 138.

Fig. 7
figure 7

Defective and non-defective fabric images a Defective fabric image, b histogram variable values Pwarp(x) of any row in a defected fabric, c image of a defect-free fabric, d histogram variable values in a defect-free fabric, Pweft(y)of any row [21]

A gray level statistics co-occurrence matrix method is proposed by Sadaghiyanfam (2018). This method illustrates a new scheme for automatic implementation of fault detection scheme with the solution of wavelet transform, but it is found that in any of the images illustrated, the gray level statistics could not identify the objects that do not match any alteration in texture. The description of range and orientation values in the gray level statistics and the related number of levels is difficult and it requires further experimentation.

The gray level statistics approach is effective in the identification of defects in the fabric which is of high resolution. This method is not suitable for double pick shanting effect in the weft and shanting effect in the warp [55]. To overcome the above problem, a quick and efficient identification of defects by installing a camera to capture the image of a fabric in a weaving machine is proposed by Peng et al. (2018). Blob point detection algorithm is used to detect points and the holes are detected using the Canny operator contour detection method. The proposed rotational screenshot gray integral projection method is used to detect the lines with the recognition rate of 98% [51]. This is a simple method, but it is highly sensitive to variability in location, pose, scale and interclass. Moreover, it is not very distinctive.

2.2.4 Saliency map

Automatic measurement of significant objects and image regions without prior expectation or information is referred to as saliency detection. The disparity between a pixel and its surroundings is generally referred to as saliency [36]. The features are extracted during the analysis of saliency map. Color, form, texture, grayscale, and other common features have their own set of characteristics. The degree of light and darkness of visual attention is expressed in the visual saliency map; the brighter the brightness, the more prominent the area. Let the number of pixels in the visual saliency map be set with the gray value of i to ni, and the picture grey scale to [0,L-1], where L is the limit. C0 and C1 are the two types of pixels. Using T as a threshold, the cumulative variance of the two regions is calculated using Eq. (8).

$$ {\sigma}^2={P}_0{P}_1{\left({\mu}_0-{\mu}_1\right)}^2 $$
(8)

The averages of C0 and C1 grey level are P0 and P1 where P0 and P1 are the probability of the regions C0 and C1 respectively. In the range [0,L-1] is the maximum T value for σ2 and the resulting binary graph is given by the optimal segmentation threshold as in Eq. (9).

$$ SB\left(x,y\right)=\Big\{{\displaystyle \begin{array}{c} SI=1,S\left(x,y\right)\ge T\\ {} SO=0,S\left(x,y\right)<T\end{array}} $$
(9)

where (x,y) represents the pixels in the image and SI & SO are the visual saliency region and the background region respectively.

Furthermore a novel method for detecting fabric defects based on saliency map is proposed by Zhang et al. (2018) for detecting color dissimilarity and spatial aggregation. The RGB color space of a given image of the fabric is transformed into the color space for the representation of the function in the process. The color difference and the locations of specific patches are then used to calculate the imperfect values together, but in this method, the identification of defects in the motif and the box-patterned pictures of the fabric are inaccurate which is a drawback of this method and the detection rate for this method is 90% [75]. There is another method developed using saliency map detection by Liu et al. (2017). First, to explain the multi-layer characteristics of fabric images, the characteristics of multiple nonlinear transformations and multi-level abstraction capabilities of images in deep learning are used. The extracted characteristics are condensed into a feature matrix. To break the feature matrix into low-rank and sparse matrices, the low-rank representation model is adopted, indicating the background and salient element defects, respectively. Finally, to locate the region of fabric defects, the iterative optimal threshold segmentation algorithm is used to segment the saliency maps provided by the sparse matrix, but the limitation of this method is that, it works only for linear feature combinations and the detection accuracy is 95% [43].

Guan et al. (2017) have proposed a method for the detection of defects in surface fabrics through target-driven functions. The surface defect function of the fabric is assessed first in this method. The area and number of defects are used to improve the saliency of deficient regions and to build saliency maps. Finally, the fabric defects are obtained by using segmentation threshold, fusion and filter from the featured salience maps and it provides 96% of detection accuracy, but the front region in the binary image contains not only defect information but also partial noise information because of the gray value of the defect and the noise for interaction. This brings a limitation to this method [14]. A dynamic delaminating detection technique is proposed by Guan (2018) to detect fabric defects in the HSV color space through fabric defect saliency map. The aim is to model the human visual system and data-driving slowly increases the saliency of fabric defects. This approach provides relative stability between 97 and 100%. In this, the multiple objects and dynamic detection is limited [13]. The comparisons of all the statistical approaches are given in Table 2.

Table 2 Comparison study of fabric defect detection using statistical approaches

2.3 Spectral approach

The detection of fabric defects requires both spatial and frequency domain data. Frequency domain knowledge in particular is important to recognize the existence of fabric surface defects.

Identify the location of fabric defect; spatial domain information is also needed. Many studies on spectral approaches concentrate on the identification of fabric defects. The main aim of spectral approaches is to isolate the fundamentals of the object texture and then to generalize them with the laws of spatial design. Nevertheless, the use of spectral approaches for fabrics that contain random texture is not sufficient. The wavelet transforms, Fourier transforms, Gabor transforms and filtering methods would be examined as the subtitles of spectral approaches as shown in Fig. 8. Fourier transform only provides information on the frequencies and limiting wavelet transformation is a computational penalty and it requires a time-consuming feature extraction algorithm. Gabor filtering is a special algorithm and has a drawback of computational complexity [21].

Fig. 8
figure 8

Classification of spectral approach

2.3.1 Fourier transform

Fourier transform is a method used to analyze the data from the time field to the frequency domain. The analysis is comprehensive. The representations of the texture in relation to frequency components are made in this technique. The width of the fabric image does not change during the transformation. [21].

Pan et al. (2017) have proposed a method that uses the Computer Unified Device Architecture (CUDA) based Fast Fourier Transform approach to detect fabric defects. This method use multi-thread parallel Fast Fourier Transform (FFT) algorithms to detect fabric defects on the GPU platform. For the image size 4096*4096 the CUDA runtime is 20.09 sec [50]. Machine focused systems have better results in detecting defects. Hence, machine oriented methods to detect fabric defects have been explored by Yazan et al. (2018). The Vortex Optimization Algorithm (VOA) is used to boost the bandpass filter’s most suitable parameters and 90% of performance is achieved [71]. It is observed that when the method is applied to the large image size (1024 × 1024), it is divided into 32 × 32 block size. The compressed image reconstruction takes much memory compared to the original image [3].

2.3.2 Wavelet transform

Wavelet transformation is a signal analysis method designed to optimize temporary resolutions based on the frequency, as an alternative to Fourier transformations. [21]. Even though wavelet plays a major role in image processing, the curvelet transform, an advanced technique of wavelet transform, plays a vital role in the fabric defect detection. The advantages of curvelet are its sparse representation capabilities, which are important for compression, object estimation and inverse problems [25].

Anandan et al. (2018) have developed a method for defect detection using Discrete Curvelet Transform. With this approach the Classifier receives the digital image of the fabric by means of scheduling the image using “Discrete Curvelet Transform” and converts it into a binary image. The comparison is also carried out using the process of function extraction. The curvelet transform of the function f is given in Eq. (10)

$$ c\left(j,l,\mathrm{k}\right)=<f,{\varphi}_{j,l,k}> $$
(10)

where, φj,l, k: The curvelet.

j, l, k: The parameters of scale, direction and position respectively.

The input is f(t1, t2), (0 ≤ t1, t2,<n) is in the Cartesian coordinate system, while the discrete form of curvelet transform is given in Eq. (11)

$$ {C}^D\left(j,l,k\right)=\sum \limits_{0\le {t}_1,{t}_1<n}f\left({t}_1,{t}_2\right){\varphi}_{j,l,k}\left[{t}_1,{t}_2\right] $$
(11)

The Curvelet method produces 94.63% accuracy [1]. The drawback of this system is that, the Curvelet Transform has no invariance in translation and the representation of image description components is not sufficiently accurate [78].

2.3.3 Contourlet transform

The drawbacks of the widely used one-dimensional extensions of transformations like the Fourier and Wavelet transformations are well demonstrated in the geometry of the image edges. Contourlet transformation is a two dimensional transformation capable of capturing the intrinsic geometric structure that is essential for visual information. The transformation is in the continuous domain in curvelets for the sampled data. [11].

Furthermore, a learning based approach is proposed by Yapi et al. (2018), which automatically detects fabric defects. This approach relies on a numerical approximation of fabric patterns with the use of a Redundant Contourlet Transformation (RCT). A finite combination of generalized gaussians (MoGG), which forms statistical signature distinguishing between defect and defect-free textiles, is used to model the distribution of RCT coefficient. The detection accuracy is 98% [70] and the histogram for defect and defect-free regions is shown in Fig. 9. The major drawback of the contourlet transform is that the basic images in the frequency domain are not localized [8].

Fig. 9
figure 9

Calculation of RCT-MoGG signature on faulty and fault-free fabrics: a Examples of blocks with a defective (red block shot) and blocks with a deficiency (solid blue square). b Low- and high-pass yellow histogram RCT defect-free block coefficients in (a) [70]

2.3.4 Gabor transform and Gabor filters

Gabor filters are a part of the Gaussian distribution achieved by sinusoidal complexes when the fabric defects are found. For spatial and frequency field analysis, Gabor filters are used. Such filters that can be modified by different size and angle values according to surface structure are widely used to distinguish between fabric defections. [21].

A new method for detecting fabric defects based on Gabor filter and low rank tensor recovery has been suggested by Gao et al. (2017). Defect-free images of fabric have the direction defined, while defective images destroy their directional regularity. The direction function is therefore interesting to identify fabric defects. The direction data is also distinct for different types of textile images. To characterize the direction information for all kinds of fabric image, a Gabor directional filter bank is adopted to extract directional information and the Gabor directional filtered maps are created [12].

A new algorithm for detecting fabric defects is being proposed by Tian et al. (2016). An Efficient Gabor Filter (EGF) is used in the algorithm rather than the Gabor filter bank. During the training for a given model image, the parameters of optimal EGF are set by using Random Drift Swarm Optimization (RDPSO). During the detection process, a reference image of the same texture with an object template is converted into an ideal EGF. Discrimination against defects can then be performed to determine whether or not the sample image contains defects. Eventually, if there are defects in the sample image, an adaptive thresholding technique can be introduced to identify the defects and the detection accuracy is 96.3%. The computational effort required is a potential drawback of the RDPSO process, because much of the computational time is spent in solving the problem in the forward [61]. Jia et al. (2017) have developed another method based on lattice segmentation and Gabor filtering. In this technique, the lattices are segmented automatically on the basis of Morphological Analysis of Components (MCA) and an overall detection rate of 97.5% is achieved [27]. Even though the Gabor filter plays a major role in fabric defect detection, it is orthogonal features do not imply that they are independent of each other and the Gabor filters are directional filters [37].

2.3.5 Filtering methods

Spatial domain strategy improves an image by managing the power esteem directly in an image. A huge numbers of systems focus on improving the images of gray level in space. These techniques include high-pass filtering, low-pass filtering, homomorphic filtering and so on. In addition, these procedures are correlated with the enhancement the color image in the RGB space [76].

Hamdi et al. (2017) have proposed a computer vision system which detects fabric defects in patterned fabrics. The system use close infrared images to address the visual light source’s drawbacks. The defects are identified through a minimum error thresholding method and non-extensive defect filtering procedure obtains the precision rate of 97%. The discussion of accuracy is based on 64 fabric samples [18]. For the plain woven fabric images, an automated method of segmentation of defects is investigated by Guan et al. (2019). By weighted average, the initial RGB images are transformed to gray scale images. The transformed images are improved by gray level adjustment to separate the defects from the background and further processed by an ideal low pass filter. Roberts operator is chosen for edge detection. Finally, the area of interest is segmented from the background and the results are analyzed, to check whether the defect is present or not [15].

Detection of defects is examined for the flat woven fabric by Guan et al. (2019). The initial RGB images are transformed to gray images and further improved by the modifying the gray level. Many different filtering methods are used for denoising and an optimal low pass filter is chosen for filtering modified gray scale images. Deep learning based on a convolution neural network is suggested when the filtered objects are identified and categorized using the Visual Geometry Group template. The detection accuracy is found to be 94.2%, and the limitation of this method is that it is applicable only for the plain fabric, and not for the complicated structures [16]. The comparisons of all the spectral approaches are given in Table 3, which portrays the strengths and weaknesses of all the methods considered.

Table 3 Comparative study of fabric defect detection using spectral approaches

2.4 Learning approach

A true human like learning is beyond all techniques of artificial intelligence, although some training techniques have been developed to imitate human intelligence through machines. These techniques that allow computers to gain information with a certain degree of autonomy are collectively referred to as machine learning [57]. Currently, an emerging technique called deep learning leads to all the classification techniques as shown in Fig. 10. It handles a large amount of data with inbuilt feature extraction techniques. The neural networks and Supporting Vector Machine (SVM) are the earlier techniques utilized for the fabric detection, but deep learning is the current emerging technique for the fabric detection [21].

Fig. 10
figure 10

Classification of learning approach

2.4.1 Neural network

Due to the non-parametric existence and ability to represent complex decision regions, neural networks are the best classifiers used to identify faults. There are two considerations that have driven the application of the neural network to segment fabric defects: computational simplicity and robustness. Computational simplicity is crucial to any real-time fabric inspection method for being successful. The width and orientation of textile network fabric defects differ randomly. Therefore the performance of any device for detecting defects depends on its robustness to detect most defects [30]. A self organizing map based anomaly detection system is proposed by Wijesingha et al. (2018) to detect defects on warp knit surfaces. The system consists of two level of maps self organizing. The approach is applied to a set of images comprising 8 different types of warp knit surfaces, including the 8 defect groups. The detection percentage of this method is about 95% [69]. Only 144 images are utilized for training. So, SOM is given with too little data or too much weight information and the groupings present on the map may not be completely accurate or informative. To overcome this, a Convolutional learning network is implemented.

2.4.2 Supporting vector machine

A Support Vector Machine (SVM) is formalized as a discriminatory classification by a separate hyper plane Zhang et al. (2017) have proposed method to improve surface failure detection accuracy with a visual salience map and SVM approach. By analyzing the visual outlook maps of the images, the global associated value and the associated background values are extracted as feature sets. After standardization, both the functions are taken as SVM input. The detection accuracy is 98.60% [73]. The main negative aspect of the SVM algorithm is that it has many primary parameters that need to be set correctly to obtain the best output for any particular problem. In the study, the target samples are higher than the testing samples.

2.4.3 Deep learning method

Convolutionary Neural Network (ConvNet / CNN) is a deep learning algorithm which captures an input image, assigns meaning to and separates various aspects of objects in the image (learnable weights and partitions). Preprocessing in a ConvNet is much shorter than the other grading algorithms. When filters are mainly customized, ConvNets can learn these features with enough training. The generalized model for the broken weft fabric defect detection using CNN is shown in Fig. 11 [44].

Fig. 11
figure 11

Deep leaning model for fabric defect detection [21]

An image processing with CNN program have been developed by Bandara et al. (2018) to detect defects in uniform textured fabrics. In this method, light beams based are proposed on material color which is more powerful than the white light beam [44]. It proposes the uniform structured fabric material defect detection and a novel automated visual defect detection system. Weninger et al. (2018) also have proposed a method to identify and monitor yarns in fresh and unknown fabrics without the need for repetitive settings and to detect defects consecutively. This method is based on the detection of single weft or warp with fully connected CNN and tracking the single yarn for the identification of defects. The accuracy of this technique is 97% [68]. This method produces good results for some kinds of fabrics and not for others.

Similarly, a deep learning algorithm for the on loom fabric inspection method is developed by Ouyang et al. (2019). This method combines object preprocessing techniques, determination of fabric motif, generation of candidate defect maps and CNN. An optimum pair potential activation layer has been implemented into a CNN, resulting in high precision of fabric segmentation with intricate features. The predicted accuracy is above 95% [49]. In this method the defect integrity indicator is slightly lower (about 0.8) when the defect pixel ratio is less than 30%.

Autoencoder is adopted by Tian et al. (2019) for the identification of defects in an efficient manner by the learning representations of data. A template that is trained on non-default object patches cannot retrieve the defect area; the residual is used often as a defect assessment indicator. However, in a faulty patch, the texture region (not defective) is normally impossible to repair well, which makes pixel identification disloyal. The analysis of the similarities among different plots in the entire test image with 99.02% detection accuracy [61] suggests a new autoencoder based fabric defect detection approach. If a pixel belongs to a defective field, the result of its reconstruction depends entirely on this process, and the relation between defective pixels is ignored.

Zhang et al. (2018) have proposed a method to automatically identify and recognize yarn dyed fabric defects in which YOLO9000 (You Only Look Once), YOLO-VOC and tiny YOLO are used to build models. By optimizing the super parameters of deep convolutional neural network, YOLO-VOC is selected for further design and development. The YOLO-VOC trained model’s estimated time is only 0.023 s for each image. The value of the Intersection Over Union (IOU) is constant at only 69% to 80% due to the use of smaller fabric defects and the smaller choice area of the frame, so that the overlap region can be deviated to impact the quality of the IOU [77].

Fisher Criterion based Stacked Denoising Autoencoders (FCSDA) efficiently classify fabric patches into defectless and defective categories as pointed put by Li et al. (2017). Initially, the images are divided into sections of equal size and defective specimens are used for FCSDA learning. Secondly, FCSDA categorizes test patches into faulty and perfect categories. Finally, the residual is determined between the image restored and the image damaged. Each patch has an average detection time of 0.21 ms that can meet real time inspection requirements. FCSDA’s performance is significantly worse with two and three Denoising Autoencoders (DAs) than that of four DAs [35].

A transfer learning approach has been suggested by A. Şeker (2018) to overcome the problem of deep learning affected by number of samples. Transfer learning is sought for use a pre-trained network as the basis for a new problem, rather than teaching it from scratch. The study seeks a solution to the problem of fabric detection by transferring information. The success rate of training from scratch is increased from 75% to 98% and the detection accuracy is 98.75% [56], but at the same time the model has some limitations such as the following

  1. 1.

    The data distribution of the trained model and input data should match; otherwise, they should not be very different.

  2. 2.

    The input data should be sufficiently large to prevent the model from underfitting during the training process as the models deals with millions of parameters.

  3. 3.

    Changing the intermediate layers arbitrarily (add or remove) would affect the structure, so the template may not properly learn the features.

Zhang et al. (2018) have proposed a new technique called Wide And Compact (WAC) network based defect detection. To optimize the network, the proposed architecture uses multilayer perceptron with micro architectures. While maintaining comparable accuracy, WACNet achieves 1/4 to 1/10 fewer parameters than the others. The detection accuracy is 99.40% [38]. With a much smaller size of dataset, WAC Network achieves promising detection on fabric defect among the four standards of CNN. The experimental results for the WACNet are shown in Fig. 12.

Fig. 12
figure 12

WAC Net output a edge sag, b edge burr, c end broken and d defect free. The red arrows point to the defects position [38]

In this paper, a total of 27,200 samples or 6800 samples per class are collected and the sample size of images is 70 × 70 pixels. Pixels size is commonly increased to improve the quality of datasets, to prevent complex network over-fitting and to improve network robustness. The training data are increased in experiments by mirror flipping horizontally and random flipping that crops 60 × 60 patch from a 70 × 70 sample image randomly. Table 4 provides the comparison of all the approaches for learning.

Table 4 Comparison of fabric defect detection using learning approaches

2.5 Hybrid approach

An automatic system for detecting fabric defects has superior sides as well as some limitations. Therefore, many researchers have used a combination of two or more methods to more efficiently detect defects, with the main objective of reducing computational complexity and increasing the rate of detection of defects [21].

In the area of fabric defect detection in the clothing industry, Tong et al. (2017) have developed a fabric inspection model consisting of image preprocessing, image reconstruction and thresholding, particularly for complex texture and small defect fabrics achieving accuracy of 94.1%. Four undetected fabric defects still exist, that are, color marks on black fabric caused by the restarting of the weaving system [63].

Hamdi et al. (2018) have explored an unregulated fabric defect detection algorithm that does not require user modification and shown high rates of detection. This algorithm is applied primarily to patterned materials and can be generalized to simple structures. It has an overall success rate of 95%, but if the input information is not known a priori and pre-labeled, then this method is less reliable [19].

A standard band method together with distance matching function for patterned fabric defect detection is proposed by Biradar et al. (2017). The regular band is used to describe patterned fabric’s regularity. Further, the updated distance matching feature is used in patterned fabrics to measure periodic horizontal and vertical distances of repetitive components. The accuracy of cross validation is 97%. The regular band method cannot detect defects in complex patterned fabrics and it consume much time [5].

Using Gabor filters and Pulse Coupled Neural Network (PCNN), an embedded machine vision system is developed by Li et al. (2016) to automatically recognize warp knitted fabric defects. The system is made up of smart cameras and a controller for Human Machine Interface (HMI). On the smart camera SOC processor runs a hybrid detection algorithm that incorporates Gabor filters and PCNN. Then the Gabor filters are used to improve the contrast between images that a CMOS sensor captures. Finally, PCNN segments the defective areas in fabric images with adaptive parameter configuration with a detection accuracy is 98.6%. PCNN has the limitations of complex parameter setting procedure [34].

Deotale et al. (2019) have proposed the combination of GLCM, Gabor Wavelet and Random Decision Forest Detection of fabric Defects. Gray Level Co occurrence Matrix (GLCM) and Gabor wavelet consolidation are used to eradicate the texture of the image. Random Decision Forest classifier (RDF) is applied in the classification phase to classify the image of the input fabric into defective or non-defective category and the detection rate is 84.5%. The main drawback is the complexity, and they are much difficult and time-consuming to build [10]. The comparison of all the hybrid approaches is given in Table 5, in which all the methods are analyzed of their strengths and weaknesses.

Table 5 Comparison study of fabric defect detection using hybrid approaches

2.6 Other approaches

In fabric defect detection, other than the standard methods, there are some kinds of techniques followed by different researchers. Biological vision system has the ability to quickly identify defective objects. A new fabric defect detection algorithm based on biological vision modeling is proposed by Li et al. (2018) for simulating the biological visual perception process. The time spent for the Linearized Alternating Direction Method with Adaptive Penalty (LADMAP) solution method is 0.23 s. The drawback is that in biological vision modeling, multi-layer networks are much harder to train [39].

In the same way, an automatic entropy thresholding approach is suggested by Üzen et al. (2019). The proposed approach would be highly suitable for real-time applications due to the low cost of measurement. The automatic thresholding method assisted by 4 different entropy methods is compared in this analysis with the Otsu method which is one of the automatic thresholding methods. Various experiments have been carried out for the comparison of different types of fabric. The most successful outcome among the proposed methods is Renyi entropy model obtained based on the number of images detected [64].

A new Template based Correction (TC) method is proposed by Chang et al. (2018) for the detection of defects on images with periodic structures. Based on the regularity of variance, a fabric image is segmented into lattices, and correction is applied to reduce the effect of misalignment between lattices. Further, defect-free lattices are selected as a uniform reference to establish an average template and the detection accuracy is 98.11%. For dot patterned fabrics, the TC method performs worse in shape outlining than in star and box patterned fabrics, resulting in false detection of some defect-free pixels [7].

Zhang et al. (2017) have developed a continuous warp yarn segmentation method for automatically detecting misarranged warp yarns of colored fabrics using computer based vision system. The frame consists of two main components: the segmentation of warp yarn and the stitching of fabric objects. A prototype offline image acquisition system captures the sequence of fabric images and a sub-image based approach segments the warp yarns in sequence images successively. Secondly, the images of the series are stitched according to the effects of their warp segmentation by a yarn template matching method. Finally, the warp is processed further regional segmentation and color warp format testing is done and the continuous segmentation result of warp yarns is saved. The average yarn segmentation accuracy obtained is 97.43% [74]. The comparison of all the other approaches is given in Table 6 in which all the methods are analyzed of their strengths and weaknesses.

Table 6 Comparison study of fabric defect detection using other approaches

2.7 Over all comparison of fabric defect detection approaches

The correlative analysis is made to identify fabric defects. These studies lead the researchers to utilize the most appropriate methods, depending on the type of fabric and defect. However, the performance of these studies must be taken into account on the basis of various databases, imaging systems and parameters. For this reason, the complexity of the measurement, the performance metrics and the number of citations and the key parameters like image resolutions used in the study should be carefully evaluated. High resolution images, for example, offer precise simplicity in detecting defects although they contribute to high computational costs in real-time systems.

Kumar (2008) has conducted a survey on fabric defect detection using computer vision. The statistical, spectral and model based approaches which yield different results are proposed, but combining these methods leads to better results [31]. Henry et al. (2011) have reviewed the studies on automatic fabric detection techniques based on the above methods. In this, the above methods and the proposed hybrid approaches appear to offer higher detection rates with successful detection of fabric defects [48]. Likewise Javed et al. (2013) have compared different fabric defect detection techniques based on the above methods and proposed the Regular Band based Methodology which is better than any other techniques [26]. Tarek Habib et al. (2014) have reviewed the classification and Detection of Fabric defects using the above methods. It is concluded that the ANN, give greater classification [17].

The comparison of all the best approaches is shown in Fig. 13 and that of all the approaches with the best in each approach is given in Table 7, in which all the methods are analyzed of their strengths and weaknesses.

Fig. 13
figure 13

Comparison of all the approaches with the corresponding best reference article from each approach

Table 7 Comparative study of the best method in different fabric defect detection approaches

3 Summary

Traditionally, the performance of fabric is evaluated in a human oriented way. This manual approach, however, results in lower efficiency and higher losses in the market. The six subgroups given deal with automated online and offline inspection methods for fabric defects. There are still very few automated and real time devices that can run on weaving and knitting machines. In particular, an automated and a real time detection device with generality and validity characteristics has not been established on knitting machines. Instead the operator is provided with the knowledge of the defect and stops the machine which is not automated.

Table 1 summarizes comparative study of fabric defect detection using structural approach. Even though this approach yields better results, the classification is performed based on assumptions. Table 2 summarizes the study comparison of statistical approach based fabric defect detection. The frequency domain, spectral approaches offer rapid and effective result of fabric images, but they usually work in normal structure patterns. Table 3 compares fabric defect detection using spectral approach. This approach also provides better results, but it cannot detect irregular patterned texture in the fabric materials. Table 4 summarizes fabric defect detection using learning approach. This method also produces a better result compared to the other techniques, but it is computationally expensive. Table 5 presents the comparison of fabric defect detection using hybrid approach. In this, different methods are combined together to yield better results. Table 6 makes a comparative study of fabric defect detection using other approaches which involve different techniques that are new to the normal methods. Each of these methods classifies the defects differently. Table 7 also compares the best method in each approach. In this, each of the methods has its own advantages and disadvantages. The best method can be selected by neglecting the acceptable drawbacks.

3.1 Dataset availability

From [60], the following datasets are used as the textile image data set.

  1. 1.

    A benchmark database for the image segmentation issue published in the Berkeley Comuter Vision Group website.

  2. 2.

    Brodatz and VisTex which are well known available databases for the Textile Images.

  3. 3.

    KTH-TIPS and CUReT which are also well-known databases for fabric images. The University of Hong Kong provides these databases of patterned textiles and they are not publically available.

  4. 4.

    Many different researchers use the PARVIS database, but it is private, without public access. It contains two types of 1117 textile image set.

  5. 5.

    Hanbay et al. [20] have built a new textile database by a conveyor system equipped with the linear scanning camera and linear light. The server includes 3242 defective images and 5923 fabric images. Free fabric databases that are anonymously accessible are required to establish objective and accurate methods.

  6. 6.

    The Ireland Longitudinal Study on Ageing (TILDA- Version 1.0, 1996) [28] which is a textile textured database developed within the scope of the major research agenda “Automatic Visual Inspection of Technical Objects,” a working group texture analysis from the German Research Foundation (DFG) [60].

4 Conclusion

Detection of faulty fabrics in textile manufacturing industries has become a crucial and necessary step in quality control. This paper has made a survey on the detection of fabric defects from 79 references. The approaches are grouped into six categories: structural, statistical, spectral, learning, hybrid and other approaches. These approaches are compared based on their strengths, weaknesses and detection rate. Out of all the structural approaches reviewed, low rank decomposition technique provides the highest accuracy of 99%. In statistical approach, the gray level statistics technique provides 98% of accuracy than the others. In the same way, the spectral, learning, hybrid and other approaches give 98%, 99.40%, 98.6% and 98.11% of accuracy using Contourlet Transform, deep learning, Embedded Machine Vision System + Gabor filters + Pulse Coupled Neural Network and pattern template correction technique respectively. Out of all the six approaches, the deep learning model under learning approach gives the highest accuracy of 99.4%. The highest detection accuracy produced by the broad and compact deep learning network has the ability to automatically learn high level functions from raw data and has a flexible architecture to adopt. This technique has the advantages of robustness to natural variations in the raw data. Thus, based on the detection accuracy, it is clear that the deep learning technique plays a vital role in the fabric defect detection even though it involves a high computational cost.