# A Road Defect Detection System Using Smartphones
## 3 A Proposed Road Defect Detection System
### A Road Defect Detection with 1D-Cnn
This algorithm is designed to capture and analyze sequential patterns in the data, recognizing the inherent connectivity between each data point and its predecessors. The sliding window, set to a duration of 3 s, advances in increments of 0.1 s across the dataset. Within each window, the acceleration data are processed by the RDD-CNN to determine if it corresponds to one of the three targeted road defects. Upon successful classification, the algorithm adjusts such that the ending point of the current window becomes the starting point for the subsequent window. This approach allows for the continuous and dynamic analysis of sensor data, enabling the RDD-CNN to effectively distinguish between different road defects based on the characteristics of the recorded acceleration patterns. ```

**Algorithm 1** Sliding window algorithm. To operate the RDD-CNN model on smartphones, the model should be lightweight and suitable for the computational constraints of mobile devices. To this end, among various strategies for model optimization, we employ bit quantization as a method to reduce the model's computational footprint. Specifically, we convert 32-bit floating-point numbers to 16-bit integers, a process known as quantization. Quantization significantly enhances the computational efficiency of CNN by accelerating processing speed and diminishing memory requirements [44]. This method is applied to the weight matrices of both the convolution layer filters and the fully connected layers, aiming to retain the model's accuracy by minimizing the response error associated with the reduction in numerical precision. The implementation of this quantization technique enables the operation of the RDD-CNN model on smartphones, thereby facilitating real-time road defect detection directly from a user's mobile device. Figure 3: Structure of RDD-CNN model. ## 4 Experimental Results

### Experiment Setup

In this study, three Android smartphones--the Samsung Galaxy Note8, Xiaomi Redmi Note 10 Pro, and LG Q7--were used to collect raw accelerometer data. The accelerometer data are saved in an Excel file comprising multiple columns, including timestamp, accelerometer X-axis, accelerometer Y-axis, accelerometer Z-axis, and calculated RMS of the accelerometer. Samsung Galaxy Note 8 CPU is Octa-core (4 \(\times\) 2.3 GHz Mongoose M2 and 4 \(\times\) 1.7 GHz Cortex-A53)--EMEA, GPU uses Adreno 504. The CPU of the Xiaomi Redmi Note 10 Pro uses Octa-core (2 \(\times\) 2.3 GHz Kryo 470 Gold and 6 \(\times\) 1.8 GHz Kryo 470 Silver), and the GPU uses Adreno 618. The LG Q7 CPU uses an ARM Cortex-A53 Octa-Core 1.8 GHz CPU, and the GPU uses an Adreno 506 400 MHz GPU. To collect raw video data, an INAVI QHD5000 dashcam equipped with a 5.14 M Pixels, 1/2.8\" (CMOS) sensor on both front and rear cameras is utilized, enabling the storage of video at a resolution of 2560 \(\times\) 1440 and a frame rate of 30 frames per second. The video files are saved as mp4 files, incorporating the recording timestamp. We collect these raw data using two vehicles equipped with these devices: a YF Sonata and a Kia All New Sportage. The YF Sonata is a sedan, and the Kia All-New Sportage is an SUV. The criteria for choosing a data collection site were based on a high number of road defects and the safety of experiments. In Cheongju, South Korea, near Chungbuk National University, we conducted a total of 20 h of driving covering 300 km to collect raw data for training deep learning models, as illustrated in Figure 4a. Moreover, for model testing purposes, we gathered additional raw data through 8 h of driving, covering 120 km in the vicinity of Gakyung Middle School and Seonghwa-dong, Cheongju, South Korea, as depicted in Figure 4b,\(c\). In the data preprocessing step, we utilized a Linux environment and Python version 3.8.10. The threshold is set to 12 m/s\({}^{2}\) for the threshold-based data classification. The slicing length is set to 3 s for the data slicing.