AN EFFICIENT QUALITY CONTROL SYSTEM BY MACHINE LEARNING FOR SURFACE DEFECTS

,


I. INTRODUCTION
The manual techniques for surface defect detection require only trained operators to check corresponding defect criteria. It will always lead to intricacy in surface defect detection. Over the years numerous researches are carried out to improve the defect detection system without human involvement. Intensive research work has been undertaken in the development of automated analysis methods to assist manufacturing industries. The salient features of the some of the relevant ones are outlined here.
Artificial Neural Network based ADD is discussed in [1] for strip steel surface. It employs self adjusted learning rate with back propagation algorithm and diagnoses the middle flaw in strip steel surfaces. An ADD system is designed for machine parts in [2]. The surface roughness is also measured and the micro cracks are identified from the scanned electron microscope images by different control techniques.
An image recognition is system is developed in [3] for detecting defects in steel ball's surface. At first, region growing technique is employed to detect the scratch and cluster spots in the ball's surface. Then, they are classified by a extreme learning classifier with different kernels. Surface defect in leather is discussed in [4] using ANN and Decision Tree (DT). To select the best attributes, DT is employed and then feed forward ANN is employed for the defect detection in leather.
The co-occurrence matrix based features are employed in [5] for surface roughness detection in graphite. It uses the features from the co-occurrence matrix such as secondary moment and entropy. To predict the surface roughness, linear regression is employed. Wavelet based defect detection is discussed in [6]. The textural features are extracted by using wavelets to detect hole, scrape, corrosion and wrinkle. The variance changes are utilized for detecting the defects in steel process.
The surface quality of ceramic tiles is discussed in [7]. At first, the images are preprocessed using auto regressive ANN to generate the features and then classification of ceramic tiles is obtained by probabilistic ANN. Deep learning is employed in [8] for defect detection in steel sheets. It uses two architectures; U-Net and residual U-Net for detecting multi-level defects. The adversarial neural network is described for generating images with various defects in [9]. The defect images generated by the designed architectures provide better results for the classification.
AN entropy segmentation approach is discussed in [10] for steel surface defects detection. The non-uniformity in the input image is removed at first and teh local entropy feature is utilized for the segmentation of defect region. The exact region is selected by the background subtraction approach. A multi-classifier system is discussed for defect detection in [11]. It uses Hu moment features and support vector machine classifier for different features and also combination of features. Finally, majority voting procedure is employed for the classification. An improved Gabor filter base ADD system is discussed in [12]. The generated energy maps are segmented by region grouping and pruning along with the hysteresis thresholding.
In this paper, an efficient ADD system for surface defects in steel alloy and cast iron is presented using Gabor expansion with PCA. The next section gives the overview of the design of the proposed ADD system. Section 3 provides the results of the system performed on 50 samples. The conclusion is arrived based on the results in section 3 which is discussed in the last section.

II. METHODS AND MATERIALS
The defect detection in manufacturing industries plays a dominant role to increase the productivity in associated with high quality products. The surface defect detection system indicates the defects while manufacturing process. Hence it avoids the risk of too much steel exhausted. Thus, the ADD system identifies the defects, before the material conceded to successive stage. Consequently, it is considered as predominantly valuable approach for early stages of manufacturing process. Hence, any successful machine vision applications solely depend on complete understanding and quantification of quality control automation, which enhance the profitability by increasing speed and production throughput.
This research work mainly focuses to develop an ADD system for accurate identification and localization of defects present in raw materials and machined surfaces. In this study, defects and non defect surface images are characterized by classification process. Subsequently, the defective images are subjected into segmentation approaches to localize the defects. Figure 1 shows the ADD system using Gabor expansion with PCA for classification and local thresholding for defect detection.

A. Gabor Expansion
The two-dimensional Fourier transform maps an image into a twodimensional frequency space where the magnitude of each complex coefficient represents the signal intensity at a particular frequency. However, the Fourier transform coefficients are not spatially localized and hence, do not convey any information regarding the frequency content of the image a t a particular location. Since we are interested in segmenting an image, we require localized features.
The Gabor Expansion [13][14] is one method which represents an image in term s of functions which are localized in space and frequency and expands an image into the four-dimensional space/space-frequency representation. The magnitude of each complex Gabor coefficient represents the relative intensity of a basis function of a specific frequency at particular location in the image. The localized nature of these coefficients renders them useful for texture segmentation.
In general, any function may be used as the basis of the Gabor Expansion, however, the Gaussian function has been shown to belong to a class of functions which meet the uncertainty inequality in the joint space/ space-frequency domain by an equality and hence, this function is optimal in the sense that it minimizes the joint uncertainty in frequency and position. However, computation of the Gabor coefficients with a Gaussian basis is not numerically stable and is difficult to compute. To obtain the Gabor coefficients, Zak transform is employed in this study.
The Gabor Expansion may be computed using Gaussian functions with different variance parameters, thus having different sizes. If the Gabor Expansion is performed using large scale Gaussian functions, a greater portion of the image will be represented by each Gabor coefficient and the image portion will be represented more finely in the frequency domain. Therefore, by using Gaussians at different scales, image analysis at different resolutions may be performed, resulting in a multiresolution scheme. Multiresolution analysis schemes have Input Images been shown to possess several advantages and in the context of texture segmentation such schemes gain special importance since texture is highly scaledependent. The determination of the most suitable scale for analysis is critical for the success of texture segmentation. In a multiresolution approach the texture image is analyzed at different scales leading to a more general algorithm. Therefore, the multiresolution Gabor Expansion is recognized as a powerful tool in texture analysis. In this chapter we shall show how texture features may be derived from the multiresolution Gabor Expansion to be successfully used to segment different texture regions in an image.

B. Principal Component Analysis
This section presents a feature reduction method called the PCA [15][16]. The PCA derives its basis vectors from the covariance matrix.

B.1 Covariance
The covariance matrix measures in this context, the linear association between features (data). In a 2-D plot of features, scattered and close points imply a weak and a strong association between data values respectively. If these data points decrease or increase together, the covariance matrix is positive. The negative and positive terms tend to cancel when there is no trend in the data resulting in a covariance of zero. If the components of a random vector are mutually uncorrelated, the covariance matrix is diagonal. Diagonal elements of a covariance matrix are always positive.
The covariance of x vectors is: The mean vector is of dimensionality 2 M and the covariance is an M matrix. A covariance shows the spread of samples around their respective class mean. In the above Equation M is the number of features in the input matrix, C is the covariance and m is the mean. Normalizing each set converts the covariance between features into a correlation. The zero mean data (data in which the mean has been subtracted) in the above Eqn,2 eliminates the average contrast in textured images and it is accomplished through high pass filtering. Average contrast tends to obscure information contained in the data.

B.2 Principal Components
The aim is to reduce the dimensionality of the inputs to a classifier by reducing the number of features and a related benefit from this is an increase in classification speed albeit a slight reduction in classification accuracy in some cases. Although the PCA in this work was employed in feature selection, it is felt that its versatility is explained better by describing how it functions on images and texture. The implementation of the PCA involves creating a covariance matrix from the features extracted from images and then diagonalising this matrix to produce the PCA's basis vectors, the eigenvectors and the Eigen values. An Eigen value is the variance of the data (feature) values about a hyper-plane defined by an eigenvector. The Eigen values are arranged in descending order such that the corresponding eigenvectors are derived in a decreasing order of importance.
The largest Eigen value carries the largest variability and this variance is key to correct texture classification. The eigenvectors also called the principal components represent the direction of greatest uncertainty, hence information along the direction in which the inputs exhibit most variation is retained. Eigenvectors are therefore adapted to the underlying information. Additionally, eigenvectors of a normal matrix are orthogonal and this property results in decorrelated information from features and consequently there is minimal or no redundancy in the resulting output. The data is projected onto the chosen most significant eigenvectors and the result is a linear combination of the original features defined by the eigenvectors. This Eigen filtered data carries discriminative information and it is used as the classifier input.
In terms of texture, the texture with a high directionality is characterized by one or more high Eigen values with eigenvectors having strong directionality in the corresponding direction. Eigenvectors are thus adapted to study the texture. The first principal component corresponds to the largest Eigen value and it is the average of features and it contains in excess of 80% of the variance of the original feature set. Common characteristics of these features appear in the first components, while differences and residual information are in subsequent components. A non-uniform variance on all components suggests a potential for dimensionality reduction. Using a few most significant eigenvectors results in the data with a new variance and energy has been compacted into a few coefficients. The energy computed at the output of a bank of Eigen-filters is useful in texture classification.

C Thresholding
Binarization of an image involves selecting a grey level value (GL) such that any pixel in the image with a value lower than GL is assigned a value of 0 otherwise it is assigned a value of 1. This GL is called a threshold value (the lowest point between any two maxima of a data distribution). The binary image must capture desired information from an image. This section seeks to find a suitable thresholding mechanism. High thresholds remove both noise and a desired signal whereas low thresholds result in the desired high frequency data and also noise on an image. Thus the threshold must be optimized such that there is a compromise between noise removal and retention of the desired information.
The global thresholding [17] which does not adapt to surface local variations but applies a single threshold to the entire image is not useful as desired information due to local changes in the image is lost. In addition, it can perform badly where an image was captured under non-uniform lighting. The grey scale and not binary images preserve information. In the former there is no information lost as all processing involves the use of all the pixels. In contrast, the latter is a result of thresholding. For example, global thresholding when used on images that vary locally, it could result in some of this information being lost. Even when local thresholding is used, setting the mask size is not easy and it can never be perfect.
The implementation of the adaptive thresholding approach involves choosing a kernel size and then moving this kernel a point at a time on the image and computing a local statistic at each point, for example a median. The central pixel in each neighbourhood is replaced by 1 if its value is greater than the local statistic otherwise it is replaced by 0. What make this approach adaptive is the threshold value for each pixel which is dependent on both the current and the neighbourhood pixel values. In the case where the local statistic is the mean grey level value, it excels where the neighbourhood has different grey level values otherwise the mean grey level value will coincide with the current pixel value. The threshold setting level is difficult as the nature of local variations is not known a priori. That is, for the technique to be fully adaptive, the mask size (neighbourhood) must vary according to the nature of the surface of the image region. Where there are a lot of small variations, then a smaller neighbourhood is ideal. Where there is a large variation, then a bigger window (neighbourhood) is ideal. The window size is therefore empirically obtained. This thresholding method is suited to data whose distribution has indistinct peaks.

III. RESULTS AND DISCUSSIONS
The design of the ADD system consists of two steps. The first step is considered as a classification system where the given image is classified into defected or non-defected. The next step is segmentation where the region of defect is identified. Fig. 2 shows sample images used by the ADD system.

Fig. 2 Samples images used for this study
A total of 50 images (25 defect images and 25 no defect images) are employed for the analysis. All images are correctly classified by the Eigen features of Gabor extension representation system with nearest neighbor classifier and thus achieve 100% classification accuracy. Figure 3 shows the defect detection outputs for different thresholding approaches. Second row images are obtained by the Otsu thresholding and the 3 rd row images by iterative thresholding and last row images by teh proposed thresholding system.

Fig. 3 Defect detection outputs for different thresholding approaches
It can be seen from Figure 3 that the Otsu and iterative thresholding techniques do not provide satisfactory performance on machined surfaces. The applied thresholding techniques segment the background and foreground (machined surfaces) only. It is clearly observed that the proposed thresholding system extracts the defects in the defected machined surfaces. It is concluded from the experimental results that the proposed ADD system has the ability to discriminate the defective and defect free surfaces of raw alloy steel and machined surfaces. It requires 0.21seconds to detect the defected region.

IV. CONCLUSION
The ADD system plays an important role in many industries and several algorithms are involved for automated inspection. To improve the accuracy, a novel ADD system is designed by exploiting Gabor expansion, PCA and local thresholding approaches for raw material and machined surface. At first, the ADD system classify whether the given surface image is defective or non defective, if it is defective the defect regions are exactly identified by segmentation process. To classify the images into defective and non defective, the given images are represented by Gabor expansion and the Eigen features are extracted by PCA. By exploiting these features, a nearest neighbor classifier is used for the classification. If the classified images are defective, the defected regions are detected by thresholding approaches. Experimental results show that the ADD system provides promising results with 94.5% detection accuracy and 100% classification accuracy.
Funding Statement: The authors received no specific funding for this study.

Conflicts of Interest:
The authors declare that they have no conflicts of interest to report regarding the present study.