• No results found

Characterization and classification of fabric defects using discrete cosine transformation and artificial neural network

N/A
N/A
Protected

Academic year: 2022

Share "Characterization and classification of fabric defects using discrete cosine transformation and artificial neural network"

Copied!
6
0
0

Loading.... (view fulltext now)

Full text

(1)

Characterization and classification of fabric defects using discrete cosine transformation and artificial neural network

B K Beheraa & M P Mani

Department of Textile Technology, Indian Institute of Technology, New Delhi 110 016, India Received 25 April 2006; revised received and accepted 21 March 2007

This paper reports how images of woven fabric defects are gathered using charge coupled device imaging technique and digitized. Discrete cosine transformation (DCT) technique is adopted to characterize the defects and back propagation algorithm based artificial neural network is used to classify the various fabric defects. DCT technique is found to give outstanding results for classification of fabric defects. The comparatively high prediction error in one or two cases may be due to the insufficient information about the particular defect from the coefficients of that defect.

Keywords: Artificial neural network, Back propagation training algorithm, Discrete cosine transform, Fabric defects IPC Code: Int. Cl.8 D06H3/00, G06N3/02

1 Introduction

Quality is considered as the most important aspect in the production of textile fabrics. Fabric quality is described by two components, i.e. fabric properties and fabric defects. Fabric property is controlled by selection of raw material, construction parameters and processing methods. However, a fabric defect can occur right from raw material selection to finishing stage, because of the introduction of improper input parameters with respect to material, machine and man. Although the production of 100% defect free fabric is impossible, the defect level can certainly be minimized to larger extent, particularly in country like India where majority of the weaving operations are manual. Despite the availability of automatic technique for production process and management procedures, fabric inspection still depends on human sight and the results are greatly influenced by the mental and physical conditions of the inspector.

Visual assessment is subject to discussion and is slow;

it also purely depends on individual perception.

Comparison of different evaluations of the same specimen by different experts shows the influence of their subjective ideas. Human expertise is expensive and perishable. Therefore, to economize on personnel and to increase the competitive ability of products it is necessary to automate the inspection of fabric defects.

Thus, automated image based inspection offers an attractive alternative to human inspection.1

For automatic inspection of fabric defects by using computer, the fabric texture has to be obtained in the digital form. A line scanning CCD (charge coupled device) camera gives the image of the fabric in the digital form. The digital image is fed to the computer by using a card known as frame grabber card. This digital image, in a spatial domain, often contains periodic structures, non-periodic elements, noise and background. It is sometimes difficult or even impossible to separate and analyze these image components in the spatial domain, as they are often embedded and entangled together. Hence, the image is transformed into frequency domain by using various transformation techniques. Through these transformations, image is characterized by frequency coefficients. The frequency coefficients of a defective image will be different from its non-defective counterpart. Thus, these coefficients of the fabric image are used for defect analysis in further processing, like identification and classification of the image for defects.2,3

For pattern recognition, two different techniques such as expert system and artificial neural network (ANN) are generally used. Expert system studies the problem of cognition and learning. The systems try to model the process by computer algorithms by involving if-then type of rules. Artificial neural network is a copy of human brain, which works on the

__________

a To whom all the correspondence should be addressed.

E-mail: behera@textile.iitd.ernet.in

(2)

principle of parallel processing. The ANN has neurons, which are the processing elements of the network. Each neuron receives input from a number of other neurons or from an external source. The connections between different neurons are represented by weights, which play an important role in the functioning of the network. The inherent advantages of ANN, such as good learning capacity, dynamic modifiable behaviour, parallel processing principle and fault tolerance nature, can be effectively utilized to accurately classify the fabric defects, whose textures differ somewhat from each other.4

The digital images of the fabric, that can be obtained from the line scanning CCD camera have to be processed and used for defect classification by using ANN. In this work, an attempt has been made to develop appropriate technique that is best suited for fabric defects classification.5,6 . Warren and Harsh 3 tried with three different image analysis techniques, such as the sobel edge operator, the fourier transform, and the discrete wavelet transform, for characterization of fabric defects due to missing picks and ends, and observed that the wavelet transform, used as a multi-resolution spectral filter, is able to give both spectral and frequency information about the fabric sample images.7,8

Neural fuzzy system is compared with back propagation for detection of eight types of fabric defects, namely missing end, missing pick, double ends, double picks, hole, light filling bar, cob-web and oil stain.9,10 In this work, the discrete cosine transform technique is used for the characterization of fabric defects, and back propagation based multi-layer perceptron neural network is used for classification of various fabric defects. 11,12

2 Materials and Methods

2.1 Method of Image Grabbing and Transformation

The image of the fabric was obtained by using the Dalsa CCD line scan cameras with proper lighting arrangement to illuminate the fabric. The focal length

and the aperture of the CCD camera were selected appropriately to get the proper image from the camera.

These images were transferred to the computer for further processing. Mutech 1500 frame grabber card was used to transfer the image from camera to computer. So, the digitization process need not be done. The image from the camera was in the spatial domain. This had been converted into frequency domain. For this, a new transformation technique known as discrete cosine transformations (DCT) was used. This technique is selected because for most practical images, of all the different transform techniques the DCT comes closer to the Karhunen- Loeve transform (KLT) in its energy compaction properties. Out of all the transformation techniques compared, though the calculation of fourier transformation can be made faster, by using fast fourier transform (FFT) technique the coefficients are not uncorrelated, resulting in poor quality reconstructed image. Though the KLT technique is the best as it requires less number of coefficients to reconstruct the image, it involves complex computation and takes more time to get the coefficients, whereas the computation part of DCT is relatively simple, giving the result closer to KLT. Hence, this technique is selected. In addition to its better energy compaction, the DCT possesses another interesting advantage over the discrete fourier transform. The DFT (discrete fourier transform) has the problem of blocking artifact, whereas DCT does not.

The DFT transforms a complex signal into its complex spectrum. However, if the signal is real as in most of the applications, half of the data is redundant.

The imaginary part of the signal is zero and both the real and imaginary parts of the spectrum are symmetrical. As a real transform, DCT transforms real data into real spectrum and therefore avoids the problem of redundancy. Also as DCT is derived from DFT, all the desirable properties of DFT are reserved.

The computation model of the 2 dimensional DCT is shown in Fig. 1.

Fig. 1⎯Computation of the 2-dimensional DCT

(3)

If [f] is the representation of N*N size matrix form of the image then the coefficients are calculated by using DCT, as shown below 9:

-1 -1

2 m=0 n=0

4c( , ) (2m+1) π

F ( , )= [f] *cos

(2n+1) π 2

*cos 2

N N

u v u

u v N N

v N

∑ ∑

where u,v = 0,1,2,….N-1; and c(u,v) = 0.5 for u = v = 0;

= 1.0 for u, v = 1,2,3, …N-1.

Thus, by using DCT, uncorrelated coefficients are estimated and by using these coefficients as input to the ANN, the network is trained. For different images, say for defect free fabric image and other defect images like a missing end and broken pick, the coefficients would be different. Therefore, the network has been trained with different types of defective fabric images.

2.2 Artificial Neural Network

The artificial neural network adopts back propagation, supervised learning algorithm. The network architecture was multilayer architecture, with an input layer, a hidden layer and an output layer. The neurons in the input layer were selected according to the number of inputs, that is the transformation coefficients obtained from the image.

The number of neurons in hidden layer is generally taken more than that in the input layer. The optimum number of neurons in hidden layer was selected by trying with different number of neurons. Higher number of neurons in hidden layer may give better result and at the same time the processing time was also more. The number of neurons in output layer was selected depending upon the number of output parameters. A schematic diagram of back propagation network is shown in Fig. 2.

The weights linking the processing elements of the network, i.e. the neurons, were given random values and based on the error calculated the weights were changed in the training process. The algorithm includes momentum factor in calculating the new weights for subsequent iterations. The inclusion of momentum factor causes the network not to stuck-up in any local minima. A factor known as learning rate was included for adjusting the weights by subtracting a whole or a partial amount of activation from the old weight.

The above network parameters were used to train the network. In the supervised learning, for each set of input data the desired corresponding output data need to be given. The transfer function used in the processing elements was log sigmoid function. The function has values between 0 and 1. If the output data for training are not in the range of 0 and 1, then those data have to be normalized to make them in the range. Dividing the output data by the maximum value among them does the normalization. Figure 3 shows a basic sigmoid function.

Fig. 2⎯Back Propagation network architecture

1.0

Y

X

Y = 1/(!+ex)

Fig. 3⎯Basic sigmoid function

2.2.1 Network Training

Due to the higher learning accuracy, faster recall and simple theory, the back propagation algorithm has been used to train the neural network. The pattern of connectivity characterizes the architecture of the network. The flow chart for training the network is shown in Fig. 4.

3 Results and Discussion

Ten images, each of eight different kinds of fabric defects, were used for analysis. These images were of

(4)

Initialization of the weights linking the neurons in input & output hidden layers at random values

Reading the input & desired output data files

Calculation of output for each neuron in hidden layer using sigmoid function

Calculation of squared error between desired output & calculated output Input parameters

Calculation of derivatives with respect to weight change to determine variation of error

Calculation of derivatives of error with respect to output of sigmoid function

Hidden layer neurons, learning rate, momentum factor, number of training data

Assigning zero value to the weights linking the inter layer neurons

Reduction of the oscillations by introduction of momentum factor

Fig. 4⎯Algorithm for network training

the size 256 pixels by 256 pixels. The images were in bitmap format. Figure 5 shows the kinds of the defects taken.

3.1 Image Processing

Discrete cosine transformation coefficients of the images were obtained by writing a program using VC++. In this technique, to calculate the coefficients the image was divided into number of blocks of equal size. In this work, each image of size 256 pixels by 256 pixels was divided into 16 blocks, each having the size 64 pixels by 64 pixels.

From the complete image pixel value matrix, the pixel values of each block were separated and these blocks were used to calculate DCT coefficients. For each block, one DCT coefficient was calculated.

Thus, for each image, 16 DCT coefficients were

calculated. Due to the energy compaction property of DCT, the information of the complete image was given by these coefficients which are uncorrelated, i.e. the information from each coefficient of the image is unique. A typical calculated DCT coefficient of one set of eight different defective fabric images is given in Table 1.

These coefficients were different for the eight defects. Thus, the different defective images were characterized by these DCT coefficients which were given as input to the neural network program.

3.2 Neural Network Training

The neural network was trained with the above-said input (DCT coefficients) and desired output values of the eight defects. The network parameters used for training are given below:

(5)

Thick weft yarn Weft crack

Broken warp Warp float

Weft bar Weft float

Starting mark Mixed weft

Fig. 5⎯Images of different fabric defects Table 1⎯DCT coefficients for different defects

Thick weft yarn Weft crack Mixed yarn Broken warp Warp float Starting mark Weft float Weft bar

9275.625006 9183.656256 9219.781256 9154.562506 9300.625006 9192.171881 9293.140631 9291.921881 9138.625006 9203.406256 9189.984381 9156.171881 9098.390630 9224.093756 9264.765631 9202.234381

9275.62501 9183.65626 9219.78126 9154.56251 9300.62501 9192.17188 9293.14063 9291.92188 9138.62501 9203.40626 9189.98438 9156.17188 9098.39063 9224.09376 9264.76563 9202.23438

6013.984379 5935.968754 5657.437503 5332.218753 6942.281254 6741.640629 6777.328129 6242.859379 11053.984382 11017.765632 10924.421882 11035.875007 11218.000007 11100.656257 11072.156257 11021.828132

9247.859381 9165.343756 9212.578131 8987.640630 9162.593756 9183.015631 9120.531256 8835.671880 9166.062506 9188.359381 9143.859381 8796.562505 9164.734381 9267.000006 9173.125006 9009.921880

8603.109380 8891.359380 9002.343755 8981.468755 9150.265631 9172.015631 9325.640631 9225.250006 9025.937505 9212.953131 9524.015631 9134.328131 9279.484381 9180.078131 9336.218756 9198.421881

9275.093756 9218.281256 9213.421881 9173.312506 9577.765631 9473.218756 9425.093756 9358.531256 9850.234381 9722.593756 9718.796881 9688.515631 9839.203131 9765.453131 9717.125006 9633.578131

9336.203131 9430.031256 9446.890631 9122.625006 9405.156256 9571.656256 9627.718756 9217.390631 9376.593756 9446.265631 9426.234381 9233.062506 9366.265631 9357.062506 9421.703131 9177.125006

9663.328131 9549.484381 9293.218756 9332.359381 9193.562506 9250.125006 9182.187506 9129.171881 8790.390630 8878.156255 8873.640630 8734.250005 9226.828131 9281.953131 9194.781256 9064.375005

(6)

4 Conclusions Number of input(s) to the network : 16

Number of neurons in input layer : 16 A novel scheme of characterizing and classifying defects in woven textile fabrics has been attempted.

The use of imaging technology has resulted in high quality image acquisition and the algorithm allows image processing and pattern recognition to be performed quickly and inexpensively. This back propagation based neural network coupled with the DCT technique can lead to outstanding results for classification of various fabric defects. The comparatively high prediction error in one or two cases may be due to insufficient information about the particular defect from the coefficients of that defect.

The other reason may be the inability of the network to get trained properly.

Number of hidden layer(s) : 4 Number of output(s) from the network : 1 Number of neurons in output layer : 1

Learning rate : 0.001

Momentum factor : 0.01

Transfer function : Log sigmoid

Training : 50000 epochs

Sum squared error : 0.02364

When the network was trained with different number of neurons in hidden layer, the target error was not reached even after several thousands of iterations. Hence, 64 neurons were tried and the target error was achieved in less number of iterations. When the target error was achieved, the weights, linking the neurons in the input, hidden and output layers were stored.

References

1 Takato M, Takagi Y & Mori T, Automated Inspection and High Speed Architectures (Sage Publications), 1988, 151.

2 Dewaele P & Gool L V, Proceedings of International Conference on Computer Vision (Woodhead Publishers), 1991, 575.

3.3 Testing using Trained Network

The trained weights were used to classify the defective images of similar types of those trained defective images. The prediction error was calculated by dividing the difference between calculated output from network by the desired output. The prediction error calculation was done using the following formula:

3 Warren J Jasper & Harsh Potlapalli, Text Res J, 65 (1995) 683.

4 Shimizu Yoshio, Ishikawa Tadashi & Kayama Nobushige, J Soc Fiber Sci Technol Jpn, 46 (1990) 460.

5 Ribolzi S, Merckle J, Gresser J & Exbrayat P E, Text Res J, 63 (1993) 61.

6 Vangiluwe L, Sette S & Pynckels F, Text Res J, 60 (1990) 244.

7 Tsai I Shou & Ming Chuan Hu, Text Res J, 66 (1996) 474.

8 Jiahan Chen & Jain Anil K, IEEE, CH2556-9/88/0000-0029 (1988).

Prediction error % Calculated output desired output

= 100

Desired output

×

9 Chang Chiun Huang & I Chun Chen, Text Res J, 71 (2001) 100.

10 Rosenfeld Azriel & Kak Avinash C, Digital Picture Processing (Academic Press Inc, Florida), 1982, 194.

The error in prediction of the trained network for different defective images is thick faults 1.47, and weft crack 1.47. This error is well within the acceptable limits excepting a few cases where insufficient information about the defect is available.

11 Gonzalez R C & Woods R E, Digital Image Processing (Addison-Wesley Publishing Co. Inc, New York), 1992, 342.

12 Image Processing Tool Box for use with Matlab (The MathWorks Inc. USA), 2005.

References

Related documents

Optical Character Recognition uses the image processing technique to identify any character computer/typewriter printed or hand written.. A lot of work has been done in

Prateek Mishra (212ec3157) Page 33 the field of ANN , Functional link layer Artificial Neural Network(FLANN) based ANN, Multilayered Perceptron (MLP), Back

(iii) To separate the data into P300 and No-P300 waves using Artificial Neural Network. 2)To characterize the P300 waves for brain computer interface using multiclass

Index Terms—speech recognition, feature extraction, discrete wavelet transforms, wavelet packet decomposition, classification, artificial neural networks..

The DCT approach exploits the feature extraction capability of the Discrete Cosine Transform invoking both geometric and illumination normalization techniques which

An automatic method for person identification and verification from PCG using wavelet based feature set and Back Propagation Multilayer Perceptron Artificial Neural Network

Prediction of yarn properties from fibre properties and process parameters using artificial neural networks formed the prime focus of this thesis. The performance of neural

This paper has reviewed the applications of four of these tools, namely, knowledge based systems, fuzzy logic, artificial neural network and genetic algorithm for stator