CLASSIFICATION OF TILES USING CONVOLUTIONAL NEURAL NETWORK

Tiles are one of the building materials with various types that can make a residence more elegant, attractive, and colorful. However, not all people know about the types of tiles and their advantages. Therefore, a Convolutional Neural Networks (CNN) based method is proposed to make it easier for people to accurately recognize tiles based on their types and know their advantages. The purpose of this paper is to classify the types of tiles using CNN which is based on VGG16 model. The proposed method classifies tiles into 6 classes, namely granite, limestone, marble, motifs, mosaics, and terrazzo. This research uses 186 training data, 96 validation data and 60 test data with image resolution of 224x224. Based on the experiments, the training process produces 100% of training accuracy and 94% of validation accuracy. The testing process achieves 98.33% accuracy which can be concluded that the proposed CNN model able to classify the types of tiles well .


INTRODUCTION
Tiles are craft objects made of non-metallic elements that have undergone a heating process in their manufacture. The process of manufacturing, for example ceramic tile consists of several steps namely clay preparation, molding, glaze preparation, drying, glazing and decorate the tile, kiln firing, and quality classification [1]. Selection of the tiles is in accordance with the needs of the buildings. The process of selecting tiles usually based on the shape, size, and color of the tiles. This study aims to determine the type of tiles based on the images provided by the user. Current technological developments can be applied to solve the tile classification problem. Using computer vision approach, the first step of the procedure is to take pictures of tiles with a camera. The images will be classified using Convolutional Neural Networks (CNN) to recognize the type of tiles [2]. CNN was used because several recent studies on computer vision task that use CNN have obtained good results, namely research that classify vehicle types [3], batik patterns [4], face [5], leather types [6][7] and so on [8] [9]. This research was conducted because there are many types of tiles so not all people know about the types of tiles and their advantages. There are several types of tiles such as ceramic, natural granite, marble, mosaic, porcelain, glass, cement, limestone, and others with different advantages [10]. However, in this study only 6 types of tiles were used, namely terrazzo, limestone, natural granite, motif, mosaic, and marble because these types of tiles are popular and widely used in general. In this study, VGG16-based CNN model is implemented, namely, to classify the types of tiles. CNN method is very good at finding good features in the next layered image to form a non-linear hypothesis and can increase the complexity of a model [11]. Accuracy results in image classification using CNN are mostly better than the other traditional methods such as K-Nearest Neighbor, Support Vector Machine and others [12][13] [14].

Convolutional Neural Network (CNN)
Convolutional Neural Network is a branch of deep learning that carry out direct classification learning on two-dimensional models such as images [15]. CNN is very good when used to find patterns in an image then recognize the object in the image. CNN consists of two stages, namely feature learning and classification [16]. Feature learning is the stage where the features of input image are extracted to learn the value/pattern of the image [17]. At this feature learning stage, it is very dependent on the depth of the convolutional layers, the deeper the convolutional layer, the more extraction results are obtained so that the pattern is clearer [18]. This value will be converted into a vector and used in the classification stage. In the classification stage, some fully connected layers will be used to classify the features into several classes [19]. Fig. 1 shows the Convolutional Neural Network architecture that divided into two stages. The feature learning stage in general has three layers namely convolution layer, activation, and pooling layer. The sequence of these three layers does not always have to be the same, in the sense that the process can be modified as needed. However, in general, the feature learning process begins with a convolution process between the input matrix and the kernel at a certain size. The classification layers usually consist of several fully connected layers with the last layer serves as the predictor.

The Proposed Method
The proposed method uses VGG16 [21] as the model in the feature extraction stage and add some fully connected layers to classify the features into 6 types of tiles. Fig. 2 shows the procedure of the proposed method where the blue lines indicate the training steps, and the orange lines indicate the test steps. The output is category label that represent the type of tiles.  Based on Fig. 2, the tile images dataset is collected then proceed to the preprocessing step, by cropping the image to get the ROI of tiles object which aims to speed up the computational process. The image data then divided into training data and test data. Training data will become the input in the training step and test data will become the input in the testing step. In the training step, the training data will be split further to generate validation data to assist in the training process. Next is the augmentation step which aims to improve images in the training data in order to get high accuracy results. The proposed model is built using VGG16 model as the feature extractor and fully connected layers as the classifier. The VGG16 architecture is shown in Fig. 3. The VGG16 model will be trained from scratch without using the pre-trained weights from ImageNet [23]. After performing average pooling in the last convolutional layer of VGG16, three fully connected layers are used to classify the features into 6 types of tiles. The architecture of the proposed method is shown in Fig. 4.

RESULT AND DISCUSSIONS
The proposed method is built using Python, running on Google Collab notebooks with additional TensorFlow, OpenCV, and Scikit-learn library. The VGG16 and other models used in this research are taken from the built-in models provided by TensorFlow library [24].

Dataset
The specification of tiles dataset that used in this research is shown in Table 1. Based on Table 1, there are 6 types of tiles namely granite, limestone, marble, motifs, mosaics, and terrazzo. Each category consists of 57 images and the total is 342 images. The tile images are collected from the internet and taken directly from the local tile shops. Tiles dataset is divided into three namely training data, validation data and test data with each of them consists of 186, 96, and 60 images respectively. The images are resized into 224x224 before trained by the model. Data augmentation is performed to enrich the training data by flipping horizontal, rotation in range of 90 degrees, shear by factor 0.2, and scaling by factor 0.2.

Training Results
Before conducting the training process, some hyperparameters need to be configured. The model is trained using Adam optimizer with 0.0001 learning rate and runs in 100 epochs. Fig. 5 shows the result of training process namely accuracy and loss of training data (orange lines) and validation data (blue lines). Accuracy is the value used to determine the level of success of the model that has been made while loss is a measure of the error that has been made with the aim of minimizing it. Based on Fig. 5, the accuracy of the training data reached 100% with 0.0049 of loss while the accuracy of validation data reached 94%.
(a) Accuracy measurement (b) Loss measurement Fig. 5. Accuracy and loss of training data (orange) and validation data (blue).
As the model performed well in validation data, we tested the model on the test data to measure the accuracy of the trained model. The test data consists of 60 images with 10 images for each tile category namely granite, limestone, marble, motifs, mosaics, and terrazzo. Table 2 shows the confusion matrix of prediction results in test data. Based on Table 2, there is only one false positive where a marble is classified as limestone. The model achieves 98.33% of accuracy according to the confusion matrix in Table 2.  We also perform training and test for several models to compare the proposed CNN which based on VGG16 model with the other CNN models namely ResNet50 [25], InceptionV3 [26], InceptionResNetV2 [27], and MobileNetV2 [28] that provided by TensorFlow library [24]. The other models also used as the feature extractor with the same hyperparameters configuration. purpose of this experiment is to know which model produces the best accuracy. The performance evaluation result is shown in Table 3 (we round up the accuracy score). Based on Table 3, although InceptionV3 achieves the highest accuracy on validation data which is 98% but the performance on the test data only achieves 25%. Meanwhile, the proposed VGG16-based CNN model only achieves 94% accuracy on validation data but achieves the highest accuracy on test data which is 98% compared with the other models. Therefore, the performance of the proposed CNN method is superior than the other models in this dataset. Based on the classification result, we can get the usage and the advantages of the corresponding tile from the database to show the detail information to the user.

CONCLUSIONS
The proposed VGG16-based CNN model in this study shows a good performance in classifying 6 types of tiles namely granite, limestone, marble, motifs, mosaics, and terrazzo tiles. The best accuracy result produces by the proposed VGG16-based CNN model where in the training process achieves 100%, in the validation process achieves 94% and, in the testing, process achieves 98.33%. From the experiment results, it can be concluded that the application of deep learning using the Convolutional Neural Networks can classify tiles well. The classification result then can be used to get the usage and advantages of the corresponding tiles from the database and shows the detail information to the user. In the future research, it is expected to expand the classification for more types of tiles.