Classification of Knot Defect Types Using Wavelets and KNN

,

the wood.The development of computer science, wood technology, and multidisciplinary works increase the solution ideas of the knot defect detection and classification.At this point, we proposed an algorithm which includes automatic defect detection methods.The algorithm is based on detection of defects, automatically classification.Automatic defect classification method is a system which is intelligent, accurate and reliable and allows the detection of knot classification and the reduction of labour costs [1].
This paper addresses the issue of the automatic quality control of a wood material.There has been a growing interest in research and improvement of the automatic quality control the wood material, especially in wood-rich countries.Because the quality control process takes a lot of time, it causes eye fatigue, low specificity, sensitivity, accuracy in the evaluation of the quality control of wood material.One of the most important issues in the evaluation of the quality control of wood material is the knot classification, because knots directly affect resistance of wood material.Because of these reasons, we automatically tried to determine the quality of the wood material [1].
Automatic defect detection methods consisted of two stages.First stage was the detection of the defects on woods.The second was the classification of the defects.These stages included the acquisition of desired wood images of finding defects, normalization of images and removal of noises, feature extraction, and classification of knot which means the digitization of defects.The images obtained from Oulu University were applied pre-processing methods including image-processing techniques.The pre-processing methods are normalization of images, removal of noises and thresholding of images.Three different thresholding methods are applied to knot images obtained from Oulu University.Three different thresholding methods are global thresholding, minimum crosswise entropy method and Otsu method.The best technique is tried to be determined by increasing the difference between foreground and background of the wood surface.Thus, we aim to make vision improvement of the knot defects apparent.Then, the regions and the distribution of the knot defects are determined using morphological methods.The determined regions are extracted.Features of these regions are extracted by using WM.The extracted features are classified with a classifier based on Euclidean distance with neighbouring approach.
The classifier is employed for classifying seven different types of knots, including leaf knot, encased knot, dry knot, edge knot, horn knot, sound knot and decayed knot.
Regarding the process of identification of knot defect types, a success at the average rate of 98 % is achieved in the study on knot database images taken from University of Oulu.
In the study, determination of knot defect types and quality class of board by detection of knot defects on the floorboard in a shorter time than a sec are carried out.This time is much shorter than a human's average identification the time of all wood defects.

II. RELATED WORKS
Choosing wood by hand and its classification process is a boring and time consuming process.Mohan and Venkatachalapathy tried to classify and identify the knots on wood.Knot images were pre-processing using Hilbert Conversion and Gabor filters.Features obtained from preprocessed were compared by 'bagging' technique and were classified using data mining method [2].
Mahram et al. tried to identify wood knots and cracks in order to be able to classify wood.In order to be able to do this, they applied an efficient and productive classification that bases well defined pattern recognition and feature.They used three different feature extracting technique which are grey level co-occurrence matrix (GLCM), local binary pattern (LBP) and statistical moments.They used LDA and principal component analysis (PCA) in order to decrease dimension of feature.They used support vector machine (SVM) and KNN classifiers in order to be able to classify five different wood knot types [3].
Scanning of lumbers with high speed industrial computer tomography (CT) is a new approach in lumber industry and it is being mentioned that it is not an appropriate method trying to find knots in images with this approach.Johansson et al. developed a method that aims to identify knots in images of CT of lumbers in order be able to segment variable threshold valued knots in cylindrical crusts of CT images [4].
Krahenbuhl et al. present a work with knot identification problem in the three dimensional x-ray CT images of three roots.They are stating that this image type is very different from classical medical images and they have special geometric structures.They have studied about automatically finding knots by analysing wood defects on signified images [5].
The intrusion detection system presented is based on support vector machines that classify unknown data instances according both to the feature values and weight factors that represent importance of features towards the classification [6].
An innovative approach in analysis of the electroencephalographic signals.The proposed method is novel not only because of its efficiency, but also because of the choice of the applied equipment [7].
An algorithm for the script recognition based on the texture characteristics is proposed.A custom oriented database which consists of some text documents written in Cyrillic, Latin and Glagolitic scripts is subjected to the proposed algorithm [8].Back-propagation neural network has been used for the classification of RPM and oil level related gearbox faults.Also, signal was more refined in order to make the feature selection process much more accurate [9].
Zhang and Ye propose a dimensionality reduction algorithm.Because, the dimensions of wood images are high, which is difficult to deal with.They show that the practical usefulness and high scalability of proposed method for wood knot defects recognition tasks [10].
Yu-Hua et al. propose to classify four types of wood knots by using images captured from lumber boards [11].
Ruz et al. present improvements in the segmentation, feature extraction, and the classification modules for wood defect classification.Support vector machine classifier shows 91 % of correct classification on a 550 test wood image which is containing 11 defect categories [1].

A. Knot Database
The database shown in Fig. 1, was labelled by Oulu University Wood Technology Laboratories and published.There are 438 labelled knot images in the database shown in Fig. 1 [12].These knot images, at the same time have 7 different knot types.

B. Pattern Recognition Process
Patterns must be classification with fast and high accurate rate in order to increase product output in the industrial environment.Proposed system need to make quick decision in order to create highly accurate and fast classification.Decision is, when the thinking skill of human examined, processing the images taken from outside world and describing them by symbols and making an idea about the objects when he/she sees them by using his/her know-how (data set) with these symbols.
Methods have been developed in order to be able to bring human's vision skill for computers.For example; if it is assumed that defects in a lumber image represent pattern cluster.Each pattern in this cluster needs to be represented in a vector form that computer will be able to process, in order the computer be able to perceive.These vectors are features.The features are extracted by using a wavelet feature extraction algorithm from a lumber image.Then, the obtained features are used to classifying with KNN classifier.This process can be thought as finding knot type to separate categories from each other and best represent its own category [13].
The most representative features can give the best classification results.We should first determine the number of categories in the knot images for classification.The number shows that the patterns divided into several groups or class.
Category number of knots in the images taken with camera was specified as Leaf Knot(0), Encased Knot(1), Dry Knot(2), Edge Knot(3), Horn Knot(4), Sound Knot(5) and Decayed Knot(6). Figure 2 shows the images that fall into this category knots.The images that are given as introduction, were being tried to categorize into 7 different product classes by applying process steps in Fig. 3. Pattern recognition process can be thought of as five steps: image acquisition, image enhancement, image segmentation and detecting the pattern, feature extraction and classification of pattern.We focused on extracting features and classification of extracted features.

C. Wavelet Moment (WM) Feature Extraction Method
In this study, Daubechies db2 kind discrete wavelet type was used while separating signal into its low and high frequency components.Discrete wavelet transformation creates the base of specified different kind wavelet types.Instead of making analyse in the entire scale in discrete wavelet transformation, it is being ensured that specific scale groups are identified and making analyse within this range.
Function is used for discrete wavelet transformation, is given in (1) where m and n are integer, are translation parameters of wavelet in scale and time axis respectively.0  represents a constant translation step and its value is higher than 1. 0  is translation range value in time axis.In (1), translation step in time axis can be expressed as The most commonly used 0  and 0  values are 2 and 1 [14], approach and wavelet function are created by using multiples of 2, can be described such as in ( 2) and ( 3) respectively: For a t S time series that contains N piece sample which has an i discrete time step, discrete wavelet transformation is described as in ( 4) In ( 4), After these operations, two-dimensional discrete wavelet transformation function; approach and detailed information of an image with a 3th degree filtration from Daubechies 'db2' type are shown in Fig. 4. representatively for leaf knot.The decomposition in the Fig. 4 is obtained from discrete wavelet transform.Low frequency component, high frequency component of the main components is called approximation (A) and details (D) respectively in this decomposition.After dividing the sub bands with a standard wavelet transform, approximation component of the signal is again divided into sub-bands with the same procedure.This process is continued until it reaches the desired resolution.
Daubechies db2 type decomposition plot of a leaf knot is shown in the Fig. 5.

IV. RESULT OF IMAGES OF KNOT WITH KNN CLASSIFICATION
In the evaluation, wood knots are formed by using images of 438 labelled knots.The chosen knot types; as Leaf Knot, Encased Knot, Dry Knot, Edge Knot, Horn Knot, Sound Knot and Decayed Knot.Dataset consists of labelled image of knot's each class.Success rates are analysed according to classification with KNN of knot features obtained from DM method, are reported in the experiments.It can display that it will either represent or not represent the interested field in a special object or an image, which is a task of a classifier.Classifier must be trained with sample images beforehand, in order to be able to successfully do this.The classifier being used in this study conducted, is first being trained in order to be able to identify difference or types among separated samples.Detailed study steps are shown in Fig. 7. Their features are extracted from images using DM methods.108 features are obtained by Daubechies db2 and 3 level from specified feature extraction methods.Percentage accuracy rate is tried to be identified by dividing identified knot number to total number in knot clusters; in identification of features obtained from specified feature extraction methods, their success of recognition in classification methods [15].After the test sample x is classified using the nearest neighbour algorithm.Using KNN, a test sample is classified as a values with a positive value k neighbours.In the experimental works, classification of knots carried out by k is taken 8 in this study In the feature vector N, it indicates the of features.

  x f j
x represents the test sample of the th j features.

C f j
, represents the th j features of the th C classes.
KNN is used to classify test knot samples.Features for each knot image are obtained by using Daubechies db2 and 3. Euclidean distance is calculated between the test samples and k neighbours.Euclidean distance formula is given in (5).
Features with training, test, verification and total past time periods of 1260 total knot images obtained from DM algorithms are given in Table I and Table II.Table III shows that compare the results of proposed algorithms with the recently presented methods in [3] and [16] for the same database.

Fig. 1 .
Fig. 1.Some samples of used knot from database.
are wavelet transformation multiples.

Fig. 5 .
General demonstration with wavelet transformation for leaf knot: a) Multilevel 2-D wavelet decomposition of the leaf knot, b) approximation coefficient of db2 type 3 rd wavelet decomposition, c) detail coefficient of db2 type 3 rd wavelet decomposition.

Fig. 6 .
Fig.6.Display the coefficients of approximations and details.First, Second and Third Row: 1 st , 2 nd , 3 rd level of Daubechies db2 type approximation and details coefficients from leaf knot respectively.

TABLE I .
TIME PARAMETERS OBTAINED BY KNN CLASSIFICATION.

TABLE II .
RECOGNITION RATE AND TOTAL TIME OBTAINED BY KNN CLASSIFICATION.

TABLE III .
COMPARISON OF PROPOSED METHOD CLASSIFICATION ACCURACY WITH PREVIOUS METHODS.