Determination of SVM-RBF Kernel Space Parameter to Optimize Accuracy Value of Indonesian Batik Images Classification

: Image retrieval using Support Vector Machine (SVM) classification very depends on kernel function and parameter. Kernel function used by dot product substitution from old dimension feature to new dimension depends on image dataset condition. In this research, parameter of Gaussian /Radial Basis Function (RBF) kernel function is optimized using multi class non-linear SVM method and implemented to training and test datasets of traditional Indonesian batik images. The batik images dataset is limited to four geometric motifs textures, which are ceplok/ceplokan , kawung , nitik and parang/lerang . Discrete Wavelet Transform level 3 daubechies 2 is used to result feature dataset of traditional batik images dataset of four classes geometric motifs textures. The batik images are used for training and test dataset in SVM-RBF kernel parameter optimation to maximize accuracy value in non-linear multi-class classification. Cross Validation and Grid-search methods are used to analyze and evaluate SVM-RBF kernel parameter optimation. Confusion matrix measurement method is used to result accuracy value in every evaluation conducted in every combination of cost function/C and gamma/ γ as SVM-RBF kernel parameter. Maximum accuracy parameter value is C = 2 7 and γ = 2 − 15 achieved by 10 times evaluation wit different test dataset for each evaluation. Maximum accuracy value is 0.77 to 0.86.


Introduction
This study aims to preserve traditional batik motifs texture culture came from Solo and Yogyakarta palaces, Indonesia. One of studies which can be developed is digital image retrieval based on texture of geometric motifs in traditional batik (Tirta, 2009), as seen in Fig. 1.
The dataset uses 80 images of traditional batik divided into four geometric motifs, which are ceplok, ceplokan, kawung, nitik and parang/lereng. The feature dataset which can properly characterize images is needed to achieve high accuracy in classification accuracy optimization result. Discrete Wavelet Transform (DWT) is a good method to be implemented in batik images. It has multi resolution dimension with various scale transforms and can result features by differentiating image intensity in several sub-band dimension (Virmani et al., 2013).
A study of DWT optimization using wavelet transform level 3 daubechies 2 to achieve proper feature in traditional batik motifs texture has been conducted by Budiman et al. (2016). The accuracy value optimization retrieval was achieved using binary class non linier SVM-RBF kernel classification method. Energy feature and deviation standard used in the classification with non-linear binary support vector method to recognize batik keraton and batik pesisir images had accuracy at 96.7%. Hence, DWT level 3 daubechies 2 was the feature extraction method implemented to result feature vector of every image in this study. Wavelet coefficient value in every sub-band resulted from DWT was used to define a feature vector for every image in form of energy value and Standard Deviation (STD) of every sub-band. The performance of a combination of mean, energy and standard deviation as features has been compared and the use of energy and standard deviation is the best combination of image feature (Kokare et al., 2003). Standard Deviation (STD) is used as a feature of every image since it can show a distribution of grey intensity; the lower STD value the more average distribution. The higher energy value as an image feature shows variation of texture elements (texel) with white color which is more dominant and the distribution of gray level/ the image structure becomes more irregular. The lower value shows variation of texel with black color which is more dominant and the distribution of gray level/the image structure becomes more regular.
Multi class SVM Classification with wavelet transform feature extraction integration has better tested than Artificial Neural Network (ANN) and empirical model to classify dataset of diffuse solar radiation (Shamshirband et al., 2016). Classification using SVM method with default kernel parameter has higher classification than Minimum distance method and back propagation neural network in recognizing five batik motifs textures (Yuan et al., 2014). In the texture classification of honey pollen images, SVM has better accuracy than classification methods of Multi-layer Perceptron, Minimum Distance Classifier and K-Nearest Neighbor (Fernandez-Delgado et al., 2003). Classification optimization of computed tomography medical images shows that SVM is better than K-Nearest Neighbor (Renukadevi and Thangaraj, 2013). SVM method is tested to two DNA micro array public datasets and compared to ANN method Ahmad (2013) and the result showed that SVM has success level than ANN.
Classification which uses SVM method for multi class and non-linear dataset needs to select the best kernel implementation to dataset. Kernel function optimization depends on dataset condition (Han and Michelin, 2006;Rosales-Perez et al., 2013;Renukadevi and Thangaraj, 2013), so it needs to conduct kernel parameter value optimization to minimize classification error on test dataset with parameter estimation using cross validation dan grid search method (Hsu et al., 2010). In previous studies, kernel function was recommended to be implemented is Radial Based Function (RBF). It has same performance with linear kernel in certain parameter (Rosales-Perez et al., 2013;Renukadevi and Thangaraj, 2013). RBF is an ideal function since it has calculation that is efficient, simple and easy to adapt to its parameter optimization (Gaspar et al., 2012;Shamshirband et al., 2016).
A parameter estimation is needed since gaussian RBF kernel function is used for dot product mapping substitution from old dimension feature to new dimension depends on dataset condition (Han and Michelin, 2006;Rosales-Perez et al., 2013;Renukadevi and Thangaraj, 2013).
A classification with maximum accurate value in recognizing batik images with various motifs, in which each batik image has a unique and non-linear feature motifs. The multi class SVM method needs experiments of the use of proper parameter range C and γ in the Gaussian RBF kernel, so it can define better new features (high dimensions) and result maximum classification function (hyperplane) for dataset of geometric motifs.
The best parameters combination for value C and γ has maximum accuracy from a classification result. The evaluation for optimizing parameters C and γ of non-linear multi-class SVM-RBF Gaussian kernel is used to achieve classification with small errors in dataset of traditional batik images with geometric motifs textures. The accuracy evaluation of classification was conducted. The value of the classification accuracy identified each use of parameters pairs of C and γ which were in the parameter scale. This was to optimize hyperplane in data training, so the classification can classify testing data in the proper class.

Materials and Method
This study which was a synthesis of several ideas of previous studies, aims to develop a method of determination the optimal value of space parameter in non-linear multi-class SVM-RBF kernel for classification of batik motifs with geometric ornament. First phase was to prepare Discrete Wavelet Transform (DWT) extraction feature optimization for classification of SVM-RBF kernel using standard parameter C = 1 and γ = 0.5. A comparison of wavelet types and level experiments was conducted to result the best vector feature for optimizing classification accuracy. Next phase was to optimize traditional batik motifs recognition with geometric motifs. All phase conducted in this study is showed in Fig. 2. The first phase (step 1 to 4) has been conducted our previous research and has resulted DWT level 3 and type of db2 feature extraction method. This method was used in this research (step 5 to 7).
The experimental setup of the second phase consists of step 5 to 7 with dataset contains 80 images of traditional batik divided into four geometric motifs, which are ceplok, ceplokan, kawung, nitik and parang/lereng. The feature extraction was to find statistical feature value by conducting pre-process to define recognized feature classes and change every color in the images into grey scale mode. The optimization of the result of SVM classification with grid-search and cross validation process is to minimize over fitting and to achieve a combination of parameter value of RBF kernel (C and γ) in the space parameter which results maximum classification accuracy value. The classification evaluation is to classify by learning features served by the extraction result and to equate to the dataset features by measuring accuracy level using confusion matrix method. The evaluation was conducted in every combination of C and γ.
Evaluation process to find C and γ value is to result the best classification conducted using one-againts-all svm (oaasvm) method. Accuracy calculation process which uses confusion matrix for every pair C and γ is showed in Fig. 3. Evaluation was conducted to achieve C and γ pair which has maximum accuracy value for classification result.  In order to maximize classification pattern, non-linear SVM handles over fitting with soft margin conducted by replacing every dot product of the testing feature with non-linear kernel function matrices (Boser et al., 1992). This kernel function is defined with focus to find that the dot product of two data in feature space can be replaced by kernel function with classification result (hyperplane) rather than not with knowing Ф mapping of what is used for every datum. Kernel function is used to map more than old training data to new training data which has feature space with higher dimension without defining mapping function of input space to new feature space (Hsu et al., 2010): Kernel function mapping, K: D 2 →D 3 : The function is symmetric (Mercer theory): Kernel trick to calculate kernel matrices/gram matrices N × N (N = total data dot) and every element value of matrices K (row, column) is used to replace dot product X i . X j in equation multi player Lagrange duality (Ld): SVM searches Lagrange parameter value of each feature (α 1...N ) for maximum Ld value and has condition 0<= α i <= C and Hyperplane: To identify class of every data ( The classification error in linear SVM classification is reduced by margin optimization which maximizes hyperplane distance with support vector (Boser et al., 1992), but features classification cannot be separated by linear. Kernel function is used as kernel trick in equation of SVM non-linear multi player Lagrange duality (Ld) to handle classification in SVM non-linear. There are several kernel function to replace K(x, x') = Ф(x) T .Ф(x') used in SVM non linear literatures, which are Polynomial of degree up to d, Gaussian RBF, Sigmoid, multi-quadratic inversion, Additive (Hofmann, 2006).
The SVM non-linear training optimization very depends on the use of kernel function and its parameters. Gaussian RBF kernel is more recommended to result maximum non-linear classification for a new dataset (Hofmann, 2006;Hsu et al., 2010;Rosales-Perez et al., 2013;Renukadevi and Thangaraj, 2013), since it has same performance with linear kernel on parameter cost (C) and gamma (γ) with certain value in classification optimization. Gaussian RBF kernel is stated as: The hyper parameter estimation which is a constant parameter value for soft margin (C) and kernel parameter (γ) is needed to result a new test dataset classification with maximum SVM non-linear Gaussian RBF kernel (Rosales-Perez et al., 2013;Renukadevi and Thangaraj, 2013). Parameter C and γ with proper value can keep ambiguous (measure of the error contribution) and variance (measure of the deviations) low when it is used for different training datasets with v-fold cross validation method and grid-search.
The high parameter C value and small γ value cause over fitting, while small value C and high value γ cause under fitting (Boser et al., 1992). The smallest value γ omits more feature dots as support vector which are nearby hyperplane and increase maximum margin. The higher of gamma value/γ increases support vector area and also flexibility from decision boundary (hyperplane). The evaluation of training and testing in the use of geometric motifs dataset is needed to maximize result of SVM nonlinear multi class classification with Gaussian RBF kernel. The evaluation is for success in estimation of hyper paramerter RBF kernel. The grid search with v-vold cross validation is used in this study. Grid search is a model of hyper parameter value searching in certain interval range (Hsu et al., 2010). The beginning range for this experiment is value C = {2 −3 , 2 −1 ,..., 2 15 , 2 17 } and γ = {2 −17 2 −15 , 2 −13 ,..., 2 1 , 23 }. The cross validation method divides dataset into v partition (v-fold) randomly and each partition has index number 1 to ν. Common number of partition is 10 partition or 10-fold cross validation (Gaspar et al., 2012;Virmani et al., 2013;Syarif et al., 2016). 10 times tests are conducted for 10 partitions by leave-one-out technique, in which one part is used alternately as test dataset and other parts (v-1) are used as training dataset. Every value in the interval is evaluated and the next tested value is addition of its parameter value exponentially. The next evaluation for smaller range between that best hyper parameter is conducted when maximum hyper parameter value has been defined.
The accuracy value measurement for every test dataset resulted from cross validation partition is conducted based on combination of parameter value used to classify. The measurement uses confusion matrix technique which is divided into positive data prediction class (positive right/BP; positive wrong/SP) and negative data (negative right/BN negative wrong/SN). Accuracy value is (BP+BN)/ (BP+BN+SP+SN).

Result and Discussion
The classification was conducted ten times using ten different training and test datasets. The classification was conducted for every C and γ parameter combination evaluation (10-fold) to make sure there is no over fitting in evaluation with different test data. In every evaluation, training and test datasets are chosen randomly and equally for number of class 1, 2, 3 and 4 of vector file feature with size 80×21. A dataset which contains 80 traditional batik images was used in every training and test. The 10-fold method CV with leave-one-out process in feature vector images which was randomly selected resulted 8 feature vector for every test dataset used in every test.
The random selection were conducted using hold out process using percentages at 30% for test dataset and the rest were used for training dataset to increase number of test dataset. Process hold out in CV for vector file feature selected records for test data randomly. Class 1 (ceplok motifs) contained 1-20 records and 6 records were randomly selected; class 2 (kawung motifs) were 21-36 records and 4 record were randomly selected, class 3 (nitik motifs) were 37-55 records and 5 records were randomly selected; 7 record were selected in class 4 (parang motifs).
The experiment analysis for every combination of C and γ parameters value contained in grid-search range was used for ten times classifications, in which every training and test evaluation process used different training and test datasets resulted from CV. Ten times evaluations were conducted to avoid over fitting and under fitting that may result very different accuracy for different test datasets. The optimization of parameter C and γ was to achieve RBF kernel value which can result multi class non linear SVM classification with low bias (measure of the error contribution) and low variance (measure of deviation).
The best parameter value estimation used parameter value range known with grid-search method. The preevaluation of grid-search method was conducted using wide range of parameter C and γ. Narrower range of parameters was conducted when the best parameter was found to achieve parameter value that can result the best classification accuracy value. There is no rule for proper range in grid-search method. The wider parameter range was effective in resulting combination C and γ as the best parameter to significantly increase accuracy value in image retrieval. The proper parameter value of C and γ can maximize classification function (hyperplane) and adjust the balance of margin distance (+1 and −1) with proper hyperplane. There were four hyperplanes and margins (+1 and −1) for four geometric motifs classes in SVM classification using one-againts-all, so there were four times training to result hyperplane and margin. The training is for non-linear binary class SVM-RBF classification in ceplok motifs (+1) with non-ceplok motifs (−1); kawung motifs (+1) with non-kawung motifs (−1); nitik motifs (+1) with non-nitik motifs (−1); and parang motifs (+1) with non-parang motifs (−1).
The phases conducted for experiments of every value pair of C and γ used one-againts-all svm (oaasvm) method and accuracy calculation process used confusion matrix for every value pair of C and γ was described in algorithm 1. The evaluation of every pair value of C dan γ was conducted to achieve pair of C and γ which has maximum classification accuracy value. The parameter value range in the beginning of experiment is C = {2 −3 , 2 −1 , 2 1 , 2 3 , 2 5 ,... 2 13 , 2 15 , 2 17 } and γ = {2 −17 2 −15 , 2 −13 ,..., 2 −5 , 2 −3 , 2 −1 , 2 1 , 2 3 }. It is a standard parameter as binary classification with value C = 1 and γ = 0.5. Table 1 shows accuracy and error level in every evaluation of the beginning experiment which used 10 training datasets and 10 test datasets. The evaluation resulted the average accuracy = 0.354545455 and average error = 0.645454545. The use of parameter C = 1 and γ = 0.5 has low accuracy that is lower than 0.5, since it cannot result hyperplane and margin which can well recognize test images for class 1, 2 and 3. High bias in the use of parameter C = 1 and γ = 0.5 caused under fitting for class 1, 2, dan 3.  The next experiment used parameter C = {2 −3 , 2 −1 , 2 1 , 2 2 , 2 3 } and γ = {2 3 , 2 1 , 2 −1 , 2 −3 , 2 −5 , 2 −7 , 2 −9 } and there was no significant change. Motifs of class 1, 2 and 3 cannot be well recognized. These motifs started to be recognized in parameter combination of C = 25 dan γ = 2-11 which has average accuracy = 0.504545455 and average error = 0.495454546, with accuracy value and error level as described in Table 2.
The one-againts-all method in non-linear classification SVM with four class consists of four binary class non-linear SVM classification, so parameter value of C and γ must maximize classification result to form four hyperplanes and margin (+1 and −1) and parameter value of C < = 2 3 and γ > = 2 −9 cannot recognize motifs of class 1, 2 and 3. The parameter value C < = 2 3 with calculation of maximum Lagrange multiplayer equation value resulted more value of α i > 0 for more soft margin forming. The more feature vector as support vector at parameter value of C < = 2 3 made soft margin maximizing margin by ignoring support vector which is nearby hyperplane and used support vector dot with maximum distance of hyperplane.
The parameter value of C < = 2 3 which caused margin distance with maximum hyperplane causes high bias, since there was under fitting or it was not able to recognize class for feature vector (x i ) which was between margin limit and hyperplane (−1 < x i < = 0 and 0 < = x i < +1). Value of γ > = 2 −9 resulted higher value −γ||x−x i || 2 in RBF kernel. This effected in the increasing of support vector area and hyperplane flexibility, so it caused margin forming linkages between support vectors which are close together. Margin limit cannot recognize feature vector extensively and classification result tends to high bias due to under fitting.
The next experiment used parameter value of C > = 2 5 and γ < = 2 −11 . The balance of parameter value of C and γ needed to be achieved for maximum accuracy value result of four binary class non-linear SVM classifications by optimizing hyperplane and margin of those classifications. The parameter optimization was conducted to achieve low bias and low variance in traditional batik images retrieval for four geometric motifs classes. The next experiments used parameter value of C > = 2 5 and γ < = 2 −11 . The high value for C and lower value for γ caused over fitting that results high variance. The higher value of C which made maximum equation value calculation of lagrange multiplayer was resulted for less value of α i > 0, so the number of support vector became less and be at nearest distance to hyperplane. The higher value of C made the number of support vector less and made margin distance and hyperplane became narrower. This caused over fitting, or error in classification class area placement to feature vector which were nearby hyperplane. The lower value of γ caused less support vector, so the forming margin had decision boundary which was similar to linear.
The maximum retrieval with low bias and low variance at parameter range defined in this experiment was achieved at parameter value of C = 2 7 and γ = 2 −15 with the number of feature vector properly recognized was 17 to 19 of 22 test dataset feature vector in every evaluation. The result of accuracy for ten times evaluation with parameter value of C = 2 7 and γ = 2 −15 and different test dataset in every evaluation, as shown in Table 3, set the average accuracy = 0.813636364 and average error = 0.186363636.
The next evaluation of value combination was conducted with parameter C ≥ 2 9 and γ ≤ 2 −17 (Table 4). The accuracy value in every evaluation relatively decreased and the measure of deviations (variance) increased that caused an increase in over fitting in the class definition of testing feature data.
There is no significant change in the experiment analysis of the use of the parameter combination with that range. The best result was still the parameter combination of C = 2 7 and γ = 2 −15 . This experiment showed that parameter estimation to optimize the performance of SVM-RBF kernel classification was needed to achieve accuracy value in traditional batik image retrieval that has geometric motifs texture which as multi scale motifs and multi resolution color.    The maximum parameter value and the smaller parameter value range defined in this experiment can be a reference to SVM-RBF kernel classification of digital image retrieval with geometric motifs textures.

Conclusion
The optimization of RBF kernel parameter to achieve maximum accuracy value in non-linear SVM classification method for traditional batik image retrieval that has four geometric motifs texture has been successfully conducted in this study. The image feature vector used as training and test datasets of SVM-RBF kernel classification can inform image feature properly. The feature vector was resulted from feature extraction of traditional batik images dataset with DWT level 3 and type of db2 which has been evaluated in the beginning phase. The feature vector can inform the image characteristic. The parameter optimization of C and γ conducted using grid-search and 10 fold Cross Validation with holdout is resulted by 10 training datasets and 10 test datasets from feature vector selected randomly. SVM-RBF kernel classification for every combination of parameter C and γ in grid-search range has been conducted using 10 training datasets and 10 test datasets. 10 times evaluation for every combination of C and γ that used different test dataset for each evaluation achieved parameter combination of C and γ which result low bias and low variance.
Confusion matrix is used for accuracy value measurement conducted 10 times for every parameter combination of C and γ of RBF kernel and different test dataset for each evaluation. Every parameter combination of C and γ used in RBF kernel had 10 accuracy values to show that there was no significant different for error retrieval when a different dataset was used. The maximum accuracy value for parameter C = 2 7 and γ = 2 −15 are 0.77 to 0.86 with success image retrievals in every evaluation were 17 to 19 images of 22 images and had average accuracy = 0.813636364 and average error = 0.186363636. Based on the result in this research, a classification of images with geometric motifs texture using non-linear multi class SVM-RBF kernel are recommended to use grid-search range of C = {,2 6.5 , 2 6.75 , 2 7 , 2 7.25 , 2 7.5 , 2 7.75 , 2 8 } and γ = {2 −14.5 , 2 −14.75 , 2 −15 , 2 −15.25 , 2 −15.5 , 2 −15.75 , 2 −16 }.
In order to complete the batik motifs knowledge base, the range value of C and γ recommended in this research is still need to be evaluated with SVM-RBF kernel nonlinear for more than four classes of batik motifs, as well as a study of feature extraction with feature combination using another methods and evaluation for process time and accuracy of classification.