# GAN-Based Generation of Synthetic Data for Vehicle Driving Events
## 2 Materials and Methods
### Dataset Details  
This section details the tasks that were performed to build the final dataset used in the experiments, starting from the decision on the size of the dataset through the reading of the data from the vehicle sensors to the data preprocessing tasks. To estimate the size of the dataset, we considered datasets used in other studies related to the generation of synthetic data. In the work of [19], 7000 timesteps were used in the authors' proposed artificial data generation model. In [35], the authors used a dataset with 7056 timesteps to compare two data generation models, one based on a GAN and the other of autoregressive type. In [11], a dataset with 3773 stock market records was used. For this work, we built a dataset of 2634 records or timesteps, with each record comprising fifteen attributes or features. The data in the built real dataset were obtained mainly from the data generated by a vehicle driven by the same person traveling a route for about 50 min. The route crosses Sangolqui-Pifo Avenue and then continues along the Alpachaca Corridor until reaching the Mariscal Surec International Airport in the Tababela sector; the map of the route can be seen in Figure 5.  
All of the collected data received the respective authorizations from the data owners for use in this research through their written consent. These data were read from the vehicle and recorded every second by the Car Scanner Pro app installed on an Android smartphone placed inside the vehicle. This app was connected via Bluetooth to an OBD-II dongle connected to the vehicle's OBD-II interface. _On-Board Diagnostics II_ is a vehicle diagnostic system that monitors, among others, the emissions, mileage, speed, and temperature of the car; almost all modern light vehicles of American origin manufactured since 1996 incorporate an OBD-II diagnostic port. The ISO-15765-4:2021 standard specifies the communication requirements between the _Controlled Area Network_ (CAN) and the diagnostic system (OBD-II) of a vehicle. The schematic of the interconnection of these components is shown in Figure 6. Depending on the vehicle's type, equipment, and make, this app can obtain more or less data about the car. In addition to the data read from the vehicle, we used a smartwatch to obtain the driver's biometric data at each instant while driving the car. Data from the external environment were calculated from the _Global Positioning System_ (GPS) location of the vehicle, as well as data from traffic accidents occurring in the vicinity of the sites included along the route traveled by the car. Although there is no single combination of characteristics that identifies driving behavior, most studies include longitudinal speed [36], acceleration, throttle position, and revolutions per minute (RPM) among their selected characteristics [37]. These and other characteristics were included in our study to classify the level of risk of traffic accidents. A general description, together with the measurement units of each column or feature of the constructed dataset, is provided in Table 1. The visual appearance of the signals of each column can be seen in Figure A1 of the Appendix (Dataset Features Signals section). To complement this information about the dataset, Table 2 shows the code used for each dataset feature along with the minimum, maximum, and average values. Figure 5: Map of the trajectory followed by the vehicle. Figure 6: An OBD-II scanner transmits data read from the vehicle via Bluetooth to the Android app. The initially constructed dataset of real observations included the nineteen features shown in the matrix in Figure 7.