Literature DB >> 34307930

Comparison of segmentation and identification of swietenia mahagoni wood defects with augmentation images.

Dwiza Riana1, Sri Rahayu1, Muhamad Hasan1.   

Abstract

The largest income for Southeast Asian countries comes from the export activities of wood production. The potential for timber exports in Indonesia continues to increase each year. This soaring potential needs to be continually improved by maintaining quality so that trust and good cooperation can continue to be established with partner countries. Wood quality is closely related to wood defects. The faster the detection of wood defects is, the faster the quality of the wood will be determined. The wood industry which is still manual is also very susceptible to human eye fatigue. Technology is currently developing rapidly to help human productive activities and image processing is a breakthrough to detect wood defects. This study aims to identify swietenia mahagoni wood defects using the euclidean distance method from the extraction of 6 texture and shape features GLCM (Gray Level Co-Occurance Method) including metric, eccentricity, contrast, correlation, energy, and homogeneity, which was previously segmented with the best segmentation from the comparison results of thresholding and k-means segmentation and produced an average accuracy of 95.33% with an F1 score value of 0.95. The dataset used is the primary dataset with a total of 54 images on 3 types of wood defects, namely growing skin defects on wood ends, rotten wood eye on the body, and healthy wood eye on the body. Cross validation is also applied to test the reliability of the proposed model. By using 3-fold cross validation, the optimal average accuracy is 88.90%. Validation with other similar datasets was also carried out by identifying potato leaf defects resulting in an average accuracy of 92.86% with the most optimal 3-fold cross validation value achieved an average accuracy of 83.33%. Image augmentation is also carried out in order to reproduce the image so that the reliability test of the proposed method can be carried out, namely by rotating the image 45 degrees,90 degrees,120 degrees,180 degrees which produces 84 images of augmentation, so that the total image is 138 images and gets an average accuracy from the image augmentation is 80%.
© 2021 Published by Elsevier Ltd.

Entities:  

Keywords:  Euclidean distance; GLCM; K-means; Swietenia mahagoni; Thresholding; Wood defects

Year:  2021        PMID: 34307930      PMCID: PMC8258648          DOI: 10.1016/j.heliyon.2021.e07417

Source DB:  PubMed          Journal:  Heliyon        ISSN: 2405-8440


Introduction

Tropical rainforests in Southeast Asia contain more than 15000 different plant species, consisting of 3000 categories of wood species. The largest income for Southeast Asian countries comes from the export activities of wood production [1], [2]. Based on WITS (World Integrated Trade Solution) data in 2018, Indonesia's timber exports are spread across 191 partner countries. Among the top partner countries, Indonesia's timber exports including China have a selling value of $ 3,170,496.63 (26.83%), Japan with a selling value of $ 1,375,878.33 (11.64%), the United States with a selling value of $ 838 865, 3 (7.10%), the Republic of Korea with a selling value of $ 753,413.46 (6.38%), and India with a selling value of $ 524,449.63 (4.44%) while the other 43.61% is in 186 other partner countries with a sale value of $ 5,152,764.85 [2], [3]. Swietenia mahagoni (swietenia macrophylla king) is a species known throughout the world and most importantly is economical because of its inherent wood characteristics such as malleability, mechanical resistance, high dimensional stability, and attractive aesthetic aspects [4], [5]. Therefore, there is no doubt that Swietenia Mahagoni wood or mahogany is the timber exported by Indonesia with increasing selling value. This potential needs to be continuously improved by maintaining quality so that trust and cooperation are well-established especially if the supernatural countries are the partners whose timber needs are met by Indonesia. The quality of wood products depends on the strength of the wood. The presence of defects in the wood, particularly knots, may reduce the strength of the wood [6]. Based on the information obtained, the quality of wood is determined based on how many defects are in the wood. Currently, wood examiners are still working to determine the quality of wood manually without any tools, so we can imagine how long it will take. Timber identification systems can be an important system for minimizing fraud in the wood markets [1], [7]. The inspection of visual defects being carried out manually in the wood industry is known to be unreliable due to its susceptibility to human error, for example, due to acute symptoms of headache and eye fatigue [8]. Researchers in China have conducted research related to the identification of wood defects, Zhang Yi Xiang, by extracting LBP (Local Binary Pattern) and GLCM features with 4 extracted features including correlation, Chi-Square coefficient, intersection coefficient, and Bhattacharyya Distance on 40 wood image samples, and it produced 93% accuracy in 3 types of wood defects [9], while Xie YongHua performs feature extraction by combining the Tamura and GLCM methods on 5 features, namely angular second moment, contrast, correlation, entropy, and variance to identify 3 types of wood defects and to produce an accuracy of 92.67% [10]. Swietenia mahagoni wood in Indonesia is very potential and all parties need to know about it to increase the awareness to conserve and pay attention to the importance of recognizing the types of wood defects which then become the determination of wood quality by raising it as a research topic and hoping to get output that can help wood examiners. Since the 20th century, image processing technology has been used gradually in the field of wood defects. The extraction of wood surface defects is the key to quickly identify the types of wood defects, one of which is the GLCM which successfully identifies 3 types of wood defects [9]. This research proposes an image processing technique using the GLCM feature extraction method which extracts 6 features namely metric, eccentricity, contrast, correlation, energy, and homogeneity on 3 types of swietenia mahagoni wood defects namely growing skin on wood ends, rotten wood eyes on the body, and healthy wood eyes on the body with k-means and thresholding segmentation and identification with euclidean distance.

Materials

Dataset

The dataset used is the image of swietenia mahagoni wood defects which were taken directly by the researcher as many as 54 images of 3 types of defects including growing skin defects on the wood ends, rotten wood eye defects on the body, and healthy wood eye on the body in which each defect was taken as many as 18 images [11].

YIQ color space

YIQ is the color space used by NTSC color TVs and used mostly in North and Central America and Japan. The Y component represents luma, and it is the only component used by a black-and-white television receiver. The letter of I means in-phase, and Q means quadrature, referring to the quadrature amplitude component. The YIQ color space is intended to take advantage of the characteristics of human visual response [12].

Thresholding

Image segmentation by thresholding is a simple but powerful approach to image segmentation. The threshold technique is based on the area of the image space, for example, image characteristics [13].

L*a*b color space

The L*a*b Color Space or what is known as CIELAB is the most comprehensive color space established by the International Commission on color illumination (French Commission Internationale de l'eclairage, known as CIE). This color space can describe all the colors that can be seen with the human eye and is often used as a reference color space. The L*a*b color space stands for Luminance (brightness), and A and B are the color components. According to the model L*a*b, A is represented between green to red and B between blue to yellow. The L*a*b model is designed to be model-independent [14], [15].

K-means

K-means algorithm classifies pixels in an image into some clusters based on some similarity of features such as the gray-level intensity of pixels and distance of pixel intensity from pixel intensity centroid [16]. In performing image segmentation, k-means clustering utilizes the gray intensity of the image. This image intensity is what underlies the image clustering. Different intensities will be grouped into different clusters. The formed clusters will be represented by a certain color so that each cluster can be visualized [17].

Gray level co-occurrence method

Feature extraction is intended to get the feature value of an object based on the relationship between the pixel intensity value of an image. GLCM is a statistical method that can be used for texture analysis. Concurrency matrix is formed from an image by looking at the paired pixels that have a certain intensity [18].

Euclidean distance

Euclidean distance is the simplest technique to calculate the distance between two vectors. Euclidean distance is defined as the straight-line distance between two points, which checks the roots of the square difference between the coordinates of a pair of objects. The minimum Euclidean distance indicates the closest distance to the recognition process [19]. Here is the formula for Euclidean Distance: Source: [19] P = P image Q = Q image d = a measure of the distance between the query P and Q images in the database. p = feature vector of P image q = feature vector of Q image

Cross validation

Cross validation is one of the fundamental methods in machine learning for evaluation in a prediction or learning. The performance of model is measured by the average accuracy of validation set from each subset [20]. The performance of model is measured by the average accuracy of validation set from each subset. This process takes full advantage of the entire dataset, when the number of data is small [21]. Cross-validation is a technique for assessing or validate the accuracy of a model built on a dataset. The steps of K-fold cross validation, among others [22]. (1) Divide the available data into K groups. (2) For each K a number of T data sets are made containing all training data except those in the k-th group. (3) Working on the algorithm with a number of T training data. (4) Algorithm testing uses data in group K as test data. (5) Record algorithm results. According to [23] The advantage of the K-fold cross validation technique is that it shows that all elements on the data line are used for training as well as testing.

Method

Image acquisition

Image acquisition is a process by which we obtain a digital representation of a scene [12]. Image acquisition is carried out by taking an image of swietenia mahagoni wood defects using a 13 MP camera with a distance of 30 cm between the object and the camera and in the sun lighting around noon Western Indonesian Time in wood storage. The wood defect images that have been collected are as many as 54 images from 3 types of defects including growing skin defects on wood ends, rotten wood eye, and healthy wood eye on the body, each of which has 18 images. Table 1 consists of the example of the wood defect images.
Table 1

Example of images of wood defects.

Types of wood defectsImage examples
Growing Skin DefectsImage 1
Defect of Rotten Wood EyesImage 2
Healthy Wood Eye DefectsImage 3
Example of images of wood defects. The stages of the research methodology carried out are shown in Fig. 1 and followed by the following explanation.
Figure 1

Research method.

Research method.

Resize

Resizing is a process to make changes in the area of the image to be bigger or smaller than the original size. Making changes to the size can result in a shift in the color value, so it changes the digital content that is in it [17]. In general, images that are manually taken cannot be processed immediately. Because the image is too big, resizing is done by changing the image size from 4160 x 1968 pixels to 832 x 394 pixels so that the image becomes easier to process.

Training & testing data

Training data is a part of the dataset that we train to make predictions or run the functions of an algorithm. We provide instructions through algorithms so that the machines which we train can look for their correlation or learn patterns from the data provided while Testing data is a part of the dataset that we test to see its accuracy or in other words to see its performance [17]. The 54 images that have been collected are divided into 60% training data and 40% testing data consisting of 33 training images with a composition of 11 images on each defect and 21 testing images with a composition of 7 images on each defect. 40% of the data testing was executed or tested in the program after completing all the stages in the training data. The reason for using split trials that have more data in the training set is to give better accuracy. In this study we have confirmed that the 60:40 test set in our dataset predicts accuracy better than the composition of the other split data. This is in line with what was done by previous researchers [24].

RGB to YIQ color conversion

This step is done before the image is segmented using the thresholding method. This YIQ color space has a Y component indicating luma, and this component is the only component used by black-and-white television receivers to be used as the base color before segmentation using the thresholding method that considers the degree of the grayness of the image and forms a black-white image or binary image. The images converted from RGB to YIQ color are then segmented using the thresholding segmentation method to see the degree of grayness because the defect areas in the wood are generally different/darker than other wood areas that are not affected by defects.

RGB to L*a*b color conversion

Unlike the previous one, to perform segmentation using the k-means method, the training data image is converted from RGB to L*a*b color space. Because the k-means segmentation method has the concept of grouping or clustering with the closest colors, the color space must be complete, and the most complete color space determined by International Commission on color illumination is the L*a*b color space. K-means segmentation is performed on images that have been converted from RGB color space to L*a*b color space. This segmentation clusters the colors that exist in the image based on their proximity to the color so that the defect area will be segmented because in general, the color of the defect area in wood is not much different. The wood color of the defect in a particular region is different from the area without the defect. The defective parts in the region tend to be almost the same color, and the areas that are not defective tend to be almost the same color as the areas that are not affected.

Best segmentation

Image segmentation is a fundamental technique in the field of image processing and is widely applied in computer vision. In most cases, this can be described as the pre-processing stage of pattern recognition. Image segmentation is the process of dividing an image into different disjoint pixel classes that have similar characteristics such as grayscale, color, or texture [17]. From the two segmentation techniques, a comparison is made to see which method has better segmentation than 33 training images, and calculation is performed to see how many images are segmented properly by the thresholding method and how many images are well segmented by the k-means method. After knowing which one is better, the segmentation method will be used for further feature extraction.

Feature extraction

In the best segmentation, texture and shape feature extraction on the training data is then carried out using the GLCM method as [25] who performed feature extraction after the segmentation process to analyze texture and to extract values on 6 features including metric, eccentricity, contrast, correlation, energy, and homogeneity on each image in the training data so that a training database for the results of the best segmentation method is formed.

Identification

Image identification or image recognition is done by calculating the closest distance from each of the tested image feature (testing data) in the program after going through the segmentation and feature extraction stages with each feature in the training database according to the concept of the method used, which is euclidean distance. The feature values from the feature extraction using the GLCM method that produces 6 feature values, namely metric, eccentricity, contrast, correlation, energy, and homogeneity on each image, have the same weight. The results of testing data feature extraction, using the euclidean distance for each feature will be reduced and squared, then the results of the calculation of each feature are added up, and so on from initial to final training data to calculate the closest distance as the formula presented in discussion of euclidean distance. The distance between the testing feature value to the smallest training feature value has the greatest possibility of the same defect type, or the type of the defect will be indicated by the type of defect in the training database which has the least Euclidean distance of its feature value.

Result and discussion

The conversion of the RGB (Red Green Blue) color space which becomes the original image color space into YIQ (Luminance, In-phase, Quadrature) color space aims to separate chrominance (color information) from luminance (grayscale information Y) obtained from the RGB model using a linear transformation. This color space depends on Y which is a combination of red, green, and blue intensity and is useful for segmenting in the image. The other two components, I (hue) and Q (saturation), represent color information where I contains hue information of orange, and cyan and Q contains green and magenta color information [26], [27]. Because it is linear and requires fewer computational tasks, it also has a minimum overlap between segmented and non-segmented areas. This color space will be used as the base color for thresholding segmentation in each type of wood defect of Swietenia Mahagoni because of its nature that separates chrominance from luminance, so later when it is converted into a binary image from threshold segmentation result, the wood defect area can be segmented. The results of RGB to YIQ color conversion for each type of defect are as follows. In Table 2, we can see the results of the change in the image of swietenia mahagoni wood defect whose color space is changed from RGB to YIQ. The YIQ color conversion makes the image separated between the defect areas that are darker in the round part such as the eye while the other parts that are not affected tend to looks rosier. The YIQ color space is carried out to facilitate segmentation using a threshold because the defect areas appear more.
Table 2

Result of RGB to YIQ color convertion.

TypesRGBYIQ
Growing SkinImage 4Image 5
Rotten Wood EyesImage 6Image 7
Healthy Wood EyesImage 8Image 9
Result of RGB to YIQ color convertion. This section will explain the results of the segmentation carried out by the thresholding method which has previously been converted into the YIQ color space in Swietenia mahagoni wood defect image. Thresholding converts the image to a binary or black-white image and segments the areas that have been separated by the color space previously performed. This method can divide the pixels in an image into two main groups as “detectors” to distinguish between the background and the object considered to be foreground in the image [28], [29]. The background here is the part that is not affected by defects, and the foreground object is the prominent defect area. The segmentation results based on the type of defect for each are as follows in Table 3.
Table 3

Thresholding segmentation result.

TypesYIQThresholding
Growing SkinImage 10Image 11
Rotten Wood EyesImage 12Image 13
Healthy Wood EyesImage 14Image 15
Thresholding segmentation result. In Table 3, we can see the results of the wood defect image change of swietenia mahagoni segmented by the thresholding that was previously in the YIQ color space. The defect area is shown in black color bordered by white color. The conversion of RGB color space which becomes the original image color space into L*a*b color space aims to provide more color information to the image. L stands for light color, *a stands for red/green coordinates, *b stands for blue/yellow coordinates. This color space is device independent and can control more intensity and color information. These color spaces provide more distinction between colors from one to another due to their independent devices [26]. The advantage of this color model is that it is not affected by the image capture device. This color space will be used as the base color for the k-means segmentation for each type of wood defect on swietenia mahagoni because k-means will be clustered based on color proximity. If the image is made with more color information, k-means will be easier to cluster colors in the image so that it can perform segmentation. The results of RGB to L*a*b color conversion are explained in the following discussion. In Table 4, we can see the results of the wood defect image change of swietenia mahagoni whose color space is changed from RGB to L*a*b in which the defect area looks darker than the other areas. The parts that are not affected by the defects tend to be colorful but rhythmic as if they are the same part. This L*a*b color space is performed to facilitate segmentation using k-means because the defect areas appear more and will be clustered based on the proximity of their colors.
Table 4

The result of RGB to L*a*b color conversion.

TypesRGBL*a*b
Growing SkinImage 16Image 17
Rotten Wood EyesImage 18Image 19
Healthy Wood EyeImage 20Image 21
The result of RGB to L*a*b color conversion.

K-means segmentation

This section will explain the results of the segmentation carried out using the k-means method which has previously been converted into the L*a*b color space in the swietenia mahagoni wood defect image. K-means is done to get a description of the dataset by revealing the trends of other data. The tendency of grouping is based on the similarity of existing data characteristics. The basic idea of this technique is to find the center of each group of data that may exist and then to group each data into one of these groups based on the distance. The data in the image is the pixel and the intensity of the color in it. K-means classifies based on similarity in color or the proximity of pixel values, so k-means segmented areas that have the same color or separated from the areas that have different colors. In this case, it can segment the wood defects from areas that are not affected by defects. The segmentation results based on the type of defect for each are as follows in Table 5.
Table 5

K-means segmentation results.

TypesL*a*bK-means
Growing SkinImage 22Image 23
Rotten Wood EyesImage 24Image 25
Healthy Wood EyeImage 26Image 27
K-means segmentation results. In Table 5, we can see the results of wood defect image changes of swietenia mahagoni segmented by k-means which were previously in the L*a*b color space. The areas other than defects are shown in black, and only defects are shown without being covered with black. After knowing the best segmentation, the texture features and shape of the training image from the results of k-means segmentation are then extracted using the GLCM method on 6 features, namely metric, eccentricity, contrast, correlation, energy, and homogeneity so that a training database is formed. To identify objects, the important thing that must be known is the characteristics possessed by the object. This feature extraction stage aims to determine the characteristics or image patterns. So that when it will be recognized or identified, it will look for the characteristics or patterns contained in the extracted feature values. The following are the results of feature extraction for each type of defect: Growing Skin Defects The following are the results of the extraction of GLCM feature with 6 features, namely metric, eccentricity, contrast, correlation, energy, and homogeneity on the training data for the types of growing bark defects on wood ends. Table 6. shows the values of each feature in each image of growing skin defects on wood ends with the average metric feature value of 0.43588, the average eccentricity feature value of 0.88688, the average contrast feature value of 0.10692, the average correlation feature value of 0.82687, the average energy feature value of 0.87494, and the average homogeneity feature value of 0.98141.
Table 6

Feature extraction results (GS).

metricecce..cont..corr..energyhomog..
0.255930.962870.195580.787720.861780.97241
0.455660.832700.098710.924360.917420.98927
0.527050.879660.017080.758360.939840.99421
0.116660.977300.160840.871750.789660.96929
0.217020.682590.082970.916720.941120.99151
0.341070.879200.019620.733360.939880.99384
0.256930.972620.148190.866970.779810.96798
0.969070.782900.094270.698890.863670.97792
0.756250.900020.102360.849880.884330.98267
0.405850.956760.190890.793090.862240.97247
0.493230.929080.065580.894430.844610.98392

GS (Growing Skin).

Feature extraction results (GS). GS (Growing Skin). Rotten Wood Eye Defects The following are the results of GLCM feature extraction with 6 features, namely metric, eccentricity, contrast, correlation, energy, and homogeneity in the training data on the types of wood knots rotten on the body. Table 7 shows the value of each feature in each image of knots Rotten on the body with the average metric feature value of 0.26857, the average the eccentricity feature value of 0.85274, the average contrast feature value of 0.54337, the average correlation feature value of 0.92276, the average energy feature value of 0.33756, and the average homogeneity feature value of 0.88142.
Table 7

Feature extraction results (RWE).

metricecce..cont..corr..energyhomog..
0.069360.805880.389450.956490.331040.91148
0.052540.813030.422940.951890.340530.91078
0.278350.882420.427270.929570.293290.89094
0.526310.769740.452620.884340.326860.88585
0.066170.823440.809450.894160.371950.85958
0.284670.979530.455530.936600.401450.88588
0.441430.974750.662810.918580.291400.85736
0.190050.967600.425140.929890.294170.89128
0.273150.564140.660020.918600.293510.85794
0.169440.898180.813210.893780.372020.85879
0.602760.901430.458670.936430.396970.88575

RWE (Rotten Wood Eye).

Feature extraction results (RWE). RWE (Rotten Wood Eye). Healthy Wood Eye Defects The following are the results of GLCM feature extraction with 6 features, namely metric, eccentricity, contrast, correlation, energy, and homogeneity in the training data on the types of healthy knots wood defects on the body. Table 8 shows the values of each feature in each image of healthy knots on the body with the average metric feature value of 0.43679, the average eccentricity feature value of 0.83477, the average contrast feature value of 0.22034, the average correlation feature value of 0.91054, the average energy feature value of 0.74756, and the average homogeneity feature value of 0.95529.
Table 8

Feature extraction results (HWE).

metricecce..cont..corr..energyhomog..
0.300370.964450.072180.939160.870830.98099
0.143440.510990.244200.906930.787080.95831
0.292780.990560.181850.897560.866150.97277
0.213920.954170.144140.923600.785210.96583
1.054260.577030.387040.929700.482000.91068
0.470090.926630.176590.898490.868810.97329
0.287450.984340.306090.938640.535250.92025
0.329140.975610.241180.881670.746750.95096
0.419550.947830.127850.955190.710380.96284
0.239380.618420.121020.910570.863250.97659
1.054260.732440.421550.834480.707510.93572

HWE (Healthy Wood Eye).

Feature extraction results (HWE). HWE (Healthy Wood Eye). After going through various image processing techniques and forming a training database, identification is carried out on the testing data where there are 21 images of all types of defects in which each defect has 7 images. Identification is carried out with the aim that each type of defect can be recognized from each shape and texture feature whose feature values have been issued at the feature extraction stage. Image identification is done by calculating the closest distance using the euclidean distance method between the testing data feature value and the training data feature value in the database. The success of the test program is calculated using a confusion matrix. Prior to identification, testing data is also treated the same as training data, namely through the preprocessing and segmentation stages with the best segmentation using k-means. It is intended that the area where the feature value will be extracted is close to one of the feature values in the training data. After segmentation, feature extraction is carried out and the feature value is calculated as the closest distance to the training data feature value, the closest distance will be shown as a result of its identification. The results of program testing are as follows. Table 9 shows that the results of the program testing are 7 images of growing skin types, 7 images of rotten wood eye, and 7 images of healthy wood eye which are used as testing data of the 7 images of growing bark types, 6 images were correctly identified and 1 image was identified as rotten knots. From 7 images of rotten knots, 7 images were correctly identified, and from 7 images of healthy knots, 7 images were correctly identified.
Table 9

Program testing result.

Testing dataActualIdentificationInformation
1GSGSTrue
2GSGSTrue
3GSGSTrue
4GSGSTrue
5GSGSTrue
6GSRWEFalse
7GSGSTrue
8RWERWETrue
9RWERWETrue
10RWERWETrue
11RWERWETrue
12RWERWETrue
13RWERWETrue
14RWERWETrue
15HWEHWETrue
16HWEHWETrue
17HWEHWETrue
18HWEHWETrue
19HWEHWETrue
20HWEHWETrue
21HWEHWETrue

GS (Growing Skin), RWE (Rotten Wood Eye), HWE (Healthy Wood Eye)

Program testing result. GS (Growing Skin), RWE (Rotten Wood Eye), HWE (Healthy Wood Eye) So, the confusion matrix is formed as follows in Table 10.
Table 10

Feature extraction results (HWE).

Prediction
GSRWEHWETotal

GS6107
ActualRWE0707
HWE0077

GS (Growing Skin), RWE (Rotten Wood Eye), HWE (Healthy Wood Eye).

Feature extraction results (HWE). GS (Growing Skin), RWE (Rotten Wood Eye), HWE (Healthy Wood Eye). Table 10 shows the confusion matrix from the results of program testing where the calculation for the success of growing skin defects is 6 images, and 1 image is identified incorrectly while all rotten wood eye and healthy wood eye are identified correctly. Accuracy, precision and recall is calculated from the number of correctly identified images divided by all data as follows in Table 11.
Table 11

The result of accuracy, precision & recall.

ClassAccuracyPrecisionRecall
Growing Skin86%0,861
Rotten Wood Eyes100%10,86
Healthy Wood Eyes100%11
Mean95,33%95,33%95,33%
The result of accuracy, precision & recall. Table 11 shows that the accuracy of growing skin defects by 86% from the calculation results of 6/7x100%, the accuracy of rotten wood eye of 100% from the calculation results of 7/7 x100%, and the accuracy of healthy wood eye of 100% from the calculation results of 7/7x100%, so the average accuracy is 95.33% in the identification of swietenia mahagoni wood defects segmented by k-means, extracted with 6 GLCM features, namely metric, eccentricity, contrast, correlation, energy, and homogeneity, and identified by calculating the closest distance between each value of the testing data feature on the value of each training data feature using the euclidean distance method. In addition to using accuracy, the calculation of the performance method used can be seen from the F1 Score [30]. All Precision is 0,95 and the result of recall is 0,95. Precision is the level of accuracy between the information requested by the user and the answers given by the system. While recall is the success rate of the system in recovering information, while the F1-Score is the harmonic mean of precision and recall, in Table 11, the values of precision, recall and of course F1 score are the same and are close to the value of 1, the perfect score.

Validation

To test the reliability of the proposed model, testing was carried out using cross validation, namely 3-fold cross validation. This technique divides the image or dataset into 2 parts, namely training and testing or we can call it validation data. This means that every image has experienced a role as training and testing or in this case we call validation. The 3-fold cross validation illustration is described in the image in Fig. 2.
Figure 2

Illustration of 3-fold cross validation.

Illustration of 3-fold cross validation. The results of the 3-fold cross validation in this study are as follows in Table 12.
Table 12

The result of accuracy, precision & recall.

Accuracy
TypeFold 1Fold 2Fold 3

Growing Skin50%50%83,3%
Rotten Wood Eyes100%100%100%
Healthy Wood Eyes50%83,3%83,3%
Mean66%77,8%88,9%
The result of accuracy, precision & recall. The first test using the cross validation technique, it produces an average accuracy of 66% which is shown in Table 12, with the composition of the growing skin is predicted to be correct 3, wrong 3 of the total validation data 6, so the accuracy is 50%, rotten wood eyes are predicted to be correct 6, false 0 from the total data validation 6, so the accuracy is 100% and healthy wood eyes are predicted to be correct 3, wrong 3 from the total validation data 6, so the accuracy is 50%. The second test using the cross validation technique, it produces an average accuracy of 77.8%, which is superior to the first test shown in Table 13, with the skin composition predicted to be true 3, wrong 3 of the total data validation 6, so the accuracy is 50%, rotten knots are predicted to be correct 6, wrong 0 from the total validation data 6, so that the accuracy is 100% and healthy knots are predicted to be correct 5, one of the total validation data is 6, so the accuracy is 83.3%.
Table 13

The result of RGB to L*a*b color convertion.

TypesRGBL*a*b
Early BlightImage 28Image 29
Late BlightImage 30Image 31
The result of RGB to L*a*b color convertion. The third test using the cross validation technique, it produces an average accuracy of 88.9% superior to the first and second tests shown in Table 16, with the composition of the growing skin is predicted to be true 5, one of the total validation data is 6, so that the accuracy 83.3%, rotten wood eyes are predicted to be true 6, false 0 from the total validation data 6, so that the accuracy is 100% and healthy wood eyes are predicted to be correct 5, one of the total validation data is 6, so the accuracy is 83.3%.
Table 16

Feature extraction results (LB).

metricecce..cont..corr..energyhomog..
0.465150.422440.570510.908080.351710.86942
0.271310.486960.599760.891180.317130.85707
0.176720.830200.524010.869800.501940.89478
0.380350.741050.431020.873420.298090.87229
0.195950.530130.382440.922280.337200.89821
0.394490.741270.436470.907340.380910.88943
0.513680.252940.500590.863650.364070.87258
0.554810.821650.320940.909030.309040.89836
0.143860.861790.208130.923810.484540.93617
0.328610.956550.336530.934630.396890.91896
0.370360.924980.368680.914140.377810.89760

LB (Late Blight).

The 3-fold cross validation carried out, we can see that in Fig. 3, the most optimal value is the value of the 3rd fold cross validation, which produces an average accuracy of 88.9% which can be categorized as good. When compared with the distribution of previous training and testing data, it is still superior, namely achieving an average accuracy of 95.33%. Therefore, the authors propose the distribution of training - testing as much as 60% - 40%.
Figure 3

Illustration of 3-fold cross validation.

Illustration of 3-fold cross validation.

How about validation by another dataset?

Another dataset used to test the reliability of the proposed model, in this case, uses a similar type of dataset, namely flawed images, but the object is different, namely potato leaf defects obtained from the public dataset website, namely Kaggle. Considering the wood defect dataset that is available and can be acquired for free, it is still difficult to find. This test is carried out with the same composition, namely 18 images per class and there are 2 classes of leaf defects that are treated the same as that done on the wood defect dataset. RGB to L*a*b Color Conversion The following are the results of applying the proposed model to the test dataset, namely the potato leaf defect dataset. Color conversion is carried out to facilitate the segmentation process, such as in wood defect images, here are the results of the RGB color conversion into the L * a * b color space in the potato leaf defect image. In Table 13, we can see the results of the change in the image of potato leaf defects whose color space is changed from RGB to L * a * b, the defect area looks darker than other areas, as happened in the wood defect image. K-Means Segmentation After converting the color space, segmentation is then performed to separate the defect areas using k-means, the results are as illustrated in the Table 14.
Table 14

The result of K-means segmentation.

TypesL*a*bK-means
Early BlightImage 32Image 33
Late BlightImage 34Image 35
The result of K-means segmentation. In Table 14, we can see the results of changes in the image of potato leaf defects segmented by k-means which were previously in the L*a*b color space, the area taken is an important area, namely the part of the leaf that is affected by defects. Feature Extraction After segmentation, feature extraction is carried out to create a database of training data using GLCM with 6 features, namely metric, eccentricity, contrast, correlation, energy, and homogeneity to see the value of texture and shape features. Table 15 shows the value of each feature in each Early Blight potato leaf defect image with an average feature value of 0.39770, the average value of the eccentricity feature is 0.66397, the average value of the contras feature is 0.64833, the average feature value correlation 0.92074, the average energy feature value is 0.28815 and the average homogeneity feature value is 0.86258.
Table 15

Feature extraction results (EB).

metricecce..cont..corr..energyhomog..
0.373520.551940.633870.948680.276920.86526
0.535390.862240.593580.930570.258430.85574
0.273690.643490.830590.891500.267930.83096
0.079410.411210.651230.958520.365330.92086
0.287340.830090.562130.924820.301940.87220
0.342820.861350.443300.871740.279950.87483
0.194530.635860.806120.906140.277410.83854
0.601020.640120.807560.896660.217820.82873
0.534210.795170.580560.915330.283200.85895
1.014570.747870.469520.959630.300670.88037
0.138150.324370.753160.924490.340020.86194

EB (Early Blight).

Feature extraction results (EB). EB (Early Blight). Table 16 shows the value of each feature in each Late Blight potato leaf defect image with an average feature value of 0.34503, the average value of the eccentricity feature is 0.68818, the average value of the contras feature is 0.42537, the average feature value correlation 0.90158, the average energy feature value is 0.37448 and the average homogeneity feature value is 0.89135. Identification Feature extraction results (LB). LB (Late Blight). After the training database is formed, identification of the testing data is carried out using the euclidean distance, following the results of the program testing. From Table 17, it can be seen that the results of program testing are 7 early blight images and 7 late blight images which are used as testing data. From 7 images of early blight types, all images can be identified correctly, then from 7 images of late blight, there are 6 images identified correctly and 1 image identified as early blight, so that the confusion matrix is formed as follows in Table 18.
Table 17

Program testing result.

Testing dataActualIdentificationInformation
1EBEBTrue
2EBEBTrue
3EBEBTrue
4EBEBTrue
5EBEBTrue
6EBEBTrue
7EBEBTrue
8LBLBTrue
9LBLBTrue
10LBLBTrue
11LBEBFalse
12LBLBTrue
13LBLBTrue
14LBLBTrue

EB (Early Blight), LB (Late Blight).

Table 18

Confusion matrix.

Prediction
ActualEBLBTotal

EB707
LB167

EB (Early Blight), LB (Late Blight).

Program testing result. EB (Early Blight), LB (Late Blight). Confusion matrix. EB (Early Blight), LB (Late Blight). In Table 18, we can see the confusion matrix from the results of program testing (Table 21), where the calculations for the success of the early blight types are 7 images identified correctly and for late blight types 6 images are identified correctly and 1 image is identified incorrectly. Accuracy is calculated from the number of correctly identified images divided by all data.
Table 21

Image rotations.

LevelAccuracy
0 degreesImage 36
45 degreesImage 37
90 degreesImage 38
120 degreesImage 39
180 degreesImage 40
Table 19 shows that the accuracy of early blight by 100% from the calculation results of 7/7x100% and the accuracy of late blight of 85,71% from the calculation results of 6/7x100%, so the average accuracy is 2,86% in the identification of potato leaf defects segmented by k-means, extracted with 6 GLCM features, namely metric, eccentricity, contrast, correlation, energy, and homogeneity, and identified by calculating the closest distance between each value of the testing data feature on the value of each training data feature using the euclidean distance method.
Table 19

Accuracy.

ClassAccuracy
Early Blight100%
Late Blight85,71%
Mean92,86%
Validation Accuracy. Validation is also carried out in experiments using other datasets, such as what has been done on a wood defect image using cross validation, to be precise 3 fold cross validation, here are the results of each fold in Table 20.
Table 20

Result of 3-fold cross validation other datasets.

Accuracy
TypeFold 1Fold 2Fold 3

Early Blight66,67%83,33%83,33%
Late Blight33,33%66,67%83,33%
Mean50%75%83,33%
Result of 3-fold cross validation other datasets. From the first test using the cross validation technique, it produces an average accuracy of 50% shown in Table 20, with the composition of early blight predicted to be correct 4, wrong 2 of the total validation data 6, so the accuracy is 66.67%, late blight is predicted to be correct 2, 4 of the total validation data is 6, so the accuracy is 33.33% so that the average accuracy is 50%. From the second test using the cross validation technique, it produces an average accuracy of 75% better than before, which is shown in Table 20, with the early blight composition predicted to be true 5, one of the total validation data is 6, so the accuracy is 83.33%, late blight is predicted to be true 4, wrong 2 from the total validation data 6, so the accuracy is 66.67% so that the average accuracy is 75%. From the third test using the cross validation technique, it produces an average accuracy of 83.33% better than the previous, which is shown in Table 20, with the composition of each type is the same, namely 5 is predicted to be correct, one of the total validation data is 6, so that the average accuracy is 83.33%. From Fig. 4, the 3-fold cross validation carried out, we can see that the most optimal value is the value of the 3rd fold cross validation, which produces an average accuracy of 83.33% which can be categorized as good.
Figure 4

Result of 3-fold cross validation other dataset.

Result of 3-fold cross validation other dataset. When compared with the distribution of previous training and testing data, it is still superior, namely achieving an average accuracy of 92.86%. Therefore, the authors propose the distribution of training-testing as much as 60% - 40%. These results are the same as those obtained in the wood defect dataset so that the reliability value of the proposed model is good enough in identifying defects, wood defects are raised to pay attention to the importance of wood and increase the wood dataset that can be used for research.

How about validation with augmentation dataset

In an effort to reproduce the dataset so that the dataset can be tested many times to measure the reliability of the model being built, we rotate the image with several sizes as augmented dataset as follows in Table 21. Image rotations. In each image data testing, image rotation was performed 4 times, namely 45 degrees, 90 degrees, 120 degrees, and 180 degrees so that the image augmentation produced 84 new images and a total of 138 images. Through the same steps, the new dataset resulting from image rotation is carried out with the following accuracy in Table 23.
Table 23

Accuracy.

ClassAccuracy
Growing Skin75%
Rotten Wood Eye64%
Healthy Wood Eye100%
Mean80%
Table 22 shows the confusion matrix from the results of program testing where the calculation for the success of growing skin defects is 21 images, and 7 images is identified incorrectly, for rotten wood eyes are 18 images correct identified and 10 images are incorrect and all image of healthy wood eyes are identified correctly. Accuracy is calculated from the number of correctly identified images divided by all data as follows in Table 23.
Table 22

Confution matrix of augmenting image.

Prediction
GSRWEHWETotal

GS212028
ActualRWE018028
HWE782828

GS (Growing Skin), RWE (Rotten Wood Eye), HWE (Healthy Wood Eye).

Confution matrix of augmenting image. GS (Growing Skin), RWE (Rotten Wood Eye), HWE (Healthy Wood Eye). Accuracy. In the results achieved by testing using our augmentation images, we can see that the average is 80%, which means that it is not so far from the accuracy value obtained from testing data with normal rotation. When compared with the previous research on the same object, the accuracy value of this study is still superior. The following is a discussion of the previous research. This research is not the first to be conducted. There have been several researchers who have done the same thing before, some of which are: The research with the title of “Study on The Identification of The Wood Surface Defects Based on Texture Features” conducted by Xie YongHua and Wang JinCong is to identify wood surface defects by performing feature extraction that combines the Tamura and GLCM method on 5 features, namely Angular Second Moment, Contrast, Correlation, Entropy, and Variance to identify 3 types of wood defects, namely dead knots, piles, and slipknot with classification using the BP neural network classifier where it produced an accuracy of 92.67% [10]. It also discusses the Markov Random Field segmentation which is a widely adopted probabilistic method in several segmentations that utilizes spatial information from images based on the Markov process. This process is based on a stochastic modeling approach and works well on images with various uncertainties such as noise, degradation, and incorrect information on partial data [31], [32], [33]. The research with the title of “Identification of Wood Defects Based on LBP Features” by Zhang Yi Xiang et al. identified wood defects by extracting 4 features, namely Correlation, Chi-Square Coefficient, Intersection Coefficient, and Bhattacharyya distance on the comparison of the LBP and GLCM extraction method on 40 wood image samples with the BP neural network classification method and produced an accuracy of 93% on 3 types of wood defects [9]. The segmentation is done by image binarization which is a common tool for object image segmentation that differentiates the background in various applications such as automatic target tracking, object recognition, image compression, image analysis, and object separation [34]. Image binarization is a technique that converts gray level images to black-and-white images [35]. The research with the title of “Wood Defect Classification Using GLCM Based Features And PSO Trained Neural Network” by R. Qayyum et al. succeeded in identifying knot defects on wood surfaces whose dataset was obtained from the website of Oulu University, Finland by extracting GLCM features and applying PSO to the Neural Network classification by producing an MSE value in the training of 0.3483 and accuracy on testing of 78.26% [9]. Fuzzy min-max neural network segmentation has been used to segment images and to simplify image analysis over the past few years. To speed up the image segmentation process, FMMIS does not use all the pixels of the analyzed image but only uses a few input pixels called seeds to grow hyperboxes [36], [37]. The research with the title of “Study on Image Recognition and Classification of Wood Skin Defects Based on BOW Model” by Fan Yang et al. introduced and classified bark defects by extracting features using the HOG (Histogram of Oriented Gradient) method, and identification and classification with SVM based on kernel Gaussian Kernel (Gaus), Polynomial Kernel (Poly), Chi-Square Kernel (Chi), and Histogram intersection kernel function (Hist) on 4 types of bark defects, namely Dead knot, Slipknot, Crack, and Hole got an average accuracy of 85, 4% [38]. The research with the title of “Classification of Wood Defect Images Using Local Binary Pattern Variants” by Rahillda Nadhirah Norizzaty Rahiddin et al. conducted a classification of wood defects by analyzing textures using LBP variants, namely LBP basic, LBP invariant rotation, LBP uniform, and LBP uniform invariant rotation uniform and performed a classification of ANN, KNN, and J48 Decision Tree with the dataset produced an accuracy of 65.4% [8]. Research entitled Tree species classification based on image analysis using Improved-Basic Gray Level Aura Matrix by researchers from Malaysia they classified wood species using the Improved-Basic Gray Level Aura Matrix (I-BGLAM) method on 136 features with 52 types of wood and Classifying using a Support Vector Machine (SVM) with a composition of 80 training images and 20 testing images and produces an accuracy of 97.01% [39]. Research in point 6 is continued with the title Wood Species Recognition System based on Improved Basic Gray Level Aura Matrix as feature extractor by extracting features using 136 features with the Improved Basic Gray Level Aura Matrix (I-BGLAM) method and classified using a Support Vector Machine (SVM) with 90 training data images and 10 testing data images repeated 30 times and resulted in an average accuracy of 99.84% [40]. Based on the success of each case in previous research, we can see it in the following graph in Fig. 5. In the graph above we can see that the highest accuracy is obtained by using the Improved-Basic Gray Level Aura Matrix (I-BGLAM) model as a feature extractor and classification using SVM at points 6 and 7. In this case it cannot be compared with our study because the topic raised was the classification of wood species not wood defects. It is written to introduce another method as feature extractor. Points 1 to 5 have the same topic, namely the classification of wood defects, the most widely used model as an extractor feature is GLCM because to take the value of texture and shape features in the defect area, the success achieved is not superior to the research we conducted by proposing euclidean. distance to identify the type of defect. Although this method is not a new method, it is quite reliable in doing its job and a simple, easy-to-understand model is preferred.
Figure 5

Result of 3-fold cross validation other dataset.

Result of 3-fold cross validation other dataset.

Conclusion

Based on the existing problems regarding the determination of wood quality which is closely related to wood defects, the role of technology is needed to help identify wood defects. Research in the field of image processing that has been carried out on 54 images of swietenia mahagoni wood defects with 3 types of wood defects, namely growing skin defects on the wood ends, rotten wood eyes on the body, and healthy wood eyes on the body which were taken directly by the researcher and were processed for identification. The best segmentation was previously selected by comparing the results of the segmentation of k-means and thresholding methods, and the best segmentation was selected, which is performing the segmentation technique using the k-means method, extracting the GLCM features on 6 metric features, namely eccentricity, contrast, correlation, energy, and homogeneity, and identifying them by calculating the shortest distance between the feature value of data testing and data training (database training) using the Euclidean distance method and produced an average accuracy of 95.33% on 21 test images. The results are that of 7 images of wood skin defects, 6 were identified as true and 1 as false. Of 7 images of rotten knots, 7 were identified as true, and of 7 images of healthy knots, 7 were identified as true. This research has also been successfully implemented in an application made by using MatlabR2015a. Cross validation is also applied to test the reliability of the proposed model. Cross validation is carried out with k-3 because this is suitable for small datasets. By using 3-fold cross validation, the optimal average accuracy is 88.90%. Validation with other similar datasets was also carried out by identifying potato leaf defects resulting in an average accuracy of 92.86% with the most optimal 3-fold cross validation value achieved an average accuracy of 83.33%. So it can be concluded that the division with the composition of training data 60% and testing data 40% is considered better in this study. In the 60-40 division it is also supported by measuring the performance of the F1 score and getting a value of 0.95 is very good because it is close to the perfect value, namely 1. Testing with wood datasets was also carried out by performing image augmentation so that the small wood image increased, with rotations of 45 degrees, 90 degrees, 120 degrees, and 180 degrees which resulted in 84 new data points with a total of 138 images and resulted in an average accuracy of the test augmentation image was 80%. That is the limitation of this study. The further research proposes to do augmented images by zooming and vertical and horizontal flipping or others technique so that more datasets and classification with current trend classification methods such as machine learning and even deep learning.

Declarations

Author contribution statement

D. Riana, S. Rahayu: Conceived and designed the experiments; Performed the experiments; Analyzed and interpreted the data; Contributed reagents, materials, analysis tools or data; Wrote the paper. M. Hasan: Performed the experiments; Contributed reagents, materials, analysis tools or data. Anton: Performed the experiments.

Funding statement

This research did not receive any specific grant from funding agencies in the public, commercial, or not-for-profit sectors.

Data availability statement

Data included in article/supplementary material/referenced in article.

Declaration of interests statement

The authors declare no conflict of interest.

Additional information

No additional information is available for this paper.
  4 in total

1.  Sensitivity analysis of kappa-fold cross validation in prediction error estimation.

Authors:  Juan Diego Rodríguez; Aritz Pérez; Jose Antonio Lozano
Journal:  IEEE Trans Pattern Anal Mach Intell       Date:  2010-03       Impact factor: 6.226

2.  Characterising the variations in ethnic skin colours: a new calibrated data base for human skin.

Authors:  K Xiao; J M Yates; F Zardawi; S Sueeprasan; N Liao; L Gill; C Li; S Wuerger
Journal:  Skin Res Technol       Date:  2016-06-08       Impact factor: 2.365

3.  Hyperspectral Image Classification With Markov Random Fields and a Convolutional Neural Network.

Authors:  Xiangyong Cao; Feng Zhou; Lin Xu; Deyu Meng; Zongben Xu; John Paisley
Journal:  IEEE Trans Image Process       Date:  2018-05       Impact factor: 10.856

4.  The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluation.

Authors:  Davide Chicco; Giuseppe Jurman
Journal:  BMC Genomics       Date:  2020-01-02       Impact factor: 3.969

  4 in total

北京卡尤迪生物科技股份有限公司 © 2022-2023.