Machine Vision for the Various Road Surface Type Classification Based on Texture Feature

The mechanized ability to specify the way surface type is a piece of key enlightenment for autonomous transportation machine navigation like wheelchairs and smart cars. In the present work, the extracted features from the object are getting based on structure and surface evidence using Gray Level Co-occurrence Matrix (GLCM). Furthermore, K-Nearest Neighbor (K-NN) Classifier was built to classify the road surface image into three classes, asphalt, gravel, and pavement. A comparison of KNN and Naïve Bayes (NB) was used in present study. We have constructed a road image dataset of 450 samples from real-world road images in the asphalt, gravel, and pavement. Experiment result that the classification accuracy using the K-NN classifier is 78%, which is better as compared to Naïve Bayes classifier which has a classification accuracy of 72%. The paving class has the smallest accuracy in both classifier methods. The two classifiers have nearly the same computing time, 3.459 seconds for the KNN Classifier and 3.464 seconds for the Naive Bayes Classifier.


I. Introduction
For now, several studies about the use of machine learning are very useful in developing the automotive industry [1], [2], and this fact shows that the development of the automotive industry does not always depend on the field of mechanical engineering i.e. fuel and engine performance [3][4][5], but also on the field of machine learning of computer vision. Through computer vision, a machine vision is created to detect the way surface object, which is the crucial piece of information for automated machine technologies users [6]. Determination of road surface type is crucial, especially to develop security aspects for transportation users and minimize congestion and accidents [7]. Image classification is one way that can be used to solve problems that have the potential to arise in automatic driving technologies. Information about the feature texture of road surface types is one part of image classification that can be applied to analyze the type of road surface [8], [9]. However, these different road models have the potential to cause problem, therefore, a better and more accurate method is needed to classify road surface conditions [10]. Some researchers use the GLCM classification method for describing texture details into spatial domain and edge images [9], [11]. Moreover, GLCM is also used to detect rock images in the road type classification based on visual data, the GLCM method is also used to characterize way surfaces by several aspects such as texture [12], color [13], and border features of riders' sight image to coach a neural network of objects. In addition to GLCM, there is also the use of several classification methods such as convolutional neural networks [14] and support vector machine [15] to detect, but, the accuracy was low [16] and the sample size is too small with an accuracy below 60% [8]. Furthermore, other classifiers have also been used, such as K-NN [9], [17] and NB [18], [19]. However, the use of this classification method only focuses on determining the location, classifying images, and combining the K-NN [20] and NB methods to characterize numeral and total attributes [21].
Based on the brief description above, it can be seen that the use of classification methods to detect and provide detailed information on an object is very important. But with the low accuracy of results and a small number of samples, not much scientific information has been revealed. The application for detecting road surface types has not even been seen yet based on feature textures. Therefore, further research on this matter is needed to produce scientific information about the detection of three road types (asphalt, gravel, and pavement) based on feature texture using the GLCM, KNN and NB methods. Figure 1 and Figure 3 shows a sample image of each class from the dataset. The dataset was constructed from 90 road images with good illumination from google Street View and divided into 3 classes and each object is 30 pieces. Furthermore, we extract 50 x 50 part-images from the obtained images to create our set of data (see Figure 2). In total of data collection, there are 450 road surface images, 300 for practice and 150 for verifying.

B. GLCM Texture Features
GLCM is an approach for extracting texture features from an image. GLCM identifies the relationship between 2 neighboring pixels. Each pixel has a gray level, distance, and angle attribute. This study uses a gray level range of 0-255, the distance in GLCM is calculated by the number of pixels between the reference pixel and neighboring pixels, and 8 angles can be used in GLCM, including angles 0°, 45°, 90°, 135°, 180°, 225°, 270°, or 315°. This study uses 4 angles, namely 0°, 45°, 90°, and 135°, because the GLCM value at an angle of 0° is equal to a value of 180°, as well as the values of 45°, 90°, and 135° are equal to 225°, 270°, and 315°. Furthermore, the GLCM technique begins with the creation of a matrix with sizes according to the range of gray levels. The second step is to create a co-occurrence matrix, which means filling the matrix with several pixel pairs for a certain brightness level, with a certain combination of distance and angle. The third step is to create a symmetric matrix by adding the co-occurrence matrix to the transpose matrix. Finally, normalize the value of the co-occurrence matrix by dividing each matrix element by the sum of all the matrix element values. The texture features of an image are obtained by calculating the second-order statistical features [22]. Furthermore, several attributes are used to shorten computation time i.e. Angular Second-Moment (ASM), entropy, contrast, and correlation. The Angular Second-Moment (ASM) feature is a measure of image homogeneity. The entropy feature is a measure of gray-level irregularities in the image. High value if GLCM elements have relatively equal value and low value if GLCM elements close to zero or one.

C. Classification of Road Surface Types Image
Furthermore, to classify the type of road surface, two methods are used, namely KNN and NB. KNN classifier is a supervised machine-learning algorithm that can be used to solve classification and uses 'similarity measure' for an estimate and compare the identical values of the actual data with the data in the training set.
However, KNN has four-step i.e. (1) load the data training and test data; (2) select the k value; (3) compute the distance between test data. Furthermore, every line of training data with the Euclidean distance is based on the distance value, and sort them in ascending order. (4) Choose the top k rows from the selected range and specify a class to the test point based on the majority class of these lines. On the other hand, the NB classifier is an approach method for achieving the best prediction and increasing accuracy levels.

III. Results and Discussions
This study uses achievement measurements of Confusion Matrix. The confusion matrix consists of four basic characteristics (value) that are used to define the measurement metrics of the classifier. These four values are recall, precision, F-measure, and accuracy [23]. An example of a confusion matrix is shown in Table 1  Percentage of related sides that are properly intelligible Recall. The predicted proportion of interrelated sheets thus precision occurs. F-Measure comes from precision and recall amount. The part of the total sum of the true forecast is called Accuracy. The equation we are considering is: The road image dataset (see Figure 3) consists of 450 images which are divided into 300 training images (100 objects per grade) and a test set of 150 (50 objects per grade). The GLCM program is well-used to select texture features (entropy, contrast, correlation, and ASM) from each image data.
The features of each image are stored in a vector, and these features are inputs for the KNN Classifier and Naïve Bayes Classifier. Figure 5 showed the system of the block diagram. Furthermore, the early examination is to complete the value of k with the top categorization, and the output on several k values (see Fig. 6). Moreover, the results show that the k=2 gives the best performance with an accuracy of about 78%. We use this accuracy to compare Naïve Bayes Classifiers. This phenomenon indicates that the classification method used gives positive results and has the opportunity to be used in identifying road surfaces. This analysis is very possible because it is in alignment with the results of previous studies [19]. Furthermore, with an accuracy above 70%, it has the potential to improve automatic driving technologies, which are beneficial in reducing congestion and accidents. This finding is very important because it provides additional scientific information on the impact received by a car or driver as a result of vibrations [24], [25] caused by changes in the road surface. The confusion matrix and the performance measurements result for KNN Classifier with k value is 2 (see Table 2), and Naïve Bayes Classifier are shown in Table 3. The result indicates that the KNN Classifier have the best performance on Asphalt Class and Naïve Bayes Classifier has the best performance on Gravel Class. In final, the KNN classifier produces better accuracy around 78% than the Naïve Bayes classifier around 72%. This result is following previous research regarding road surface conditions, which were discussed with a different perspective [6], [23], where they stated that the KNN classifier is ISSN 2580-0817 Vol. 6, No. 1, July 2022, pp. 40-47 more recommended for detecting slippery road surface conditions during the rainy season because it is able to produce a better level of accuracy than the Naïve Bayes classifier.
Furthermore, we tested the classification ten times with the same type of data (training and test). The computational time of the KNN classifier and the Naive Bayes Classifier, tend to be the same, and the average computation time of KNN is 3.459 seconds and Naive Bayes is 3.464 seconds with a standard deviation of about 1.4.

IV. Conclusions
In this study, we proposed the feature from texture information and used KNN Classifier to classify road surface types such as asphalt, gravel, and pavement. The KNN Classifier with a k value is 2 has the best performance with an accuracy of 78% and the gravel class has the highest accuracy. As a comparison, the same dataset is classified using Naive Bayes Classifier and yields an accuracy of 72% and the gravel class has the highest accuracy. The paving class has the smallest accuracy in both classifier methods. The two classifiers have nearly the same computing time, 3.459 seconds for the KNN Classifier and 3.464 seconds for the Naive Bayes Classifier. Furthermore, to get comprehensive scientific information about road surface detection and classification, thus future studies can use features of colour and texture for improved accuracy results up to 80% and even 90%, and besides that, they can use or compare with other classifiers.