{'fraction_non_alphanumeric': 0.02384547769839302, 'fraction_numerical': 0.01974351461606076, 'mean_word_length': 4.668114460909555, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Comparison of segmentation and identification of swietenia mahagoni wood defects with augmentation images

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%.


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 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.

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] Definition 1. 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  [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.

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.
The stages of the research methodology carried out are shown in Fig. 1 and followed by the following explanation.

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.

Thresholding
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
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.

RGB to YIQ color conversion
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.

Thresholding
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.
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.

RGB to L*a*b color conversion
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.

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  Healthy Wood Eye the L*a*b color space in the swietenia mahagoni wood defect image. Kmeans 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.
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.

Feature extraction
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: 1. 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.

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.

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,

Identification
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.
So, the confusion matrix is formed as follows in Table 10. 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 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.
The results of the 3-fold cross validation in this study are as follows in Table 12.
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%.
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%.
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 trainingtesting as much as 60% -40%.

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.
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.  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 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
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.
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 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.

Validation
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.
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.
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 trainingtesting 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.
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 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.
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: 1. 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].  [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].
3. 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]. 6. 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].
7. 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.

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.