# Road Event Detection and Classification Algorithm Using Vibration and Acceleration Data
## 5 Dataset Description  
The dataset used in this study was collected using an instrumented vehicle, which traveled along two distinct routes in San Andres Cholula, Puebla, Mexico. These routes were specifically chosen to capture the variability in road conditions, traffic density, and urban infrastructure.  
The data collection process was designed to ensure high-quality recordings, minimizing external interference. The vehicle was equipped with an AQ-1 OBDII Data Logger, a high-precision data acquisition device capable of capturing real-time vehicle dynamics.  
This device recorded triaxial acceleration and vibration data, securely mounted to minimize external disturbances. The sensor operated at a sampling rate of up to 1000 hz per channel, capturing high-frequency signals to detect subtle road anomalies. Data recording was carried out under controlled conditions to prevent variations due to misalignment of the sensor or environmental factors.  
The data were recorded in JSON format and include the following attributes:  
* Geographic coordinates: longitude and latitude.
* Vibration data: measurements along the X, Y, and Z axes (vibration_x, vibration_y, vibration_z).
* Acceleration data: measurements along the X, Y, and Z axes (acceleration_x, acceleration_y, acceleration_z).
* Event description: Labels indicating the type of event detected, including the following categories: \"No events detected\", \"Speed bump detected\", \"Sudden braking detected\", and \"pothole detected\".  
The first dataset, dataset1, represents a 6.8 km trajectory that was carried out within the metropolitan area of Puebla City, Mexico. This urban route includes various types of roads, traffic conditions, and infrastructure elements such as speed bumps, intersections, and pedestrian crossings. The second dataset, dataset2, covers a 5.4 km trajectory on the outskirts of Puebla City, characterized by urban road conditions. This route provides complementary scenarios, including unpaved roads and lesser traffic density, allowing for a broader spectrum of event detection challenges.  
To ensure event reliability, the labeling process combined automatic detection thresholds and manual validation. Sudden braking events were identified when the deceleration exceeded a predefined threshold of m/s2. Speed bumps and potholes were annotated on the basis of road surveys and validated using field inspections. The final dataset was reviewed to ensure consistency and minimize misclassifications.  
To visualize the covered routes, Figure 2 shows the trajectories recorded by the vehicle during data collection.  
Figure 2: _Cont._  
Both datasets are provided as supplemental files attached to this manuscript to support reproducibility and allow further research by the community. These supplementary files include labeled JSON data. The collection of these datasets ensures diversity in the recorded events and scenarios, which is crucial to train and evaluate classification algorithms under various conditions.  
For all experiments, we tested our algorithm on an MSI Raider GE76 12U laptop equipped with an Intel Core i7-12700H CPU. All experiments were performed in MATLAB 2022a, providing a stable and efficient platform for model training and evaluation. The configuration of the system allowed us to handle large datasets efficiently and perform extensive hyperparameter tuning, ensuring that the Random Forest model could be trained and tested in a reasonable amount of time.