Digit Classification of Majapahit Relic Inscription using GLCM-SVM

Currently, there are many studies that discuss the classification of images with various objects and methods. Image classification is commonly used to create object recognition apps. Classification of images is used to create an object recognition applications. For example are Text and character recognition on metal-sheets [1], Deep learning for handwritten Javanese character recognition [2], Content-based image retrieval for multi-objects fruits recognition using k-means and k-nearest neighbor [3], License Automatic Plate Recognition based on edge detection [4] and Arabic handwriting recognition using sequential minimal optimization [5].


I. Introduction
Currently, there are many studies that discuss the classification of images with various objects and methods. Image classification is commonly used to create object recognition apps. Classification of images is used to create an object recognition applications. For example are Text and character recognition on metal-sheets [1], Deep learning for handwritten Javanese character recognition [2], Content-based image retrieval for multi-objects fruits recognition using k-means and k-nearest neighbor [3], License Automatic Plate Recognition based on edge detection [4] and Arabic handwriting recognition using sequential minimal optimization [5].
In this study, the author attempted to use the image of the object-year figure (digit of year) on the inscription number of relics of the Majapahit Kingdom in Java, Indonesia. Classification method used is a Support Vector Machine (SVM), whereas the method of Gray-Level Co-Occurrence Matrix (GLCM) is a method used for the extraction of features.
The purpose of this study was to perform image classification of a digit of the year whose form has its own uniqueness. This image classification of a digit of the year is used as an object of research to assist the public in recognizing the number of years of an inscription writing stored in the museum Trowulan, Mojokerto, East Java. Additionally, it can be used to document the image of a digit of year digitally.
Image of a digit of the year is classified into 1,2,3,4,5,6,7,8,9, and 0 classes. Within this present study, the authors expect that the result is worthwhile to the direct contribution to the results of the study which are directly related to the preservation of Majapahit Kingdom ancient relic in Indonesia. Because what we are doing here pertained to participate in the preservation of the scope of the history and culture of Indonesia. So far, there is no research which employs the image of a digit year object on relic inscription of Majapahit Kingdom. Therefore, the authors were interested in the attempt to build an application to recognize the image of a digit of the year in relic inscription using recent technology. The author also expects that this research could inspire other researchers in the A higher level of image processing usually contains some kind of classification or recognition. Digit classification is an important subfield in handwritten recognition. Handwritten digits are characterized by large variations so template matching, in general, is inefficient and low in accuracy. In this paper, we propose the classification of the digit of the year of a relic inscription in the Kingdom of Majapahit using Support Vector Machine (SVM). This method is able to cope with very large feature dimensions and without reducing existing features extraction. While the method used for feature extraction using the Gray-Level Co-Occurrence Matrix (GLCM), special for texture analysis. This experiment is divided into 10 classification class, namely: class 1, 2, 3, 4, 5, 6, 7, 8, 9,  In this research, SVM method was chosen as a classification method. SVM is a classifier which utilizes the farthest margin distance from hyperplane [6] [7]. SVM is also commonly known as a method which is able to process data with high dimension without reducing the dimension of particular data [8] [9]. SVM frequently provides an identical model and solution. The result of the model could be utilized again in the testing process. SVM is able to separate data distribution which its classification is linear or non-linear. Meanwhile, this research employed GLCM for feature extraction. GLCM is one of simple feature since it is obtained from the greyness level of the certain image [10] [11][12] [13].
There are several similar research which employed SVM method for image classification and GLCM for extraction of features, such as research conducted by [7], [10], and [13]. However, they utilized different image objects. In the research conducted by [7], the author's utilized image of tumors and the results of trial detection obtained the precision score of 93.3 %. In the research conducted by [10], the authors succeeded to classify between hazy and not-hazy image by obtaining result accuracy of 97.16 % for synthesis database and 85 % for the genuine database. Meanwhile, in research conducted by [13], the authors obtained an accuracy of 98.32 % on sub-image A, 84.49 % on subimage B, and 78.96 % on sub-image C from segmentation of oil palm. In accordance with several previous research which succeeded, thus the authors decided to employ SVM and GLCM as a method within this research.
To facilitate understanding of the process of this research, thus the authors employed the article writing structure by dividing into three parts, research methodology, experiment results, and the last part is the conclusion. In research methodology part, the authors provided three subparts as follows: data collection, method, and data analysis. Data collection sub-part explains how the authors obtained the set data utilized in this study. Method sub-part explains how do SVM and GLCM work. Meanwhile, data analysis sub-part discusses how dataset employed could be implemented by the determined methods. In the experiment results part, it exposes the result of the trial of SVM method implementation. SVM, in this research, attempted to compare image classification, where extraction of features is without GLCM implementation and other trials of image classification where extraction of features had its extraction of features employing GLCM. In the conclusion part, it discusses the red line of the utilized methods and provides a comparison of trial results.

A. Data Collection
The data used in this research is an image of a digit from relic inscription of Majapahit Kingdom digit of the year. The image of the digit was taken from sampling result and image quantification which was acquired as much as 1000 images. In this research, 900 images of a digit of the year were utilized as data training and 100 images of a digit of the year were utilized as data testing. The utilization of data training in each class is 90 images and as for data testing, 10 images of a digit of the year were utilized in each class (an example is shown in Fig. 1).

B. Feature Extraction
A feature extraction stage is intended to extract the characteristics or information of the object in the image that is aimed to be identified or distinguished with other objects. Characteristics or features that have been extracted and then is used as parameters or input values to distinguish between objects with one another on the stage of identification or classification. Numerous methods can be used in the extraction of features, however, in this study, the authors chose GLCM method for extraction of features on the image of a digit of the year, with the reasons as noted in the previous section.
The definition of GLCM is a tabulation of how often a different combination of pixel brightness values (gray level) that occurs in an image. GLCM is a matrix that has dimensions based on the gray level of an image. GLCM has 22 features. However, the most important features are 3 elements, namely contrast (CON), correlation (CORR) and homogeneity (HOM) [10]. Contrast is a representation of the number of local gray level in an image. Correlation is a linear measurement gray level between neighboring pixels. Homogeneity is a measure of homogeneity variation of gray level in an image. Usually, when the contrast value is small, then the homogeneity value is great. To calculate GLCM, Cm,n, it can be calculated based on the distance of d and the direction of  [13]. Thus, the formula GLCM can be seen as written in the following equation (1).
where Ci,j is the intensity of the co-occurrence matrix; i and j are a couple of pixels with intensity values I(x, y) = i and I(x ± d1,y ± d2) = j; x = 0, 1, ..., M-1 and y = 0, 1, ..., N-1; while M and N is the number of rows and columns of the matrix.
After the intensity of the co-occurrence matrix is formed, then each element of the matrix P{•} needs to be normalized by dividing each element with a number which is the sum total of the pixel pair. The result of the normalization of P{•}, can be seen in the following equation (2).
The contrasting parameter represents gray level variations in an image file, usually used as a parameter contrast linear dependence on the value of neighboring pixels of gray level. Contrast can also be referred to as the variance of the sum of squares (sum of squares variance). The formula for calculating the Contrast (CON), can be seen in the following equation (3).
The correlation parameters showed a linear dependence of the degree of gray pixels neighboring each other in a gray image. Equation correlation (CORR), can be seen in the following equation (4), where  is the deviation standard of x and y.
Homogeneity is the parameter in GLCM that indicates homogeneity intensity variations in an image. This homogeneity equation is said to represent the roughness in the image field. Calculation of homogeneity (HOM) can be seen in the following equation (5).

C. Classification
Data mining is a process of inferring knowledge from huge data. Classification is a major technique in data mining and widely used in various fields. Classification is data mining (machine learning) technique used to predict group membership for data instances. By simple definition, the classification analyzes a set of data and generate a set of grouping rules which can be used to classify future data. For the classification, we focus on Support Vector Machine (SVM) [14].
SVM is a powerful algorithm with strong theoretical foundations. SVM has strong regularization properties, which refers to the generalization of the model to new data [14] [15]. SVM is a supervised machine learning algorithm. Supervised learning method processed through two steps: Training and Testing [6].
SVM is based on the concept of decision making [7]. A Decision-making is based on the separation of feature members of different classes. SVM is chosen, because it is able to cope with very large feature dimensions and without reducing existing features. An SVM performs classification by constructing an n-dimensional hyperplane [15]. The purpose of SVM is to find the largest margin of hyperplane [10].
An SVM is a mathematical entity, an algorithm for maximizing a particular mathematical function with respect to a given collection of data. SVM can handle data that is linear and non-linear data. Simple SVM is usually linear in dividing features into both classes. The SVM Linear kernel function is commonly described as equation (6).
where, K(x, y) is inner product of x and y.
SVM is grouped into two type linear and non-linear classification. The linear SVM classifier is worthwhile for the non-linear classifier to map the input pattern into higher dimensional feature space. In here, we used non-linear SVM, which is divided into several classes. Therefore, SVM requires a kernel. Gaussian kernel or commonly known as Radial Basis Function (RBF) can be written as equation (7). The RBF kernel, is applied to two samples x and y, which indicate as feature vectors in some input space and it can be defined as,

D. Data Analysis
In this study, the trial would be conducted using two scenarios. The first experiment was tested by performing data classification without passing GLCM extraction of features process, workflow without GLCM features can be seen in Fig. 2. The second trial was performed by passing GLCM extraction of features process, whereby its workflow can be seen in Fig. 3.
Meanwhile in the workflow of Fig. 2, after the image was done in pre-processing, then the image will be converted into a matrix of pixels. After converting into a pixel matrix, the images were converted back into a vector. The images in the vector were then forwarded using SVM method to perform the classification process. While according to the workflow in Fig. 3, the results of GLCM features would be utilized to be classified. Therefore, the workflows between systems without GLCM features and with GLCM features are different, so that it can generate different predictions. Classification in the training sets by using the image of a digit of years in Fig. 4 will produce a model. And this model will then be used to make predictions on the testing sets. Examples of the image of a digit of the year in ancient relic inscriptions which were used for Training Set and Testing Set can be seen in the following Fig. 4 and Fig. 5, each of which represents a grade 0 to grade 9.
At the stage of pre-processing, the image of a digit of the year will be converted to the size of 32x32 pixels. The original image of the RGB format is converted into Grayscale. Fig. 6 is the grayscale result of digit of year image sample 1 in Fig. 4.
Once the image is converted, it appears that the workflow in Fig. 3 would take the process to obtain GLCM features which include contrast, correlation, and homogeneity. As an example, the results   Fig. 4 can be seen in the following Table 1.
The visualization of GLCM features con, corr, and hom in Table 1, only for the digit of the year image sample 1, can be seen in Fig. 7 while Fig. 8 is a matrix formed from Fig. 7. In Fig. 8, this grayscale matrix still has dimensions of 32x32. While after the process of GLCM, the grayscale matrix has changed into dimension 1x1. Fig. 9 is a visualization of the data distribution on the resulting model of the training process in Fig  3. The con, corr and hom values are distributed into 10 classes. From Fig. 9, it is seen that between the distributions of values per class almost has the same value as the other classes.

III. Experiment Results
The experiment conducted in this research was employing the dataset which has been explained in the data collection. The employed dataset was 100 images of a digit of the year, which was divided into two types of dataset, namely 900 images were taken for the training set and 100 images were taken as a testing set. It represented each of class 1, 2, 3, 4, 5, 6, 7, 8, 9 and 0. The training set consisted of 90 images for each class and testing set consisted of 10 images for each class. The experiment results employing test without GLCM features (Fig. 2) are presented in the following Table 2.  The experimental results of trials in Table 2 show that using data from testing of 10 images predicted in class 9 and class 0, has the first highest percentage of 100 %. The order of the second highest percentage of 90 %, the data for testing of 10 images predicted only in class 6. In class 3, it obtained a percentage of 80 %. While in class 1, class 2, class 5, class 7 and class 8 obtained a percentage of 70 %. The lowest prediction was the 4th class with a percentage of 50 %. The reason for low predictions in the 4th class remains unknown since it is in the process of examination and further research. Currently, the accuracy improvement will be continued until it reaches the intended target.
Whilst, the results of a test on the system workflow in Fig. 3 which employed GLCM features can be seen in Table 3. The results of the prediction percentage are very low which obtained an average of 36 %.  The experimental results of a test on Table 3 show that by using 100 data testing, which is divided into 10 classes with each of 10 images per class, the prediction results are as follows: the predicted in class 0 obtained a percentage of 100 %. In class 2, 5 and 6 obtained a percentage of 50 %. In the third class, it obtained 40 %, and the percentage of class 7 obtained a percentage of 30 %. In class 8 and 9, it obtained the percentage of 20 %, while class 0 and 4 did not manage to identify any training set.
The reasons for very low predictions in almost all classes remain unknown because it is in the process of examination and further research. Currently, the accuracy improvement will be continued until it reaches the intended target. Nonetheless, the author has guessed that the cause is due to less specific the results of extraction of a feature, in this case, is also due to the distribution of features in the formation of highly influential decision boundary. Therefore, in future research, the results in the process of feature extraction are required to be improved by adding a data set of up to 3000 images. Fig. 10 is a graph of the percentage of predicted results for the classification class 0 to class 9, using GLCM features and without GLCM features.

IV. Conclusions
Classification performed by SVM aims to make the decision boundary. Decision boundary derived from the model resulting from the testing of the training set into the SVM. Model of this training set will be used for examining the testing set in order to be able to predict a new record. Decision boundary would be good if a data has a specific feature. The test results shows that the SVM results are better than GLCM-SVM. This is because the distribution of the features in the formation of the decision boundary is highly influential.