You are on page 1of 5

Classification of Wood Furniture Using Gray Level

Cooccurrence Matrix and K-Nearest Neighbor


Alvin Rinaldy Hakim Yuni Handayani
Faculty Of Computer Science Faculty Of Computer Science
Dian Nuswantoro University Dian Nuswantoro University
Semarang, Indnesia Semarang, Indonesia
alvinrainaldy0@gmail.com yuni.04.handayani@gmail.com

Guruh Fajar Shidik Ahmad Zainul Fanani


Faculty Of Computer Science Faculty Of Computer Science
Dian Nuswantoro University Dian Nuswantoro University
Semarang, Indonesia Semarang, Indoonesia
Guruh.fajar@research.dinus.ac.id a.zainul.fanani@dsn.dinus.ac.id

Abstract — in today's rapid technological development, one of them Identification of wood type can be done. The wood that
is in the field of digital image processing is indispensable in will be used in this research sample is a type of teak wood,
conducting data processing in various fields, one of them to mahogany wood, Mango wood, and Sungkai wood. Each type
determine the raw material of furniture. Such good quality of of wood has a different surface characteristic according to the
furniture certainly has a good wood raw material. Therefore
research this time taking samples of wooden data from the city of
type and age of the wood, so it is very difficult to distinguish
Jepara as a research material. The extraction method features Grey other types of wood if the type of wood has had a long life.
Level Co-Occurrence Matrix (GLCM) is used to extract the In Digital image processing is closely related to image
characteristics of the wood surface so that the features of Contrast, processing and color transformation. The classification
Homogeneity, Corelation and Energy are obtained, from the method used in this research is to use the KNN as well as for
features of the Fritur will be look for the optimal value with Using the extraction of the features used using GLCM. KNN is one
Euclidean's distance K-Nesrest (KNN) Classification method, this of the classification algorithms with Artificial Intelligent is a
study got the most optimal value of K with a value of 67.5% in K-7 technique of human artificial intelligence in which there is one
and the lowest accuracy level was at K-5 with a value of 62.5% part of image processing. In this study will be explained about
accuracy.
GLCM and KNN algorithms
Keyword - K-NN, GLCM, Classification II. RELATED RESEARCH
I. INTRODUCTION
Indonesia is one of the countries that has many types of A. Related Research
wood. Based on the type of tree produced has different Our research begins by first conducting a library study on the
properties and characteristics. Wood is a material obtained research that has been done before. The research discusses
from natural wealth derived from forest and a raw material topics related to research conducted by researchers, such as
that is very easy to be processed and can be processed image processing, and methods used by researchers.
according to the development of technology [1]. Based on research conducted by Ting He, Ying Liu, Chengyi
Jepara City is one of the city that is famous for Xu, Xiaolin Zhou, Zhongkang Hu, and Jianan Fan in 2019 [1]
handicrafts including furniture or household utensils. This titled About A Fully Convolutional Neural Network for Wood
furniture business has been widely used as a small business Defect Location and Identification examining the Detecting
sector and large-scale factories. To produce handicrafts that defects of timber locations and classifying the types of defects
have good quality, of course it takes a kind of wood that has of wood surface penuel automatically using the convolutional
good quality as well. neural algorithm, resulting in an accuracy value of 99.14% of
The raw material of wood comes from the city of the network. So it can be concluded that this method is very
Jepara. Now manpower is still needed in the process of suitable to be applied in the classification type defects of wood
determining the type of wood so it takes a relatively long time locations.
and less efficient if the wood to be parsed has a relatively In a study titled Wood Detect Classification Based on
large quantity by implementing a system that is still manual Two-Dimensional Histogram Constituted by LBP and Local
with Using human power in determining the type of wood is Binary Differential Excitation Pattern [2] in 2019 conducted
still subjective. by Shaoli Li, Dejian Li, And Weiqi Yuan about the
classification of The algorithm is based on LBP and the local certain distance and angle orientation [3]. The following is
differential binary on the excitation pattern so that in this an arrays of kinship in GLCM
study resulted in recall value, precision, FNR is 0930, 0.9430,
and 0070 by the time of 0.1416 second. So that it can conclude
based on the results obtained indicates the algorithm can result
in a better classification of previous research.
Research conducted by Kyarash Shahriari, Senior Member,
Ali G. Hessami, Senior Member, Amfreak Jadidi, and Nadia
Lehoux in the year 2015 which is titled about An Approach
Toward a Conceptual Collaborative Framework Based on a
Case Study in a Wood Supply Chain aimed at making a
decision and planning to have a positive impact on
productivity and performance. It is proposed to increase
business competitiveness [3].
Figure 1. The corner in GLCM
In 2016 conducted by J. David Redman, Guillaume Hans
GLCM will count pixels per pixel in the image through the
and Nectaria Diamanti. Titled Impact of Wood Sample Shape
groove like above when its orientation is 1 then GLCM
and Size on Moisture Content Measurement Using a GPR-
calculates 1 pixel next to it and when its orientation value is 2
Based Sensor [4] on how to measure the wood Sample rate
then GLCM will count 2 pixels next to it. Up to all counted
used in the forest products industry. In this study use numeric
pixels [3]
modeling. The result is that preliminary modeling suggests
GLCM also has several features, here are some of the
that the effects of cylindrical log forms are reduced so that the
features found in GLCM.
increase in permittivity logs. This has shown that the GPR
sensor is highly effective for measuring water content in log • Homogeneity
timber. Used to demonstrate the homogeneity of an image
In research conducted in 2015 by Erja Sipila, Johanna whose intensity value is similar. A relatively
Virkki, Lauri Sydanheimo, Member, IEEE, and Leena homogeneous image will have a great homogeneity [3]
Ukkonen, IEEE Member entitled About Experimental Study
on Brush-Painted Metallic Nanoparticle UHF RFID Tags on
Wood Substrates [5] Which discusses efforts in the addition of Where P (x, y) is the value in row x and column y of
harmful products by having the function of increasing interest. the normalization matrix.
So the results obtained that measure the performance of this • Contrast
antenna can provide high potency in applications that are It works to detect the degree of an area on an image.
wireless, but there is still much needed in the optimization and Contrast also shows the spread intensity of image
standardization of the novel manufacturing process. values using formula [3]:
In research conducted by Ellen Vorberg, Heidi Fleischer,
Steffen Junginger, Norbert Stoll, Kerstin Thurow in 2016 [6]
conducting research in measuring special elements to improve
• Correlation
economy and quality better by The sample automating. So on
Correlation shows the size of the intensity linear
this research the system can be evaluated. For results on
dependency used to provide clues to the presence of
automatic mercury analysis with actual values corresponding
linear structures in Matiks using formula [3]:
to confidence level-95% (P = 95%) When applying materials
that have been referenced wood.
The year 2017 was conducted a study titled Extracting
Wood Properties From Structured THz Spectra: Birefringence • Energy
and Water Content [7] discussing the transmission of THz in Showing the level of similarity of an image on the
showing the gaps in determining the frequency difference. So matrix when the intensity image of similar, has a large
that the result of changing frequency of gaps can be enabled in Energy [3].
determining the rapid and accurate dependence of moisture
birefringence.
III. LITERATURE STUDY B. Classification
A. Gray Level Cooccurrence Matrix Classification is automatic categorization into certain
GLCM is an extraction of the second-order feature by criteria or class, e.g. classification in journal based on abstract
using a matrix of kookurensi, a matrix that represents a if there is abstract content in the journal regarding decision
relationship between the pixels in an image in a variety of support system then the on-going journal will be Classified in
orientation and distance directions. One technique to know Data mining class The purpose of categorisation is to make it
the relationship between neighbors is to calculate the easier to select or view a specific element according to its
probability of that relationship between two pixels at a criteria or class [7].
C. K-Nearest Neighbor (K-NN) D. Flow System
KNN is a classification algorithm by applying the working Description of the weaving plot used to classify the wood
principle by finding the closest distance value to the data to be
evaluated with K neighbor closest to the training data. For the
optimal value of k in this algorithm depends on a data. Thus,
the higher the value of the K used then the lower the accuracy
value obtained. The distance method will be applied to K-NN
[7].
1. Euclidean Distance
2. City Block Distance (Manhattan Distance)
3. Cosine Distance
4. Correlation Distance.

This research uses K-NN classification by using Euclidean


distance because it has simple calculations and paing much in
use. Equation looking for closest value by applying Euclidean
distance [7]. Picture 2. Research plot

The first collected data will be selected and in which


Description : selection is eligible for classification in various
xi = X value is training data. considerations, then the data will be cut to 480x480 pixels
yi = The value of Y is test data. to reduce system compute and accelerate processing
m = Limit amount of data The next step is to extract the features using GLCM
evenly on the corners, to calculate with Homogeneity,
IV. RESEARCH METHODS Contrast, Correlation, and Energy. The final step is to
A. Types of research classify the values that have been in the GLCM feature and
The type of research used by us is quantitative. calculate the accuracy value with the matrix confusion.
Methodologies that will be used to establish research issues, V. DISCUSSION
identify suspected temporary (hypotheses), set system plans, A. Dataset
and define how to test by implementing methods in The Dataset that is used is private with a direct
conducting data analysis based on results As. Research done observation to the city of Jepara. Here is a sample dataset
by implementing the experiment method [6]. to be used
Image Data that will be used to implement the results
B. Characteristic of Research of this research by using 160 Citra consist of 120 image
In this study has a quantitative trait that means based on training consisting of 4 classes and 40 image testing.
the data obtained should be measured, observations and
scientific opinions. For classification of different data
generates rational conclusions.
C. Scientific approaches
A quantitative approach is used in this study, where the
data used as this research is the standard data grouping of
wood types. For the next step after the data obtained is the
analysis and use of the data is used as a comparator in the real Fig. 3. Dataset used
condition [6]. As a result of comparator to know the value of
accuracy obtained so that it can be used as the benchmark of The picture above is a sample of the four wood furniture
success of the previously identified hypothesis. that will be used, from the visualization of the color similarity
of the four data in terms of color and texture, the image in use
is an image measuring 480x480 pixels in good data training or
data testing.
B. Preprocessing
Preprocessing here is the stage before doing calculations
using GLCM. That is to cut the image by 480x480 pixels and
change the color conversion from RGB to grayscale below is
an example of an image that has become grayscale:
In K-1 for jati that has readable 5, mahogany is legible there
are 4 jati-readable mango 0 and the rest of the jati-readable
sungkai there 1. It proves the system is still difficult to
distinguish between jati and mahogany wood, while the
perfect result in can on the mango wood with the overall
testing mango wood reads mango.
Fig. 4. The left image of the right RGB Grayscale From the table above we can calculate the accuracy with the
The training image and the testing image will get the formula as follows
same treatment at this stage. So whether it is training or testing
image will be sama2 in crop measuring 480x480 and changed
to grayscale on a scale of 8 bits or susceptible to color 0 to
255. So on the K-1 results have an accuracy result of 65%
C. Calculation of GLCM Then the test is continued with the use of K-3, K-5, K-7 and
K-9, the following is the result of the calculation of each value
After the image is changed to Grayscale the next step is to
of K
calculate the GLCM by using the Contrast, Correlation,
Homogeneity and energy features, the following is an example
No Nilai K Sudut 0o Sudut Sudut Sudut
of the results of the calculation using GLCM for the Jati_1.jpg
45o 90o 135o
angle 0o
1 k-1 65% 50% 65% 60%
Contrast : 0.689861691
Homogeneity : 0.749957505 2 k-3 62.5% 52.5% 62.5% 65%
Correlation : 0.199051844 3 k-5 50% 60% 67.5% 60%
Energy : 0.635230844 4 k-7 67.5% 62.5% 65% 65%
These results will then be classified using the euclidean 5 k-9 55% 72.5% 62.5% 62.5%
distance K-NN.
Can be seen in K-1 until K3 decreased value from 65% to
D. Testing 62.5% but on K-5 until K-9 K-value tends to remain. This
Below is the result of classification by using the K-NN means the higher the value of K then the value tends to follow
range Euclidean on K-1 by using 40 images consisting of 10 K before.
jati images, 10 images of mahogany, 10 images of mangoes,
and 10 images of Sungkai VI. CONCLUSION
Can be seen on the first try using K-NN on K-1. Here is Based on the results of research and analysis that has been
the matrix confusion for K-1, on the first try, there are still done, it can be concluded that for the identification of the type
many errors to distinguish between jati and mahogany wood. of wood furniture image using GLCM feature extraction with
Because these two wood at a certain age tend to have KNN classification obtained an optimal accuracy value of
resemblance. Here are examples of jati wood and mahogany 72.5% and for the lowest accuracy value obtained by 50%.
that have a physical resemblance. Due to the similarity between teak and mahogany wood in
several datasets. Mahogany wood at a certain age and weather
tends to change its red color to brown that makes the surface
of mahogany wood have similarities with teak wood and vice
versa. In this study there are still many shortcomings, expected
to do more research related identification type wood image
furniture to get more optimal accuracy value again. And add
another feature for classification of wood type furniture using
Fig. 5. Samples of jati and mahogany wood GLCM feature extractions and K-NN classification.
The samples above are found in the Jati_test_9. jpg and REFERENSI
Mahoni_test_9. jpg data, both of which are sample data [1] T. He, Y. Liu, C. Xu, X. Zhou, Z. Hu, and J. Fan, “A
testing. All data testing is already tested using MATLAB Fully Convolutional Neural Network for Wood Defect
following Confusioan matrix on K-1 Location and Identification,” IEEE Access, vol. 7, pp.
123453–123462, 2019.
Result Prediction [2] S. Li, D. Li, and W. Yuan, “Wood Defect
Jati Mahoni Mangga Sungkai Classification Based on Two-Dimensional Histogram
Jati 5 4 0 1 Constituted by LBP and Local Binary Differential
Mahoni 2 4 1 3 Excitation Pattern,” IEEE Access, vol. 7, pp. 145829–
Mangga 0 0 10 0 145842, 2019.
[3] K. Shahriari, S. Member, A. G. Hessami, S. Member,
Sungkai 1 1 1 7 A. Jadidi, and N. Lehoux, “An Approach Toward a
Conceptual Collaborative Framework Based on a Case [7] P. Zolliker, M. Ruggeberg, L. Valzania, and E. Hack,
Study in a Wood Supply Chain,” pp. 1–10, 2015. “Extracting wood properties from structured THz
[4] J. David Redman, G. Hans, and N. Diamanti, “Impact spectra: Birefringence and water content,” IEEE
of Wood Sample Shape and Size on Moisture Content Trans. Terahertz Sci. Technol., vol. 7, no. 6, pp. 722–
Measurement Using a GPR-Based Sensor,” IEEE J. 731, 2017.
Sel. Top. Appl. Earth Obs. Remote Sens., vol. 9, no. 1, [8] C. Irawan, E. N. Ardyastiti, D. R. I. M. Setiadi, E. H.
pp. 221–227, 2016. Rachmawanto, and C. A. Sari, “A survey: Effect of
[5] U. P. Onyewuchi, A. Shafieezadeh, M. M. the number of GLCM features on classification
Begovicieee, and R. Desroches, “A probabilistic accuracy of lasem batik images using K-nearest
framework for prioritizing wood pole inspections neighbor,” 2018 Int. Semin. Res. Inf. Technol. Intell.
given pole geospatial data,” IEEE Trans. Smart Grid, Syst. ISRITI 2018, pp. 33–38, 2018.
vol. 6, no. 2, pp. 973–979, 2015. [9] M. F. Grace and H. S. Scott, “An optional federal
[6] E. Vorberg, H. Fleischer, S. Junginger, N. Stoll, and charter for insurance: Rationale and design,” Futur.
K. Thurow, “Automated sample preparation for Insur. Regul. United States, vol. 6, no. 2, pp. 55–96,
mercury analysis in wood materials,” IET Sci. Meas. 2009.
Technol., vol. 10, no. 5, pp. 398–404, 2016.

You might also like