DEFECT DETECTION IN FABRIC IMAGES USING · PDF fileDEFECT DETECTION IN FABRIC IMAGES USING...

6
DEFECT DETECTION IN FABRIC IMAGES USING SINGULAR VALUE DECOMPOSITION TECHNIQUE T.D.Venkateswaran 1 Research Scholar, Department of Computer Science, Madurai Kamaraj University, Madurai, India. [email protected] G.Arumugam2 Senior Professor and Head, Department of Computer Science, Madurai Kamaraj University, Madurai, India. [email protected] Abstract Defect detection is one of the problems in image processing and many different methods based on texture analysis have been proposed. In this paper, a method is proposed for detecting defects in fabric image textures based on singular value decomposition technique. The proposed approach applied first in artificially simulated fabric textures and then real fabric textures. The proposed algorithm shows good result to detect all types of defects occurred in fabric images. High detection rate and low computational complexity are advantages of this proposed approach. 1. Introduction Visual quality inspection system play an important role in many industrial and commercial applications such as tiles, metal, agricultural products, fabric, ceramic, paper and etc. Any hole, damage, abnormalities and slot in products surfaces are called defect. Ghazini et al. proposed a defect detection approach of tiles using combination of two dimensional wavelet transform and statistical features. Henry et al. used ellipsoidal region features and min-max technique on patterned fabric for detecting defects. Ch. Lin et al., described a texture defect detection system based on image deflection compensation. Tolba used a probabilistic neural network (PNN) for fast defect classification based on the maximum posterior probability of the Log-Gabor based statistical features. Alimohammadi et al., proposed a new method using optimal Gabor filters to detecting skin defect of fruits which was usable in agricultural products visual quality inspection systems (APVQIS). Some of defect detection approaches are compared by Xie et al. The computational complexity of most of previous approaches is too high and some of them don’t guarantee an accurate result for every model of defects. So in this article, an approach is proposed to defect detection without these problems. 1.1 Singular Value Decomposition (SVD) SVD is an effective mathematical tool used to analyze matrices. In SVD transformation, a matrix can be decomposed into three matrices that are of the same size as the original matrix. From the view point of linear algebra, an image is an array of non-negative scalar entries that can be regarded as a matrix. Without loss of generality, if A is a square image, denoted as AR n×n , where R represents the real number domain, then SVD of A is defined as A = U S V T where U R n×n and V R n×n are orthogonal matrices, and S R n×n is a diagonal matrix, as Here diagonal elements i.e. σ’ s are singular values and satisfy σ 1 ≥ σ 2 ≥…. σ r ≥ σ r+1 ≥ =……= σ n =0 It is noticeable that the unique property of the SVD transform is that the potential N 2 degrees of freedom or samples in the original image now get mapped into: S N Degrees of freedom, U N ( N -1) / 2 Degrees of freedom, V N ( N -1) / 2 Degrees of freedom, totaling N 2 degrees of freedom. SVD is an optimal matrix decomposition technique in a least square sense that it packs the maximum signal energy into as few coefficients as possible. It has the ability to adapt to the variations in local statistics of an image. 1.2 SVD Example As an example to clarify SVD transformation, suppose A T D Venkateswaran et al, Int.J.Computer Technology & Applications,Vol 5 (2),351-356 IJCTA | March-April 2014 Available [email protected] 351 ISSN:2229-6093

Transcript of DEFECT DETECTION IN FABRIC IMAGES USING · PDF fileDEFECT DETECTION IN FABRIC IMAGES USING...

DEFECT DETECTION IN FABRIC IMAGES USING SINGULAR VALUE

DECOMPOSITION TECHNIQUE

T.D.Venkateswaran1

Research Scholar, Department of Computer Science, Madurai Kamaraj University, Madurai, India.

[email protected]

G.Arumugam2

Senior Professor and Head, Department of Computer Science, Madurai Kamaraj University, Madurai,

India. [email protected]

Abstract

Defect detection is one of the problems in image processing and many different methods based on

texture analysis have been proposed. In this paper, a

method is proposed for detecting defects in fabric

image textures based on singular value decomposition

technique. The proposed approach applied first in

artificially simulated fabric textures and then real

fabric textures. The proposed algorithm shows good

result to detect all types of defects occurred in fabric

images. High detection rate and low computational

complexity are advantages of this proposed approach.

1. Introduction Visual quality inspection system play an important

role in many industrial and commercial applications

such as tiles, metal, agricultural products, fabric, ceramic, paper and etc. Any hole, damage,

abnormalities and slot in products surfaces are called

defect. Ghazini et al. proposed a defect detection

approach of tiles using combination of two dimensional

wavelet transform and statistical features. Henry et al.

used ellipsoidal region features and min-max technique

on patterned fabric for detecting defects. Ch. Lin et al.,

described a texture defect detection system based on

image deflection compensation. Tolba used a

probabilistic neural network (PNN) for fast defect

classification based on the maximum posterior

probability of the Log-Gabor based statistical features.

Alimohammadi et al., proposed a new method using

optimal Gabor filters to detecting skin defect of fruits

which was usable in agricultural products visual quality

inspection systems (APVQIS). Some of defect

detection approaches are compared by Xie et al. The computational complexity of most of previous

approaches is too high and some of them don’t

guarantee an accurate result for every model of defects.

So in this article, an approach is proposed to defect

detection without these problems.

1.1 Singular Value Decomposition (SVD)

SVD is an effective mathematical tool used to analyze

matrices. In SVD transformation, a matrix can be

decomposed into three matrices that are of the same

size as the original matrix. From the view point of

linear algebra, an image is an array of non-negative scalar entries that can be regarded as a matrix. Without

loss of generality, if A is a square image, denoted as A∈

Rn×n , where R represents the real number domain, then

SVD of A is defined as

A = U S VT

where U ∈ Rn×n

and V ∈ Rn×n

are orthogonal

matrices, and S ∈ Rn×n

is a diagonal matrix, as

Here diagonal elements i.e. σ’ s are singular values

and satisfy

σ1 ≥ σ2 ≥…. σr ≥ σr+1 ≥ =……= σn=0

It is noticeable that the unique property of the SVD

transform is that the potential N2 degrees of freedom or

samples in the original image now get mapped into:

S ⇒ N Degrees of freedom,

U ⇒ N (N -1) / 2 Degrees of freedom,

V ⇒ N (N -1) / 2 Degrees of freedom, totaling N

2 degrees of freedom.

SVD is an optimal matrix decomposition technique

in a least square sense that it packs the maximum signal

energy into as few coefficients as possible. It has the

ability to adapt to the variations in local statistics of an

image.

1.2 SVD Example As an example to clarify SVD transformation,

suppose A

T D Venkateswaran et al, Int.J.Computer Technology & Applications,Vol 5 (2),351-356

IJCTA | March-April 2014 Available [email protected]

351

ISSN:2229-6093

If SVD operation is applied on this matrix, then the

matrix A will be decomposed into equivalent three

matrices as follows:

Here diagonal elements of matrix S are singular

values and we notice that these values satisfy the non

increasing order: 77.9523 ≥ 27.5619 ≥ 1.3349.

1.3 Properties of SVD Generally a real matrix A has many singular values,

some of which are very small, and the number of

singular values which are non-zero equals the rank of

matrix A. SVD has many good mathematical

characteristics. Using SVD in digital image processing

has some advantages:

i) The size of the matrices from SVD transformation

is not fixed and can be a square or a rectangle. ii) The SVs (Singular Values) of an image have very

good stability, i.e. when a small perturbation is added

to an image; its SVs do not vary rapidly;

iii) SVs represent algebraic image properties which are intrinsic and not visual.

As for example, figure 1(a) and 1(b) show an image

and the same image after Gaussian blur of size 9x9

respectively. The highest five singular values of the

original image and the Gaussian blurred image are

presented in the table which clearly shows that the

singular values are almost same i.e. the changes in the

singular values are very small which demonstrate the

good stability of the singular values of an image even

after the manipulation on the image.

Fig1(a)original image Fig 1(b) Gaussian blurred image

Here we have presented an analysis of the effects of

ordinary geometric distortions on the singular values of

an image:

• Transpose: Every real matrix A and its transpose

AT have the same non-zero singular values.

• Flip: A, row-flipped Arf, and column-flipped Acf

have the same non-zero singular values.

• Rotation: A and Ar (A rotated by an arbitrary

degree) have the same non-zero singular values.

• Scaling: B is a row-scaled version of A by

repeating every row for L1 times. For each non-zero

singular value λ of A, B has square root of L1λ

. C is a column-scaled version of A by repeating

every column for L2 times. For each non-zero singular value λ of A, C has square root of L2λ

. If D is row-scaled by L1 times, and column-scaled

by L2 times, for each non-zero singular value λ of A, D

has square root of L1 L2λ

• Translation: A is expanded by adding rows and

columns of black pixels. The resulting matrix Ae has the

same non-zero singular values as A. Because of these

properties, SVD may be used as a tool to develop semi-

blind watermarking schemes.

This paper is organized as follows. In section II, we

review the literature in the area of defect detection in

fabric image. In section III, we give the proposed defect

detection algorithm using singular value decomposition

T D Venkateswaran et al, Int.J.Computer Technology & Applications,Vol 5 (2),351-356

IJCTA | March-April 2014 Available [email protected]

352

ISSN:2229-6093

technique. In section IV, we give the results and discussions and in section V we provide the conclusion

for this paper.

2. LITERATURE REVIEW Methods that are found in literature for the

inspection of patterned texture images include the

traditional image subtraction methods [6-10], the

method of golden image subtraction (GIS) [1], the

method of wavelet-preprocessed golden image

subtraction (WGIS) [1], the method of Direct-

Thresholding (DT) based on wavelet transform [1], the

Bollinger Bands method [2], the Regular Bands

method, the Local Binary Pattern (LBP) method [3],

and the motif-based methods [4, 5].

The basic GIS method involves a training stage with lot of defect-free samples and a testing stage [1]. In the

training stage, the energy of the golden image

subtraction, which is defined as the sum of absolute

difference between the golden image (a template unit of

size that is more than that of the periodic unit) and a

histogram-equalized reference image (defect-free

image) over a given window, is obtained at every pixel

location. Thresholds are obtained from several defect-

free images. In the testing stage, energies obtained from

the golden image and the defective test images are

compared with the thresholds obtained from the

training stage to find the defects after using a median

filter or Weiner filter to perform filtering. The method

was tested with 30 defect-free and 30 defective pmm

images. The detection success rates obtained for the

pmm images are 100% for defect-free images and

56.67% for defective images. The overall success rate was found to be 78.33%. In order to conquer the

sensitivity of this method to noise, the WGIS method

was developed [1]. This is similar to the GIS method

expect that a Haar wavelet transform is applied over all

the images and the sub-images (in level-1

approximation) are utilized instead of the original

image. The overall success rate was improved to

96.7%.

The traditional image subtraction method developed

by Chin and Harlow for the examination of printed

circuit boards involves a direct subtraction of the image

that is under inspection with a defect-free template

image [6]. Since this method involves pixel to pixel

comparison, it is sensitive to noises and distortions.

Khalaj et al. developed a method of inspecting

patterned wafers based on periodicity estimation using

a gray value projection and a reference image that is constructed from the input image itself using the

average gray values of all the periodic units [7].

Pixel-to-pixel comparison between the test image

and the reference or template image, which is based on

an assumed threshold, helps in identifying the defects.

Xie and Guan presented a similar method, wherein the building block needed for constructing a reference

image is extracted based on linear interpolation [8].

However, when the defect size in the image is too

large, the building block constructed based on the

methods recommended in [7, 8] can never be a good

estimate of the true value.

In the method of DT [1], the Haar wavelet transform

is applied to the reference images and the fourth level

horizontal and vertical details are extracted. Lower and

upper bound values of the three horizontal details in

level-4 and also vertical details are extracted and their

averages are calculated after filtering. Thresholds

obtained using these horizontal and vertical details in

the training stage with defect-free images are utilized in

the testing stage for finding the defects in pmm images.

The detection success rates were found to be 86.77%

for defect-free images and 90% for defective images.

The overall detection success rate was found to be 88.3%.

Fabric defect detection using the modified local

binary pattern (LBP) [3] involves two stages, namely,

the training stage and the defect detection stage. In the

training stage, the LBP operator is applied to an image

of defect-free fabric pixel-by-pixel, and a reference

feature vector is computed. The defect-free fabric is

then divided into several windows of size that are

slightly more than that of periodic unit and an LBP

operator is applied to each of these windows to get a

suitable threshold from the defect-free image. In the

detection stage the defective fabric is divided into

several windows (as in the training stage) and LBPs are

obtained. Defects are then located in the fabric based

on the threshold. The method was tested on pmm, p2,

and p4m images and the detection success rate was

found to be 96.7%. Ngan et al. [4, 5] developed motif-based methods

for detecting defective lattices from 16 out of 17

wallpaper groups based on energy and the variance of

the hand-located lattices. Minimum- maximum

decision boundaries (rectangular boundaries) are

obtained in an energy variance space from several

defect-free test images using hand-located defect-free

and defective lattices that are said to be composed of

motifs[4]. The energy of the moving subtraction

between a motif and its circular shift matrices is

derived using a norm-metric measurement and the

variance of the energies for all motifs is obtained. By

learning the distribution of these values over a number

of defect-free lattices, boundary conditions for

discerning defective and defect free lattices are

obtained. As the 16 wallpaper groups of patterned

fabric can be transformed into three major groups, namely, pmm, p2, and p4m, the method was evaluated

T D Venkateswaran et al, Int.J.Computer Technology & Applications,Vol 5 (2),351-356

IJCTA | March-April 2014 Available [email protected]

353

ISSN:2229-6093

over these three major wallpaper groups. Decision boundaries were obtained using 160 defect-free lattices

samples and the method was tested with 140 defect-free

and 113 defective samples. An overall detection

success rate of 93.3% was achieved.

3. PROPOSED ALGORITHM

The steps for proposed Defect Detection Algorithm are

as follows:

Load the Test Texture image in BMP or JPEG Format.

Reduce the noises in Test Texture image using

median filter.

Convert the Test Texture image to Gray scale

image.

Find the first singular value using singular

value decomposition technique.

Compare the singular value with the reference

image.

If the difference is greater than detection

sensitivity level (D), declare that test fabric

image is defective; otherwise test fabric image

is defect free.

The flowchart of the Algorithm is shown in Figure I.

4. RESULTS AND DISCUSSIONS

Table I shows the values of first singular value of a

synthetic fabric texture image for different types of

defects presence in fabrics. . The value of D is within

20 for fabric texture image to declare defect free;

otherwise the fabric texture image declared defective. Figure II shows the pictorial representation of Table I

The real fabric texture images show vast difference in

singular values if the defect presence in the fabrics

compare to synthetic fabric images. Figure III shows

the pictorial representation of Table II

5. CONCLUSION

In this paper, singular value decomposition technique

has been effectively used for the development of the

automated defect detection scheme for fabric texture

images. Experiments on real fabric images with defects

show that the proposed method is robust in finding

fabric defects. Thus, the proposed method can

contribute to the development of computerized defect detection in fabric industries.

Figure I Flowchart of Defect Detection algorithm

REFERENCES

[1] H.Y.T. Ngan, G.K.H. Pang, S.P. Yung and M.K.

Ng, “Wavelet based methods on patterned fabric defect detection,” Pattern Recognit., Vol.38, No.4, 2005,

pp.559-576.

[2] H.Y.T. Ngan and G.H.K. Pang, “Novel method for

patterned fabric inspection using Bollinger bands,”

Opt. Eng., Vol.45, No.8, 2006, pp.087202-1-15.

[3] F. Tajeripour, E. Kabir and A. Sheikhi, “Fabric

Defect Detection Using Modified Local Binary

Patterns,” Proc. of the Int. Conf. on Comput. Intel. and

Multimed. Appl., Sivakasi, Tamilnadu, India,

December, 2007, pp.261-267.

[4] H.Y.T. Ngan, G.H.K. Pang and N.H.C. Yung,

“Motif-based defect detection for patterned fabric,”

Pattern Recognit., Vol.41, No.6, 2008, pp.1878-1894.

[5] H.Y.T. Ngan and G.H.K. Pang, “Ellipsoidal

decision regions for motif-based patterned fabric defect

detection,” Pattern Recognit., Vol.43, No.6, 2010,

pp.2132-2144. [6] R.T. Chin and C.A. Harlow, “Automated visual

inspection: A survey,” IEEE Trans. on Pattern Anal.

and Mach. Intel., Vol.4, No.6, 1982, pp.557-573.

[7] B.H. Khalaj and T. Kailath, “Patterned wafer

inspection by high resolution spectral estimation

LOAD THE TEST TEXTURE IMAGE

NOISE REDUCTION USING MEDIAN FILTER

COMPARE THE FIRST SINGULAR VALUE WITH

REFERENCE IMAGE

CONVERT THE RGB IMAGE TO GRAY SCALE IMAGE

FIN D THE FIRST SINGULAR VALUE USING SINGULAR

VALUE DECOMPOSITION

IF DEFECT

DETECTED?

DEFECT FREE TEST TEXTURE

IMAGE

DEFECTIVE TEST TEXTURE

IMAGE

END

NO YES

T D Venkateswaran et al, Int.J.Computer Technology & Applications,Vol 5 (2),351-356

IJCTA | March-April 2014 Available [email protected]

354

ISSN:2229-6093

techniques,” Mach. Vision and Appl., Vol.7, 1994, pp.178-185.

[8] P. Xie and S.U. Guan, “A golden-template self-

generating method for patterned wafer inspection,”

Mach. Vision and Appl., Vol.12, 2000, pp.149-156.

[9] Gonzalez, R., R. Woods and S. Eddins, 2004.

“Digital Image Processing Using MATLAB”. 1st Edn.,

Prentice Hall,

[10] Jain A K,”Image Analysis and Computer Vision”, PHI, New Delhi, 1997

TABLE I SINGULAR VALUES OF SYNTHETIC FABRIC IMAGES SYNTHETIC FABRIC

TEXTURES

FIRST

SINGULAR

VALUE

SINGULAR

VALUE

DIFFERENCE

RESULT OF

TRADITIONAL

INSPECTION

RESULT OF

PROPOSED

METHOD

CLEAN REFERENCE FABRIC 44236 0 DEFECT FREE DEFECT FREE

HOLE DEFECT 43200 1036 DEFECTIVE DEFECTIVE

STAIN DEFECT 44216 20 DEFECTIVE DEFECTIVE

MISS-PICK DEFECT 45941 1705 DEFECTIVE DEFECTIVE

MISS-END DEFECT 45635 1399 DEFECTIVE DEFECTIVE

DOUBLE-PICK DEFECT 46203 1967 DEFECTIVE DEFECTIVE

DOUBLE-END DEFECT 46208 1972 DEFECTIVE DEFECTIVE

WEFT-FLOAT DEFECT 44425 189 DEFECTIVE DEFECTIVE

WARP-FLOAT DEFECT 44406 170 DEFECTIVE DEFECTIVE

COURSE-PICK DEFECT 44622 386 DEFECTIVE DEFECTIVE

COURSE-END DEFECT 44876 640 DEFECTIVE DEFECTIVE

THIN-PICK 44591 355 DEFECTIVE DEFECTIVE

THIN-END 44451 215 DEFECTIVE DEFECTIVE

IRREGULAR WEFT DENSITY 44069 167 DEFECTIVE DEFECTIVE

4150042000425004300043500440004450045000455004600046500

CLEA

N R

EFE

RENCE F

ABRIC

HO

LE D

EFE

CT

STAIN

DEFE

CT

MIS

S-P

ICK D

EFECT

MIS

S-E

ND D

EFECT

DO

UBLE

-PIC

K DEFE

CT

DO

UBLE

-END D

EFE

CT

WEFT-F

LOAT D

EFEC

T

WARP-F

LOAT D

EFE

CT

CO

URSE-P

ICK D

EFE

CT

CO

URSE-E

ND D

EFE

CT

THIN

-PIC

K

THIN

-END

IRREGULA

R W

EFT DENSIT

Y

Series1

Figure II Pictorial representation of Table I

T D Venkateswaran et al, Int.J.Computer Technology & Applications,Vol 5 (2),351-356

IJCTA | March-April 2014 Available [email protected]

355

ISSN:2229-6093

TABLE II SINGULAR VALUES OF REAL FABRIC IMAGES

REAL FABRIC TEXTURES FIRST

SINGULAR

VALUE

SINGULAR

VALUE

DIFFERENCE

RESULT OF

TRADITIONAL

INSPECTION

RESULT OF

PROPOSED

METHOD

DEFECT FREE REFERENCE 47175 0 DEFECT FREE DEFECT FREE

HOLE DEFECT 45272 1903 DEFECTIVE DEFECTIVE

STAIN 46383 792 DEFECTIVE DEFECTIVE

MISS-PICK 47387 212 DEFECTIVE DEFECTIVE

MISS-END 44730 2445 DEFECTIVE DEFECTIVE

DOUBLE-PICK 42983 4192 DEFECTIVE DEFECTIVE

DOUBLE-END 47631 456 DEFECTIVE DEFECTIVE

WARP-FLOAT 47506 331 DEFECTIVE DEFECTIVE

COURSE-PICK 46849 326 DEFECTIVE DEFECTIVE

WEFT DENSITY 45818 1357 DEFECTIVE DEFECTIVE

TEAR 44757 2418 DEFECTIVE DEFECTIVE

CONTAMINATION 46647 528 DEFECTIVE DEFECTIVE

SNARL 45504 1671 DEFECTIVE DEFECTIVE

DEFECT FREE FABRIC 47182 7 DEFECT FREE DEFECT FREE

40000

41000

42000

43000

44000

45000

46000

47000

48000

DEFE

CT F

REE R

EFE

RENCE

HO

LE D

EFE

CT

STAIN

MIS

S-P

ICK

MIS

S-E

ND

DO

UBLE

-PIC

K

DO

UBLE

-END

WARP-F

LOAT

CO

URSE-P

ICK

WEFT D

ENSIT

Y

TEAR

CO

NTA

MIN

ATIO

N

SNARL

DEFE

CT F

REE F

ABR

IC

Series1

Figure III Pictorial representation of Table II

T D Venkateswaran et al, Int.J.Computer Technology & Applications,Vol 5 (2),351-356

IJCTA | March-April 2014 Available [email protected]

356

ISSN:2229-6093