# A Road Defect Detection System Using Smartphones
## 3 A Proposed Road Defect Detection System
### A Road Defect Detection with 1D-Cnn

Table 7: Average accuracy according to the placement of the smartphone in the vehicle. Figure 7: Accuracy confusion matrix for each model: (**a**) SVM confusion matrix, (**b**) Random Forest confusion matrix, (**c**) LSTM confusion matrix, and (**d**) RDD-CNN confusion matrix. The models of road defect detection under comparison include SVM, Random Forest [46], Long Short-Term Memory (LSTM), and our proposed RDD-CNN, each utilized for estimating road defect conditions. SVM is a supervised learning algorithm widely employed for both classification and regression challenges. It aims to identify a hyperplane that maximizes the margin between different classes, with the margin defined as the distance between the nearest data points of any class (known as support vectors) and the hyperplane itself. The training process for SVM involves solving a quadratic optimization problem subject to boundary constraints and a linear equation constraint. However, traditional optimization methods for such problems are often deemed impractical due to the extensive memory and time they require [47]. Random Forest, on the other hand, is an ensemble learning technique applicable to both classification and regression tasks. It operates by constructing multiple decision trees during the training process and merging their outcomes to produce more accurate and robust predictions. This method effectively mitigates the risk of overfitting and is suitable for diverse datasets. The strategy of integrating predictions from several decision trees, particularly when the number of variables significantly surpasses the number of observations, has been acknowledged for its efficacy. Random Forest is also scalable, making it appropriate for large-scale problem-solving scenarios [48]. These established methods, along with LSTM--a neural network designed for processing sequences and temporal patterns--provide a comprehensive backdrop against which the performance of the proposed RDD-CNN model is assessed. The comparison aims to highlight the strengths and potential of RDD-CNN in accurately detecting road defects using data derived from the Automatic Data Collection System. Table 8 presents the specific parameter values utilized for each model in the detection of road defects. Figure 8 illustrates the accuracy of artificial intelligence models utilized in research for detecting road defects. Deep learning models such as LSTM and CNN demonstrated relatively higher accuracy compared to traditional machine learning models like SVM and RF. This superiority of deep learning models can be attributed to their ability to learn high-level abstract features from data, enabling them to understand complex patterns and relationships. In contrast, traditional machine learning methods rely on predefined features, mostly designed manually, which may not capture the complexity present in large datasets as effectively as the features learned automatically by deep learning models. Most existing studies on road defect detection classify accelerometer data to identify road defects. While LSTM is adept at modeling temporal sequences and dependencies in time-series data, CNNs can be more efficient when the data length is short or the patterns are relatively simple. Therefore, in classifying defects through accelerometer data input, CNNs offer advantages, which is why RDD-CNN shows higher accuracy. This paper aims to detect road defects using smartphones, making it crucial to maintain high detection accuracy while reducing the load on smartphones. To achieve this, we performed quantization to lighten the model, reducing its size by an average of 59.11%. Figure 9 presents the average time required by each model to evaluate 1-min test data using the sliding window algorithm and the size of each model. The proposed sliding window algorithm reduces the number of tests when road defects are present in the test data and increases the number of tests when there are no road defects. Through experiments with