# The Detection of Aggressive Driving Patterns in Two-Wheeled Vehicles Using Sensor-Based Approaches
## 3 Research Methodology
### Rapid Lane Change  
Rapid lane changes exhibit a back-and-forth pattern due to the nature of vehicle movement [16], for instance, rapidly changing from a left turn to a right turn within a short time. Figure 4 illustrates the staged rapid lane changes, with gray segments indicating the rapid lane-change periods. It is noticeable that the z-axis gyroscope value oscillates around 0 during rapid lane-change segments. However, there are many cases where the z-axis gyroscope value oscillates but does not correspond to a rapid lane change, and the acceleration value is inconsistent. This indicates the difficulty of establishing a straightforward definition for rapid lane changes due to their complex and non-linear nature. Moreover, rapid lane changes tend to oscillate rapidly from left to right in a short period, making it challenging to define solely based on observation. For these reasons, the classification of rapid lane changes was conducted, as shown in Figure 5. First, with the input unit in Figure 5, the data processing phase was initiated, which involved transforming the multivariate time-series data--consisting of speed, angular velocity, acceleration, and coordinate information--through feature engineering. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Stage** & **Time** & **Max. Gyro-Z 1** & **Max. Acc-Y 2** & **Max. Acc-Z 3** \\ \hline Rapid Turn (S1) & 1 (s) & 30–50 (deg/s) & 0–5 (m/s2) & - \\ Rapid Turn (S2) & 1 (s) & 50–70 (deg/s) & 5–10 (m/s2) & - \\ Rapid Turn (S3) & 1 (s) & 70–90 (deg/s) & 10–15 (m/s2) & 10–12.5 (m/s2) \\ Rapid Turn (S4) & 1 (s) & 90– (deg/s) & 15– (m/s2) & 12.5– (m/s2) \\ \hline \hline \end{tabular}  
* Max z-axis angular velocity under 1 (s). 2 Max y-axis acceleration values under 1 (s). 3 Max z-axis acceleration values under 1 (s). 3 Max z-axis acceleration values under 1 (s).  
\end{table} 
Table 1: Table for rapid turn criteria. S1 to S4 are rapid stages. Figure 4: Inertial sensing data used for rapid lane-change detection. Data obtained from Carla simulator, and (**a–d**) are the stages (1–4) of rapid lane change defined in the survey, respectively. The gray section is judged to be a rapid lane change in the survey. The features from the raw data and the results of feature engineering are presented in Table 2. Due to the temporal nature of time-series data, data augmentation is critically important [17]. In this study, techniques such as flipping and window cropping were utilized. Flipping involves horizontally flipping the given time-series data, while window cropping entails extracting portions from specific time intervals and inserting them randomly. For window cropping, a window of 2 s was set in consideration of the characteristics of rapid lane changes. Since the processed data originated from data acquired through surveys, datasets were available for each stage of rapid lane changes. Consequently, when splitting into training and testing datasets, care was taken to ensure that specific classes were not concentrated within certain time periods. The data split ratios for training, testing, and validation were configured as follows: for Stage 1, it was set to 6:2:2; for Stage 2, it was set to 7:1.5:1.5; for Stage 3, it was set to 7:1.5:1.5; and for Stage 4, it was configured as 8:1:1. After segregating the data into stage-specific rapid lane-change datasets, they were consolidated, completing the data preprocessing phase. The processed data underwent normalization, followed by feature selection (feature selection in Figure 5). In this study, feature selection was performed using the feature importance provided by XGBoost. The top 10 features were extracted and can be found in Table 3.  
on both the training and validation datasets, we determined that the training proceeded successfully. The overall accuracy for the classification of rapid lane changes is 95%, and the average precision, recall, and f1-score for normal driving and stage-specific rapid lane changes are 0.926, 0.886, and 0.904, respectively.