DOI QR코드

DOI QR Code

A Sobel Operator Combined with Patch Statistics Algorithm for Fabric Defect Detection

  • Jiang, Jiein (School of Computer and Software, Nanjing University of Information Science and Technology) ;
  • Jin, Zilong (School of Computer and Software, Nanjing University of Information Science and Technology) ;
  • Wang, Boheng (School of Computer and Software, Nanjing University of Information Science and Technology) ;
  • Ma, Li (School of Computer and Software, Nanjing University of Information Science and Technology) ;
  • Cui, Yan (College of Mathematics and Information Science, Nanjing Normal University of Special Education)
  • Received : 2019.10.20
  • Accepted : 2019.12.22
  • Published : 2020.02.29

Abstract

In the production of industrial fabric, it needs automatic real-time system to detect defects on the fabric for assuring the defect-free products flow to the market. At present, many visual-based methods are designed for detecting the fabric defects, but they usually lead to high false alarm. Base on this reason, we propose a Sobel operator combined with patch statistics (SOPS) algorithm for defects detection. First, we describe the defect detection model. mean filter is applied to preprocess the acquired image. Then, Sobel operator (SO) is applied to deal with the defect image, and we can get a coarse binary image. Finally, the binary image can be divided into many patches. For a given patch, a threshold is used to decide whether the patch is defect-free or not. Finally, a new image will be reconstructed, and we did a loop for the reconstructed image to suppress defects noise. Experiments show that the proposed SOPS algorithm is effective.

Keywords

1. Introduction

Fabrics, which are produced by fabric industries, are indispensable in people’s life because they are the material of most apparel. The textile production has always been completed by machines operated by skilled workers. Defects are inevitably arise in the process of fabric production. In some sense, the price of the fabrics depends on the number of defects within the material. Therefore, the success of a fabric industry is decided by its success in reducing fabric defects. 

Fabric defect detection is a problem that must be studied and discussed in fabric industry. Nowadays, the fabric inspection in most countries is carried out by skilled workers. There are many drawbacks of the artificial visual inspection. First, it need for a long time to train an operator to become a skilled worker. Second, even for skilled workers, visual inspection is a very boring job. Some defects will inevitably be lost after long working hours. Finally, as the cost of labor is increasing, it is extremely unfavorable to the factory in the competition of its peers.

Based on above reason, automated visual inspection system to detect possible defects in fabric is an inevitable trend to replace visual inspection by human eyes. In automated inspection, defects detection is implemented during the production process, the inspection system will detect the defects with the movement of fabric on the loom. The core of effective detection lies in fast and effective algorithm.

At present, there are many kinds of methods for detecting the defects, but they usually lead to high false alarm. In this paper, a Sobel operator combined with patch statistics (SOPS) algorithm for defects detection. For an acquired fabric image, mean filter and Sobel operator are applied to deal with the defect image jointly, a coarse binary image can be achieved. Based the coarse binary image, we divide it into many patches. Then, the binary image can be divided into many patches. For a given patch, we count non-zero-pixel values, which is applied to decide a patch containing defects or not by a fixed threshold. Finally, we reconstruct a new defect image. The designed SOPS algorithm is used to test the images collected from a fabric factory, the test results show that SOPS is effective. 

The next arrangement of the paper is as follows. In section 2, we review the related research. In section 3, we give the process of SOPS algorithm. Section 4 verify the detection effect of SOPS algorithm. Conclusions is presented in section 5.

2. Related Work

The key of detection technology is to design effective algorithm. At present, there are four kinds of defects detection technology based on computer vision: structure based detection method, statistical based detection method, spectral based detection method and model based detection method.

Texture is usually regarded as a combination of texture primitives in structural method [1]. The structure method has a good effect on the segmentation of fabric defects from regular patterns [2]. Chen and Jain first use histogram to process texture images and then use the skeleton representation to defect defects [3].

The statistical method extracts texture features through the statistical characteristics of images, mainly including co-occurrence matrix [4], autocorrelation function (AF) [5-6], mathematical morphology method [7-9]. Co-occurrence matrix, which is based on the recurrence of different gray structures in the fabric, is one of the most common statistical tools in defects detection. Haralick et al [#ref-44] described texture features based on gray spatial correction and confirm their application on three image data. The method based on AF detects the repeated structure of fabric image. Zhang and bresee [5] detected knot and slub defects by combining autocorrelation functions and morphological operators. Mathematical morphology(mm) extracts image components that are helpful for the representation and description of regional shape, including different morphological operations such as closing, opening and so on. In [7], Wang and Liu proposed a method to detect the position of fabric defects with an improved morphological filtering. A hybrid method uses correlation followed by morphology for the detection of micro defects in plain fabrics [8]. The suspected object detection is achieved using correlation method, the morphological method is applied to filter and retain the defect region. In [9], wavelet transform and morphological method are applied to detect fabric defects.

Spectral approaches treat the solution of differential equation as the synthesis of some basis functions. There are several spectral based detection method: Gabor transform [10-13], wavelet transform [14-17], fourier transform [18-20]. Gabor filters analyse textures in both frequency and spatial domain. Gabor filter is suitable for texture representation because its frequency and direction are similar to human vision system. In [10], Burnoulli’s rule combined with multi-channel filtering are applied to detecting textured materials. Defect detection and classification are implemented simultaneously in [11]. In this study, it first use Gabor filters to extract texture features for defects detection. Then a trained Gaussian mixture model are applied for classification. Finally, more than 1000 samples are used for test the proposed model. In order to optimize the parameters of Gabor filters, Tong et al. [12] applied composite differential evolution to achieve the optimization parameters offline and implement defects detection online, which can effectively reduce the time required for defects detection. Lattice segmentation combined with Gabor filters based method are presented in [13], morphological component analysis is applied to extract cartoon component in defects image. Wavelet transform is widely used for feature extraction. By using multiscale wavelet features to character the fabric images, Yang et al [14] utilized adaptive wavelets to take the place of the standard wavelet bases to accomplish defects detection. Han et al. [15] use wavelet transform to decompose fabric images in multi-level, an approximate sub-image can be achieved by choosing an approximate level, then it transforms texture detection problem to solid fabric detection. In [16], the golden image subtraction combined with wavelet transform, namely WGIS, are developed for detecting defects on patterned fabric. WGIS includes five steps: histogram equalization, wavelet transform, the golden image subtraction, threshliding and smoothing filter. Spatial and spectral domain based methods are presented in [17]. Where spatial domain based methods include morphological and statistical operations, while spectral domain based methods introduce Discrete cosine, fast Fourier, wavelet transform and Gabor filter. Fourier transforms the signals to frequency domain to characterize the defects. When the frequency spectrum changes and reveals a irregular structure, it indicates the existence of defects. Chan and Pang et al. [18] utilized histogram equalization to increase image contrast and used a fast Fourier transform to detect the structural defect. In [19], Fourier spectrum can be obtained by converting the spatial domain to the frequency domain, then the defects detection can be completed by observing its Fourier spectrum. Tsai and Hsieh [20] mainly solved the problem of directional textures detection. Texture of the line patterns in any direction can be removed by adopting a one-dimensional Hough transform to detect the high-energy in Fourier image.

Model-based approaches, which be applied to the fabric image with random changes, can generate the texture to match the observed texture. It mainly include Markov Random Field model [21] and Autoregressive model [22-23]. Markov Random Field model uses the dependence on pixel points in fabric images. In [21], a defect image is divided into many windows and a Gaussian Markov random field is applied for fitting each window, Karhunen–Loeve transform is adopted at the same time. An autoregressive model can express the degree of linear dependence between the different pixels of an texture image. Alata and Ramananjarasoa [22] proposed two stages method for fabric defect detection.

Recent research on defect detection mainly includes dictionary learning based methods [23-24], sparse plus low rank strategy based methods [25-26] and convolutional neural network (CNN) based methods [27]. Dictionary learning based methods learned a dictionary from many image patches, where the image patches are acquired by defect-free images. For a defect image to be tested, it need to be divided into many patches and each patch can be represented by the learned dictionaries. Sparse plus low rank strategy based methods consider the self-similarity of fabric textures, which convert the defects detection into a low-rank or a sparse matrix decomposition problem. The basis of applying convolutional neural network (CNN) to fabric defects detection lies in that CNN can imitate the visual information processing of the human visual system.

3. A Sobel Operator Combined with Patch Statistics Algorithm (SOPS)

3.1 The defect detection model

When a fabric image is disturbed by defects, which is the same as a fabric images that are contaminated with noise. Therefore, we can describe the detection model

 P = Ο + V       (1)

Where O is a free-defect image, Pis the defect observation of O , and V is the defect that we want to find.

3.2 Mean filter(MF)

Fabric images collected by the factory are inevitable carries noise due to the dust in factories or the image transmission, which will reduce the accuracy of defects detection. Therefore, we need do some pre-processing to suppress noise. In this paper, the strategy in [28] is adopted and the mean filter is used to suppress noise. A m×m averaging kernel can be written as Table 1.

Table 1. A m×mkernel

E1KOBZ_2020_v14n2_687_t0001.png 이미지

Next, an example can be used to illustrate the effect of mean filter. Fig. (1) (a) shows an defect image, Fig. (1) (b) reveals the result of MF, where the averaging kernel m is set as 3. In order to show the effect of mean filter on defects detection, the results of SOPS without mean filter is shown in Fig. (1) (c) , while the results with SOPS is shown in Fig. (1) (d). Figs. (1) (c) and (d) indicate that mean filter can suppress the noises effectively.

E1KOBZ_2020_v14n2_687_f0005.png 이미지

Fig. 1. (a) An defect image (b) MF result (c) SOPS without MF (d) SOPS with MF

3.3 A Sobel Operator Combined with Patch Statistics Algorithm (SOPS)

Currently, there are many kinds of methods for detecting the defects, but they usually lead to high false alarm. To solve such problem, we presented a Sobel operator (SO) combined with patch based method for defects detection. For an acquired image Ppreprocessed by mean filter, we first use SO to detect the edge of the image. Therefore, two 3 × 3 kernels are used to convolute with image P to calculate derivative approximation in horizontal and vertical directions,We define Gx an image which contains the horizontal derivative approximations as

\(G_{x}=\left[\begin{array}{rrr} -1 & 0 & +1 \\ -2 & 0 & +2 \\ -1 & 0 & +1 \end{array}\right] * \mathbf{P}\)       (2)

And the vertical derivative approximations can be defined by

\(G_{y}=\left[\begin{array}{ccc} +1 & +2 & +1 \\ 0 & 0 & 0 \\ -1 & -2 & -1 \end{array}\right] * \mathbf{P}\)       (3)

Where∗ represents the convolution operation.

For each point in an detect image, the gradient magnitude can be achieved by the horizontal derivative and the vertical derivative approximations

\(\mathrm{G}=\sqrt{\mathrm{G}_{\mathrm{x}}^{2}+\mathrm{G}_{\mathrm{y}}^{2}}\)       (4)

The gradient's direction can also be computed

\(\theta=\arctan \left(\frac{\mathrm{G}_{\mathrm{y}}}{\mathrm{G}_{\mathrm{x}}}\right)\)       (5)

After a fabric is processed by SO (Denoted by P'), an example can be found in Fig. 2. Fig. 2 gives detect results by SO. Figs. (2) (a) and (b) are the defect images, Figs. (2) (c) and (d) are the detect results of Figs. (2) (a) and (b). From Fig. (2), we can see that although SO can detect defects effectively, the test results show too many defects (denoted by defect noises) and lead to high false alarm. Next, we adopted a patch based method to reduce defect noises.

E1KOBZ_2020_v14n2_687_f0006.png 이미지

Fig. 2. (a), (b) are the defects images. (c),(d) are the results detected by SO.

For the image P' following the symbols in [29], let P'i = RiP', i=1,2,...,n be an image patch of size n1 × n1, where Ri is the matrix operator extracting patch P'i from P' at location i, two pixel values are overlapping between adjacent image patches. Intuitively, if an image patch P'i contains defects, the number of non-zero-pixels is relatively big. Otherwise, an image patch P'i is defect-free. Binaryzation of pixel values of each image patch, the following formula can be achieved.

\(\mathbf{o}_{i}=\left\{\begin{array}{ll} \mathbf{P}_{i}^{\prime} & \mathbf{P}_{i}^{\prime}>\tau, \quad i=1,2 \ldots \mathrm{n} \\ 0 & \text { Otherwise } \end{array}\right.\)       (6)

After processing each image patch with Equation (6), we can synthesize a new image by 

\(\mathbf{O}=\left[\sum_{i=1}^{n} R_{i}^{T} R_{i}\right]^{-1} \sum_{i=1}^{\mathrm{n}} R_{i}^{T} \mathbf{0}_{i}\)       (7)

Similarly, defect detection results can be seen in Figs. 3(a) and (b). We can see that the defect noises in Figs. 3(a) and (b) are obviously less than that in Figs. 2(c) and (d). Therefore, we need to do a loop for Figs. 3 (a) and (b) again, the final detect results can be found in Figs. 3 (c) and (d). Fig. 4 gives the flowchart of proposed SOPS algorithm.

E1KOBZ_2020_v14n2_687_f0007.png 이미지

Fig. 3. (a), (b) are the results of first detection. (c),(d) are the final detect results

E1KOBZ_2020_v14n2_687_f0001.png 이미지

Fig. 4. The flowchart of the proposed SOPS

4. Experiments

In this section, we did experiments on some typical defect image to demonstrate the performance of SOPS algorithm. Where the three most encountered defects are line defects, knot defects and spot defects and line defects. Compared with line defects, the spot defects and the knot defects are difficult to detect. In the experiment, this paper mainly considers three types of defects. We compare the proposed SOPS with Fourier analysis based method [30] and a Gabor filtering method [#ref-12]. 

4.1 Parameter setting

In the proposed SOPS algorithm, several parameters need to be set. Because SOPS is implemented on many image patches, the size of all image patches is 7×7 , which is determined by operation time. The threshold τ in Equation (6) is applied to decide a patch is defect-free or not, which is set as 8 by experience.

4.2 Results

The experiment is carried out on a personal computer running on an Intelcore i7 processor. Test results of three typical defects are shown in Figs. 5-7. In Figs. 5-7, the original defective images are shown in the first column, the detect results of [30] and [12] are shown in the second and third column, respectively, the SOPS detection results are shown in fourth column. In Fig. 5, Fourier analysis based method [30] can detect all defects, but it has high false alarm for some test images such as the result of (a3) and (a4); The Gabor filtering method [12] cannot detect some defects such as the the result of (c3), the possible reason is that the contrast between the defect and the background is small. Meanwhile, the Gabor filtering method [12] will lead to high false alarm, which can be found in (c1). Fig. 6 shows the result of line defect detection, the algorithms in [12] and [30] achieve incomplete detection results for some line defects. A similar conclusion can be drawn in Fig. 7. In all, all the experiments show that the proposed SOPS algorithm not only get better defection effect, but also get low false false alarm. 

E1KOBZ_2020_v14n2_687_f0002.png 이미지

Fig. 5. Test results. (a1)-(a4) original images. (b1)-(b4) results of [30]. (c1)-(c4) results of [12]. (d1)-(d4) the results of the proposed SOPS.

E1KOBZ_2020_v14n2_687_f0003.png 이미지

Fig. 6. Test results. (a1)-(a4) detect images. (b1)-(b4) results of [30]. (c1)-(c4) results of [12]. (d1)-(d4) the results of the proposed SOPS.

E1KOBZ_2020_v14n2_687_f0004.png 이미지

Fig. 7. Test results. (a1)-(a4) detect images. (b1)-(b4) results of [30]. (c1)-(c4) results of [12]. (d1)-(d4) the results of the proposed SOPS.

5. Conclusion

This paper proposed a Sobel operator combined with patch statistics algorithm (SOPS) for defects detection. We described the defect detection model and used mean filter to suppress noise first, a preprocessed image can be obtained. Sobel operator is then applied to deal with the preprocessed image, a coarse binary image can be achieved. Finally, the binary image can be divided into many patches. For a given patch, we count non-zero-pixel values, which is applied to decide a patch containing defects or not by a fixed threshold. The test results show that SOPS has good defects detection performance.

Acknowledgement

This work was supported in part by the National Natural Science Foundation of China under Grants 61601235, 61602252, in part by the Natural Science Foundation of Jiangsu Province of China under Grants BK20160972, BK20170768, BK20160967.

References

  1. P.M. Mahajan, S.R. Kolhe, P.M. Pati, "A review of automatic fabric defect detection techniques," Adv. Comput. Res, vol. 127, no. 2, pp. 18-29, 2009.
  2. K. Hanbay, M. F. Talu, O.F. Ozguven, "Fabric defect detection systems and methods-A systematic literature review," Optik, vol. 127, pp. 11960-11973, 2016. https://doi.org/10.1016/j.ijleo.2016.09.110
  3. J. Chen, A.K. Jain, "A structural Approach to Identify Defects in Textured Images," in Proc. of IEEE Int'l Conf. Systems, Man & Cybernetics, pp. 29-32, 1988.
  4. R.M. Haralick, K. Shanmugam, I. Dinstein, "Textural features for image classification," IEEE Trans. Systems, Man and Cybernetics, vol. 3, no. 6, pp. 610-621, 1973. https://doi.org/10.1109/TSMC.1973.4309314
  5. YF. Zhang, RR. Bresee, "Fabric defect detection and classification using image analysis," Text Res J, vol. 65, no. 1, pp. 1-9, 1995. https://doi.org/10.1177/004051759506500101
  6. K. Hoshino, H. Sumi, T. Nishimura, "Noise detection and reduction for image sensor by time domain auto correlation function method," in Proc. of IEEE International Symposium on Industrial Electronics, pp. 1737-1740, 2007.
  7. D. Wang, H. Liu, "Edge detection of cord fabric defects image based on an improved morphological erosion detection methods," in Proc. of Sixth International Conference on Natural Computation (ICNC), pp. 3943-3947, 2010.
  8. V. Jayashree, S. Subbaramn, "Hybrid Approach using correlation and morphological approaches for GFDD of plain weave fabric," IEEE Control and System Graduate Research Colloquium, pp. 197-202, 2012.
  9. V.V. Karlekar, M.S. Biradar, K.B. Bhangale, "Fabric defect detection using wavelet Filter," in Proc. of International Conference on Computing Communication Control and Automation (ICCUBEA), pp. 712-715, 2015.
  10. A. Kumar, G.K.H. Pang, "Defect detection in textured materials using Gabor filters," IEEE Trans. Industry Applications, vol. 38, no. 2, pp. 425-440, 2002. https://doi.org/10.1109/28.993164
  11. Y. Zhang, Z. Lu, J. Li, "Fabric defect detection and classification using Gabor filters and Gaussian mixture model," in Proc. of Asian Conference on Computer Vision-accv, pp. 635-644, 2009.
  12. L. Tong, W. K Wong, C. K. Kwong, "Differential evolution-based optimal Gabor filter model for fabric inspection," Neurocomput., vol. 173, pp. 1386-1401, 2016. https://doi.org/10.1016/j.neucom.2015.09.011
  13. L. Jia, C. Chen, L. Jiang, Z. Hou. "Fabric defect inspection based on lattice segmentation and Gabor filtering," Neurocomput., vol. 238, pp. 84-102, 2017. https://doi.org/10.1016/j.neucom.2017.01.039
  14. XZ. Yang, GKH. Pang, NHC. Yung, "Discriminative fabric defect detection using adaptive wavelets," Opt Eng, vol. 41, no. 12, pp. 3116-3126, 2002. https://doi.org/10.1117/1.1517290
  15. Y. Han, P. Shi, "An adaptive level-selecting wavelet transform for texture defect detection," Image Vision Comput., vol. 25, no. 8, pp. 1239-1248, 2007. https://doi.org/10.1016/j.imavis.2006.07.028
  16. H. Y. Ngan, G. K. Pang, S. Yung, M. K. Ng, "Wavelet based methods on patterned fabric defect detection," Pattern Recognition, vol. 38, no. 4, pp. 559-576, 2005. https://doi.org/10.1016/j.patcog.2004.07.009
  17. K. Sakhare, A. Kulkarni, M. Kumbhakarn, N. Kare, "Spectral and spatial domain approach for fabric defect detection and classification," in Proc. of International Conference on Industrial Instrumentation and Control (ICIC), pp. 640-644, 2015.
  18. CH. Chan, G. Pang, "Fabric defect detection by Fourier analysis," IEEE Transactions on Industry Applications, vol. 36, no. 5, pp. 1267-1276, 2000. https://doi.org/10.1109/28.871274
  19. N. Ismail, W.M. Syahrir, J.M. Zain, T. Hai, "Fabric authenticity method using fast Fourier transformation detection," in Proc. of International Conference on Electrical, Control and Computer Engineering (INECCE), pp. 233-237, 2011.
  20. D.-M. Tsai and C.-Y. Heish, "Automated surface inspection for directional textures," Image and Vision Computing, vol. 18, pp. 49-62, 1999. https://doi.org/10.1016/S0262-8856(99)00009-8
  21. S. Ozdemir, A. Ercil, "Markov random fields and Karhunen-Loeve transform for defect inspection of textile products," in Proc. of IEEE Conference on Emerging Technologies & Factory Automation, pp. 697-703, 1996.
  22. O. Alata, C. Ramananjarasoa, "Unsupervised textured image segmentation using 2-D quarter plan autoregressive model with four prediction supports," Pat. Rec.Lett., vol. 26, no. 8, pp. 1069-1081, 2005. https://doi.org/10.1016/j.patrec.2004.10.002
  23. J. Zhou, D. Semenovich, A. Sowmya, J. Wang, "Dictionary learning framework for fabric defect detection," The Journal of the Textile Institute, vol. 105, no. 3, pp. 223-234, 2014. https://doi.org/10.1080/00405000.2013.836784
  24. L. Tong, W. K Wong, C. K. Kwong, "Fabric defect detection for apparel industry: a nonlocal sparse representation approach," IEEE Access, vol. 5, pp. 5947-5964, 2017. https://doi.org/10.1109/ACCESS.2017.2667890
  25. J. Jiang, Yan Cui, Y. Chen, G. Gao, "A novel nonlocal low rank technique for fabric defect detection," in Proc. of The 4th International Conference on Cloud Computing and Security, pp. 173-182, 2018.
  26. J. Wang, Q. Li, J. Gan, H. Yu, "Fabric defect detection based on improved low-rank and sparse matrix decomposition," in Proc. of The 2017 IEEE International Conference on Image Processing, pp. 2776-2780, 2017.
  27. Y. Li, D. Zhang, D-J. Lee, "Automatic fabric defect detection with a wide-and-compact network," Neurocomput., vol. 329, pp. 329-338, 2019. https://doi.org/10.1016/j.neucom.2018.10.070
  28. J. Jiang, Yan Cui, Z. Jin, C. Fan, "Fast three-phase fabric defect detection," in Proc. of The 4th International Conference on Cloud Computing and Security, pp. 302-312, 2018.
  29. M Aharon, M Elad and A. Bruckstein, "K-SVD: An algorithm for designing of overcomplete dictionaries for sparse representation," IEEE Trans. Signal Process, vol. 54, no. 11, pp. 4311-4322, 2006. https://doi.org/10.1109/TSP.2006.881199
  30. G. Hu, Q. Wang, G. Zhang, "Unsupervised defect detection in textiles based on Fourier analysis and wavelet shrinkage," Appl. Opt, vol. 54, no. 10, pp. 2963-2980, 2015. https://doi.org/10.1364/AO.54.002963

Cited by

  1. An APF-ACO algorithm for automatic defect detection on vehicle paint vol.79, pp.35, 2020, https://doi.org/10.1007/s11042-020-09245-2