ON INFORMATICS VISUALIZATION

— Batik is one of the Indonesian cultures that UNESCO has recognized. Batik has a variety of unique and distinctive patterns that reflect the area of origin of the batik motif. Batik motifs usually have a 'core motif' printed repeatedly on the fabric. The entry of digitization makes batik motif designs more diverse and unique. However, with so many batik motifs spread on the internet, it is difficult for ordinary people to recognize the types of batik motifs. This makes an automatic classification of batik motifs must continue to be developed. Automation of batik motif classification can be assisted with artificial intelligence. Machine learning and deep learning have produced much good performance in image recognition. In this study, we use deep learning based on a Convolutional Neural Network (CNN) to automate the classification of batik motifs. There are two datasets used in this study. The old dataset comes from a public repository with 598 data with five types of motifs. Meanwhile, the new dataset updates the old dataset by replacing the anomalous data in the old dataset with 621 data with five types of motifs. The lereng motif is changed to pisanbali due to the difficulty of obtaining the lereng motif. Each dataset was divided into three ways: original, balance patch, and patch. We used ResNet-18 architecture, which used a pre-trained model to shorten the training time. The best test results were obtained in the new dataset with the patch way of 88.88 % ±0.88, and in the old dataset, the best accuracy was found in the patch way on the test data of 66.14 % ±3.7. The data augmentation in this study did not significantly affect the accuracy because the most significant increase in accuracy is only up to 1.22%.


I. INTRODUCTION
Batik is one of the Indonesian cultures that has been worldwide and recognized by UNESCO. Batik has a variety of unique motifs based on the origin of the area where the batik is made. Batik is the art of drawing on cloth with repeated patterns using a tool called canting. The development of the era makes batik motifs more diverse. However, people still cannot distinguish batik motifs on the internet because of the many varieties. Therefore, it is necessary to develop an automated classification of batik motifs to solve this problem.
Many studies have been carried out regarding batik starting from batik image retrieval using the CNN method [1] and Local Binary Pattern [2]. Research on the automation of batik motif classification has also been carried out using machine learning methods such as Gray Level Co-occurrence Matrix (GLCM) [3]- [7], Support Vector Machine (SVM) [8], Multi Texton Co-occurrence Descriptor (MTCD) [9], and Backpropagation [10]. The use of deep learning methods has also been widely used using the CNN method [11], [12] dan Fuzzy Neural Network [13]. The use of CNNs with different architectures such as VGG-13 [14], VGG-16 [15]- [17] dan VGG-19 [18] has also been used to automate the batik motifs classification. The studies that many researchers have done give good and bad results. For example, research conducted by Tristanto [11] uses CNN for feature extraction with SoftMax as its classifier to classify batik motifs with a total data of 967 images with 13 classes resulting in an accuracy of 56 %. A study conducted by Arsa [16] uses CNN with VGG-16 architecture as feature extraction and random forest as a classifier with a total data of 300 images with 30 classes, resulting in an accuracy of 97.58 % ± 2.32. Gulthom [15] uses CNN with VGG-16 architecture as feature extraction and SoftMax as its classifier with patching method using total data of 2092 images with five classes resulting in an accuracy of 89 % ± 7. Agastya [18] used the Gulthom dataset, which uses CNN with VGG-19 architecture as feature extraction and SoftMax as its classifier. Implementing the same patching method with 900 images with five classes improves accuracy to 89.3 % better than previous research [15] by 0.3 %. The machine learning method conducted by Purnomo also gives a good result using GLCM as feature extraction with Learning Vector Quantization as a classifier with 4050 images and four classes resulting in an accuracy of 92.79 % without normalization and normalization value increased to 98.98 % of accuracy.
Good and bad accuracy results are influenced by the dataset used. Each study uses a different dataset and gives different results. Only two researchers used the same dataset [15], [18]. To advance the development of batik motif automation, we decided to use datasets from previous studies [15]. From the previous study, the dataset consists of five classes: Ceplok, Kawung, Lereng, Nitik, and Parang, with 603 images. We added and modified the dataset from previous research to improve the model's performance. This study employed pretrained CNN with Residual Network (ResNet) architecture.

A. The Dataset
We used two kinds of datasets. We got the old dataset [15] from the public repository, and the new dataset is an updated version of the old dataset. We upgraded the dataset because we found mixed motifs and wrong data placement in each class. For example, in Fig.1, some batik patterns have mixed patterns, as we can see in the Nitik class folder. In other classes, we also found mixed patterns. To improve the model's performance, we need to gather more data. Gathering more data in the new dataset is done by combining good quality data from the old dataset and various resources such as e-commerce. For example, in the new dataset, we replaced lereng class with pisanbali because of the difficulty of getting lereng patterned images on the internet and e-commerce. In Fig. 2, we can see some sample images from the new dataset in this research. Batik has a repeating pattern. Therefore, we can divide the image into four parts to add data, as done in previous studies [15], [18]. For example, it can be seen in Fig. 3 that this patching method is expected to increase data 4 times more than the original and add more data variants to improve model performance. This study split the dataset into 80 % training data and 20 % test data. Every dataset is split into three ways: original, balance patch, and patch. Initially, the dataset is split into 80 % training and 20 % test data. In the balance patch way, the training data from each class was even because the balance patching method was implemented. The test data of the balance patch include all the test data from the original way, and all those data also was patched in the same way. Finally, all initial training and testing data was patched in a patch way without considering the balancing term. For more details, we can see split data in Table I and Table II for  the old dataset, Table III, and Table IV for the new dataset.    In some cases, the use of skip connection is claimed to be able to learn something to improve the model performance. Performance comparison can be seen in Fig. 5 and Fig. 6. According to the experimental results, the ResNet model has an advantage over the plain model in comparing errors generated using the CIFAR-10 dataset. Therefore, we decided to use ResNet in this research. We used ResNet18 with pretrained models from ImageNet to improve model performance. All data from the two datasets used are 3channel RGB, where the size is made no smaller than 224 x 224 pixels. Then, all data were normalized with mean = [0.485, 0.456, 0.406] and std = [0.229, 0.224, 0.225]. We used a learning rate (lr) scheduler with a value of lr = 0.001, step size 30, and gamma = 0.1. For optimization of the model, we used Stochastic Gradient Descent (SGD) with momentum = 0.9. We only classify five classes. Therefore, we changed it from 1000 SoftMax classes to 5 SoftMax classes in the prediction layer. Lastly, we applied CrossEntropyLoss [20] as an error rate evaluator.
The first test is to find the best performance from the two datasets by making all image sizes of 224 x 224 pixels. The second test used a strategy of augmentation data, and the dataset used in this second test came from the first test with the best performance. Augmentation data used are random size crop 224 x 224, gaussian blur, and random rotation (45°-270°). Finally, the last test was carried out using the dataset with the best performance in the first test by trying the effect of a grayscale image with normalization of mean = [0.5, 0.5, 0.5] dan std= [0.5, 0.5, 0.5].

III. RESULT AND DISCUSSION
All experiments were conducted by 5-fold cross-validation to evaluate the proposed method. The data in the test data for each fold is different. Fig. 7 shows the line information on the next figures for better understanding.   Fig. 10 show a convergence starting from the 10th epoch. From the three ways that have been experimented on the old dataset, the resulting increase in accuracy is only 3.26 %. This is calculated from the difference in the accuracy of the three ways. The gap between test and training accuracy is around 28.39 %. The patch way gave the best accuracy results than the other ways. For more detail, it can be seen in Table V. Fig. 8 The accuracy of the original way in the old dataset Fig. 9 The accuracy of the balance patch way in the old dataset Fig. 10 The accuracy of the patch way in the old dataset Fig. 11 to Fig. 13 show a convergence starting from the 10th epoch. From the three ways that have been experimented on the old dataset, the resulting increase in accuracy is only 3.63 %. This is calculated from the difference in the accuracy of the three ways. The gap between test and training accuracy is around 10.66 %. The patch way gave the best accuracy results than the other ways. For more detail, it can be seen in Table V.  As we can see from Table V, the patching method can increase the accuracy of both datasets up to 3.63 %. The patching method has balanced the data and did not greatly improve the model's performance. The difference in accuracy between the two datasets reached 22.74 %, where the new dataset is better than the old one. The first test results show that the new dataset is better than the old one. Therefore, the second test used the new dataset. It can be seen in Table VI that the effect of random size crop with a size of 224 x 224 pixels, gaussian blur, and random rotation (45°-270°), did not significantly increase the accuracy of the model performance compared to testing without applying data augmentation. The improvement can be seen in Table V and Table VI  The third test also used the new dataset. It can be seen in Table VII that the effect of the grayscale image was not much different from the accuracy results obtained from the first and third tests. The greatest decrease in accuracy is only up to 0.66 % in the patch way in Table V and VII.

IV. CONCLUSION
From the tests that have been carried out, it can be concluded that although the amount of data contained in the dataset is almost the same, the dataset's quality mainly affects the accuracy results that the model produce. It can be seen from the first test that there is an almost far difference in accuracy, which is 22.74 %. This is due to many anomalies in the old dataset. The use of the patching method can increase the accuracy up to 3.63 %. The application of the data augmentation strategy in this research did not significantly affect the accuracy results because there was a decrease of 1.48 %.
We suggest using datasets with the same source to compare with previous studies for further research related to batik. Furthermore, by using the same dataset source, developments such as adding new datasets can be carried out in further research to develop research on batik. In addition, we share the dataset used in this research to help develop batik research which can be downloaded from github.com/Tri334/batik-classification-resnet/.