Texture Analysis on Image Motif of Endek Bali Using K-nearest Neighbor Classification Method

—Endek fabric Bali is one form of craft woven fabric of Balinese society. Endek fabric has a variety of motifs or designs, a lot of people does not know that Endek have the type based on the design motif. In this research will be carried out an analysis texture on the Image Motif of Endek Bali and then classify them into several classes based on the type pattern motif of Endek Bali. The first step in this research is to collect some Image of Endek with different motif, then transform image into a gray level image using Edge Detection and do the extraction using GLCM, after that performed data classification using K-NN. Based on the analysis of all the grades K that have been tested, the value K with the most excellent level accuracy is on K = 15 and on Correlation component, with an accuracy percentage of 43.33%. Overall, the Cemplong motif is a motif that has recognition accuracy levels better than most other motifs, that with a percentage of 57.50%. There are quite a lot of motifs that are less precise Endek recognized at the time of classification. It's because among the Endek motifs may have the similar texture. The purpose of this study is to analyze texture and classify image motif of Endek Bali so that later can be developed into an application or program that can help to recognize the type of fabric Endek Bali. And even better if the program is implemented on the mobile phone, it can facilitate the process of image acquisition and subsequent directly extracted and classified from the mobile phone and can produce accurate classification results.


INTRODUCTION
Endek is the local word that describes the ikat process, and two types of weft ikat fabric existed.Endek fabric is one woven fabric of Balinese handicrafts.Bali is one of the several provinces in the State of Indonesia.In Indonesia there are so many types of weft ikat cloth, each province has different models for weft ikat cloth.The popular one is the model of Batik fabrics originating from Java [1][2][3].
Image Motif of Endek Bali has been used as a source of data that will be extracted and further classified into several classes according to the pattern of Image Motif Endek.There will declare four class where that classes was determined based on the pattern of Image Motif Endek.The type of fabric Endek distinguished based on the motif that used on woven fabrics; the pattern motif is taken from the design of Balinese Carvings.Aside from Balinese Carvings motif, design of fabrics Endek also typically taken from the motif of plant or flower.Some kind of motif that will be taken as a class is a design that has a considerable difference between the design of other Endek.To the type of pattern that is almost similar motif, it's will be not used, to facilitate future research.Some kind of motif that will be used as a Class is such as Patlikur, Cemplong, Sekar and Wajik [1].
This research begins by collecting some data such as the image or a photo of each type of fabric Endek.Classification Image Motif Endek will run manually or in digital computing using digital image processing methods.Digital image classification process can be performed based on the features of each image.The best classification motif of Endek can be used for identification and could be to speed up the search process of Endek Image.Image classification process can be done by using image features such as color, shape, and texture of the image.Each image on each class is identified features that distinguishing from another class image.In this research will be used texture features for classification of Endek Image.Texture features components that will be using are Contrast, Correlation, Homogeneity, and Energy.The main objective of this study was to determine which features provide the greatest influence in the process of classification Endek Image.After obtaining the texture features of each image Endek, the next process is to perform the classification by K-NN method.K-Nearest Neighbor (K-NN) belong to a group instancebased learning.This algorithm is also one lazy learning techniques.K-NN is running by searching for objects in the group K closest training data or similar to the object on the new data or data testing.K-NN including supervised learning category, where the dataset should be trained first before the classification process itself [4][5].
The amount of the Data Set (Data Sample) used is 20 for each type of motif, so total there are 80 pieces of data set.While the amount of data (Data Training) used for this test were as many as 10 data for each type of motif Endek, so that total of 40 data.

II. LITERATURE REVIEW
Some words that used in this article was taken from the opinion quoted from several existing reference such as theses, dissertations, journals, and proceedings.In this literature review will be explain the meaning of each data sources and methods that used in this research.

A. Texture
Texture is a result of local variations in brightness within one small region of an image.Texture contains important www.ijacsa.thesai.orginformation about the structural arrangement of surfaces.The textural features based on graytone spatial dependencies have a general applicability in image classification.Texture is an intuitive concept that describes the nature of smoothness, roughness, and regularity in the region or area.In digital image processing, texture is defined as the spatial distribution of degrees of gray in a set of neighboring pixels.In general, texture refers to the repetition of elements of a basic texture called primitive or texture elementtexel.Terms formation of a texture is: a) Primitive pattern that consists of one or more pixels.This primitive form of pattern can be a point, a straight line, curved line, area, and others which are basic elements of a texture.
b) The primitive patterns recur at intervals and specific direction so that it can be predicted or discovered repetition characteristics.An image give different interpretation of textures when viewed with different distances and angles.
Humans look at the texture based on the description that is random, such as smooth, rough, regular, irregular, and soon.This is a description of improper and non-quantitative, so it needed a quantitative description (mathematical) to facilitate analysis [6][7][8].

B. Texture Analysis
Texture analysis is the basis of a wide range of applications, application of texture analysis, such us: remote sensing, medical imaging, identification of quality of materials (wood, leather, textiles, etc.) and also a wide range of other applications.Texture analysis techniques can be classified into three groups: Texture analysis has also been used to evaluate ultrasound images of the prostate.Other optical imaging modalities have utilized texture analysis, such as fluorescence microscopy images of colonic tissue sections and light microscopy images of the chromatin structure in advanced prostate cancer [6].

C. Endek Bali
Weaving is one of the techniques of making fabric that has existed since centuries ago.Weaving culture grew and developed in various places along with human civilization and culture in the local area, as well as the color and decorative or pattern of woven has its own peculiarities in each region.As with other regions in Indonesia, Bali also has a traditional form of woven fabrics Endek who became the pride of the people of Bali, which gringsing Endek woven fabric produced by the people of Bali Aga Tenganan Pagringsingan, Karangasem [1].
Dynamics of weaving craft endek divided into three periods of time is that the first period in 1985 -1995 in which development this year is very encouraging, it is due to the financial support of UNDP and state enterprises, weaving looms evolved from cagcag become loom machines, motifs endek fabric more developed not only a motive but various motifs produced.Endek evolving fabric is not only used by the nobility, but also has been used by the upper middle class people and lower middle customized with fashion or fasion in society.Bali's overall textile sector is now transforming endek into home goods and also into high fashion.Endek costumes are also important in rituals but this single ikat is now taking on a new life as fashion public [9][10].
The second period from 1996 to 2006 decreased developments that can be seen in terms of the production of woven fabric endek, due to competition with similar cloth factory production into the market.In addition yarn materials were hard to come by the craftsmen at that time.But it did not dampen the craftsmen to keep weave, woven fabrics and motifs Endek more developed.The third period at 2007 -2012, the development of this year fluctuated greatly perceived decline artisans entered the year 2008 -2010 yarn materials scarce, prices high yarn quality does not match the production standards endek cloth [10].
Fabric design motif Endek is taken from the motif of Balinese Carved, Wayang (shadow puppets), Animals, and motifs of Plants such as Leaves and Flowers.Examples of types of fabric Endek that uses design from Balinese Carved is the kind of fabrics Endek Patlikur, Cemplong, Wajik (diamond) and Patra.Then example for Endek that use motif from Wayang (shadow puppets) is Endek Wayang Kebo and Endek Wayang Putri.Example of Endek that use animals motif is Endek Ejekan Siap and for the last example for endek that use motif from Plants is Endek Sekar.In this research will be used four kinds of various types of fabrics Endek.The four types of fabrics Endek which will be used as a class is: Endek Patlikur, Cemplong, Wajik (diamond) and Sekar [1].Here is an explanation of each type of fabric Endek: a) Endek Patlikur Patlikur motif is a common motif used by the craftsmen of Balinese Carving, this Patlikur motif can be met in various kinds of Balinese carving, such as on the carving of a table, chairs, figura and are also frequently used on clothing or fabrics.Motif Endek Patlikur an original motif of Tenganan Gringsing Endek [1].

b) Endek Cemplong
Cemplong Endek fabric pattern, a fabric pattern endek taken from balinese carving motifs, in contrast to Patlikur which has a large pattern, while Cemplong have a small pattern and resembles the shape of the sphere.Motif Endek Cemplong an original motif of Tenganan Gringsing Endek [1].www.ijacsa.thesai.orgc) Endek Sekar Motif Sekar is a motif Endek that takes patterns from a flowers.The shape of the circuit pattern design looks like a flower.

d) Endek Wajik
Motif Wajik (diamonds) is a very simple motif endek, Wajik are a form such as a square or a symbol looks like a diamond.

D. Edge Detection
Object selection is usually running with step Edge Detection in image processing, Edge Detection process in MATLAB using a command or function "edge" and only use images or 2D images alone.Edge Detection on an image of a process that generates the edge of the image object, the purpose is [7]:

a) To mark the passage into detail image b) To fix the details of a blurred image, which occurs due to an error or the effect of the image acquisition process. A point (x, y) is said to be the edge of an image when the point has a height difference with its neighbors.
There are several methods in Edge Detection.Kinds of Edge Detection method for this process, among others [7] [11][12]: a) Robert Method Robert method is another name for the differential technique developed above, that is the differential in the horizontal direction and the differential in the vertical direction, with added binary conversion process after the differential.Binary conversion technique suggested is a binary conversion to flatten the distribution of black and white.Robert method is also equated with the technique Differential Pulse Code Modulation (DPCM).

b) Prewitt Method
Prewitt method is a development method using a filter HPF robert were given a zero buffer.This method takes the principle of Laplacian function, known as HPF function to generate.

c) Sobel Method
Sobel method is a development method using a filter HPF robert were given a zero buffer.This method takes the principle of Laplacian and Gaussian functions are known as the function to generate HPF.The advantages of this Sobel method is the ability to reduce noise before performing calculations Edge Detection.

d) Canny Method
Canny Edge Detection is the optimal operator.Canny operator using Derivative Gaussian kernel to filter noise from the initial image to get a smooth edge detection results.

e) Laplacian of Gaussian Method
This method will detect the zero crossing, to define the boundary line between black and white, located on the second derivative of the image in question.Disadvantages of the application of the Laplacian operator is very sensitive to noise, however, the result of Edge Detection with this operator can be improved, by applying thresholding.

E. Gray Level Co-occurrence Matrix (GLCM)
GLCM is also called as Gray level Dependency Matrix.It is defined as a two dimensional histogram of gray levels for a pair of pixels, which are separated by a fixed spatial relationship.Matrix Co-Occurrence is one of the statistical methods that can be used for texture analysis.Co-Occurrence matrix formed from an image by looking at the pixel pairs that have a certain intensity.The use of this method is based on the hypothesis that the texture will occur in a looping configuration or pair of gray cedar [8].

F. K-Nearest Neighbor (K-NN)
K-Nearest Neighbor method is a method to classify the object, based on the data that is distance learning close to the object, according to the number or value of K-Nearest Neighbors.Near or far neighbors are usually calculated based on euclidean distance with the following equation 1 [5][13]: g) Data test x put into a class with at least a small distance.

III. RESEARCH METHODS
There are several methods which will be used in this research, including the method for transform image into A Gray Level Image using Edge Detection, and then for extraction Image using Gray Level Co-occurrence Matrix www.ijacsa.thesai.org(GLCM) and for the last process is perform K-NN Classification method that used to classify the results of extraction Image.In this research there are several processes are carried out from the initial data is selected, until in the end the data is classified.The process is grouped into six main processes, such us: Here is a depiction or modeling flow chart of the process to be conducted in this research:

A. Choosing the Input Image
The process that was first performed in Texture Analysis on Image Motif of Endek Bali is to choose the input image.The input image is the image of some fabrics Endek with various types and formats supported by MATLAB.Image with other formats will not be recognized and will display an error message.In this research will be used four kind of motif fabrics Endek, such us: Endek Patlikur, Sekar, Cemplong and Wajik.The amount of the dataset (Data Sample) used is 20 for each type of motif, so the overall total there are 80 pieces of data.While the amount of data used for testing (Data Training) is as much as 10 data for each type of motif, so that a total of 40 data.

B. Change the Input Image into A Gray Level Image using Edge Detection
After selecting the input image then the next step is to convert the input image into a gray level image, the method used to change the image is to call a function that has been found in MATLAB, the name of that fungtion is edge detection function, There are several methods of edge detection is provided in MATLAB, the methods that will be used in this research is the Canny method.Canny edge detection is the optimal operator.Canny operator is using a Derivative Gaussian kernel to filter noise from the initial image to get a smooth edge detection results [7][11-12].

C. Perform Feature Extraction using Gray Level Cooccurrence Matrix (GLCM)
Texture is an important element of visual perception that can be used to separate the attractive area of an image.Texture can load important informations about the structure and its relation to the surrounding areas.The meaning of texture is the regularity of a specific patterns formed from the composition of pixels in a digital image.One important part of texture analysis is to use a matrix pair intensity Gray Level Co-occurrence Matrix (GLCM) which is a two dimensional matrix linkages.The matrix is a matrix of intensity pairs that describe the frequency of the appearance of two pairs of pixels with a certain intensity within a certain distance and direction in the image.GLCM can be calculated using the multiple spatial offset direction is 0 degrees, 45 degrees, 90 degrees, and 135 degrees.GLCM matrix obtained, characteristic texture of imagery used in this study can be measured by using the following features[14-16]:

Correlation
Correlation, is used to measure the correlation between a pixel to neighboring pixels of the entire image by using the equation 4

Homogeneity
Homogeneity, homogeneity is used to measure variations in the intensity of the image by using the equation 5

Energy
Energy, used to measure the concentration of the pair intensity on cooccurrence matrix using equation 6 At the MATLAB been provided all components of the GLCM segmentation, we can use the component with Graycoprops function, The following is an example of using Graycoprops function on MATLAB: GLCM = graycoprops (image, properties).GLCM is a matrix variable that will store the result of extraction using Graycoprops, Graycoprops is one function method in GLCM, image is a matrix variable of A Grey Level Image that before had been read in MATLAB and Properties is a component of GLCM that is Contrast, Correlation, Homogeneity and Energy.

D. Store the Feature Extraction Results
Characteristics obtained from the extraction image, then stored for later use in the creation of reference data.80 data image that has been extracted and stored, to later be used as reference data or sample data.And then will be extracted 40 new data image which will be used as data training, where this 40 image extracted one by one and then each of the extracted image is also stored, and later at the K-NN Classification process will be used to compared with the data sample, and then to determine the class of the image.The data result of extraction image on MATLAB can be stored into text file (.txt) or excel file (.xls).

E. Perform Reference Data (Data Sample) and Data Test (Data Training)
The next process is carried out after storage extraction results is to perform Data Sample that have been stored before, and also a training data that recently extracted and have been stored.At MATLAB we can call the data that has been stored using the function "load" or we can also directly www.ijacsa.thesai.orgopen the file by using the facility "open file" which has been provided in MATLAB.After being shown the file will be saved into MATLAB in the form of matrix variable, where latter the matrix variables can be used in the K-Nearest Neighbor (K-NN) classification process.

F. Perform Image Classification using K-Nearest Neighbor (K-NN)
After the Data Sample file and the Data Training perform and stored into a matrix variable on MATLAB, then the next process is to perform the classification process using K-Nearest Neighbor (K-NN).K-Nearest Neighbor (K-NN) process performed by comparing the data test (Data Training) with multiple data samples that have been stored before.A new data test are compared with the 80 pieces of data samples.The process performed by searching the data samples which value that is approaching the data test, if K = 5, then the system will look for 5 pieces of data samples which value approached with the data test, and so also with the others K values.This research will be performed K-Nearest Neighbor (K-NN) classification process with a value of K = 5, K = 10 and K = 15 [13][17].Examples of K-NN in MATLAB: Class = knnclassify (DataTest, Data Sample, Group, K).

IV. IMPLEMENTATION AND CLASSIFICATION RESULT
In this research, the classification process begins with the identification database of motifs image Endek into four classes Image motifs, such as: Patlikur, Cemplong, Sekar and Wajik, as shown in Figure 2.

Fig. 2. Four Class Motif of Endek Bali
The amount of data test that will be entered as the Data Training as many as 40 images from the same sources that have not been entered into the database by each class of 10 images, as shown in Figure 3.After determining 4 class pieces and as many as 40 training data, then the next to be done is to change the image data into A Gray Level Image using the Edge Detection function and method of Canny, where function and these methods have been provided on MATLAB, The following are some examples of Edge Detection that used in this research using MATLAB: Then that gray level image will be extracted using Gray Level Co-occurrence Matrix (GLCM) to obtain the characteristics of the image, then this feature will be stored into the the text or excel file and will be use as a training data that will be compared with the data sample and then to be processed on the classification process.Some examples of the extracted image using GLCM on MATLAB: www.ijacsa.thesai.orgAfter performing data test extraction using GLCM then the next step is to perform an Data Sample and Data Training file using the function "load" or "open file" and then performing the K-Nearest Neighbor (K-NN) classification using the function "knnclassify", that has been provide on MATLAB.In this study taken K value, that is: 5, 10, and 15.Of each value of K will be calculated accuracy of the classification process by using the formula of accuracy as in equation 7 [5][13].(7) The process of calculating the distance between the image in the K-NN classification for texture features using the absolute value of the difference between the value of each image texture feature parameters.Endek motif classification system built using MATLAB.Almost all of the functions needed for the construction of the system has been provided by MATLAB, so it's simply call the function of the library belongs to MATLAB.K-NN classification is done by comparing the data training that will be tested with data sample that has been stored before.Based on the results of tests performed, obtained the results as shown in Table 4, 5, 6, 7, 8 and 9 [5][7] [13].In table 4, 5, and 6 were tested by 10 data test for each motif Endek.And the data that written on the table is the number of correct data from 10 data image that has been tested on each properties of image components such as Contrast, Correlation Energy and Homogeneity.The range data will be inputed at the table is between 0 -10, because that is 10 data test on each motif of image that will be tested at this classification prosses.And the accuracy is obtained from dividing the correct data to the total data test, then multiplied by 100%, as described in equation 5. Classification testing done 3 times for each component feature extraction, that is to the value K = 5, K = 10, and K = 15.In Table 7[13] it can be seen that the Motifs Endek who have the highest level of accuracy is the Cemplong Motifs, which amounted to 57, 50%.Despite having differences that are not so far, that between 33.13% -35.00%.As for the value of K in the classification process which has the highest degree of accuracy can be seen in Table 9[5] [13] that is for K = 15 with a percentage of 35.00%.In the classification testing that has been done, there are many motifs that are not recognized in accordance with the actual type.According to the observations, the process of classification that does not correspond to the real motifs is because among Endek motifs has the same texture pattern and Endek has a complex texture pattern.For example for Cemplong motif it is often identified as Wajik motif, as well as the motif of Wajik is often identified as Cemplong.So also with the other motives that have frequent errors on determining the classification.

V. CONCLUSION
Based on the analysis, of all grades K that have been tested, the value K with the most excellent level accuracy is K = 15.And for testing the effects of feature extraction component with the highest score obtained by the component Correlation with a percentage 43.33%.Overall, the Cemplong motif is a motif that has recognition accuracy levels better than most other motifs, that with a percentage of 57.50%.There are quite a lot of motifs that are less precise Endek recognized at the time of classification.It's because among the Endek motifs may have similar texture and complex texture pattern.Because of that, is needs to be further investigated in to distinguish the different types of Endek Motifs that have a similar texture.The more data samples used in this study will be helpful to improve the accuracy at the time of the classification process.
test to the data sample xj : Data test j, with j = 1, 2, . . ., n yj : Data sample j, with j = 1, 2, . . ., n K-NN classification is done by searching k nearest neighbors of the data test and choose the class with the most members.The K-NN classification steps are as follows: a) If a set of data sample y having N data points overall, then will do the identification of the K-Nearest Neighbors of the data test x.b) Of a K Nearest Neighbors, data x identified in the class i, i = 1, 2, . .., M. M is the number of classes.c) Data test x included in the class with the highest number of members.d) If there are two or more classes  in the immediate neighborhood of the data test x, then there was a balanced condition (conflict) and use conflict resolution strategies.e) For the class conflict, the distance d is determined between the data test x with i class members involved in the conflict, which amounts to E. f) If the data sample of the class i involved in the conflict indicated by yim = {y1im, . .., yNim }, then the distance between x with class i is at equation 2: a) Choosing the Input Image b) Change the Input Image into A Gray Level Image using Edge Detection Method c) Perform Feature Extraction using GLCM Method d) Store the Feature Extraction Results e) Perform Data Sample and Data Training f) Perform Image Classification process with K-NN Method

Fig. 1 .
Fig. 1.Flow Process of Extraction and Classification

Fig. 3 .
Fig. 3. Data Test (Data Training) of Endek Bali Before the classification process performed, before had performed the Edge Detection and Gray Level Co-occurrence Matrix (GLCM) on 80 data samples, and that extraction result then stored into an text file or excel, which will be used as reference data (Data Sample) in K-Nearest Neighbor (K-NN) process.Here are some examples of data samples that have been stored.

Fig. 4 .
Fig. 4. Example of some Image that transform into A Grey Level Image using Edge Detection with Canny Method

Fig. 5 .
Fig. 5. Example of some extraction results using GLCM on MATLABGLCM performed on some data the extraction results will be used as the data test which will be stored in file text or excel, The following are some of the data characteristics, obtained from the extraction using GLCM, There are a total of 40 data test (Data Training), the following are some examples of data test that has been extracted using GLCM methods and stored as text or excel file:

Fig. 6 .
Fig. 6.Example of some klasification image using K-NN function on MATLAB with K = 5

TABLE I .
SOME OF GLCM SEGMENTATION COMPONENT, DESCRIPTION AND EQUATION

TABLE II .
SOME OF REFERENCE DATA (DATA SAMPLE)

TABLE IV .
RESULTS OF CLASSIFICATION TEST WITH K = 5

TABLE VI .
RESULTS OF CLASSIFICATION TEST WITH K = 15

TABLE VII .
[13]LTS OF CLASSIFICATION TEST BASED ON IMAGE MOTIF OF ENDEK BALI WITH ALL VALUE OF KFor each component influences the texture feature extraction can be seen in table 8[5][13].On the table it can be seen that all components feature extraction (Contrast, Correlation, Homogeneity and Energy) having differences in accuracy, that is between 29.17% and 43.33%, of the highest value obtained by Correlation component with a percentage 43.33%.

TABLE VIII .
RESULTS OF CLASSIFICATION TEST BASED ON COMPONENT FEATURE EXTRACTION

TABLE IX .
RESULTS OF CLASSIFICATION TEST BASED ON VALUE OF K