# A Multimodal Recurrent Model for Driver Distraction Detection
## 2 Materials and Methods
### Exploratory Data Analysis  
An exploratory data analysis (EDA) was performed to investigate the properties and characteristics of the preprocessed dataset. The dataset consists of one data frame, where each time point of a recording corresponds to a row, and another data frame containing sequential data derived from the first one. The following analysis focuses on the first data frame, which summarizes key statistical metrics for the sensor features, as shown in Table 1.  
The dataset contains 251,271 samples after filtering out invalid data, where each sample consists of a camera image and a vector of numerical sensor data. The features of the data frame include IMU data (e.g., accelerations and angular velocities) and OBD2 sensor data (e.g., vehicle speed and engine parameters). The correlation analysis, visualized in Figure 1, identified a strong positive correlation coefficient (0.93) between _acc_pedal_position_ and _engine_load_, leading to the exclusion of the _engine_load_ feature from further analysis.  
The class distribution across drivers, shown in Figure 2, reveals an unbalanced dataset, with the largest class being _normal_driving_ (176,927 samples) and the smallest is _reaching_behind_ (7576 samples). This imbalance can adversely affect the training of machine learning models, requiring the use of countermeasures that will be presented later.  
\begin{table}
\begin{tabular}{l c c c c c c} \hline \hline
**Feature** & **Unit** & **Mean** & **Std** & **Min** & **Max** & **Median** \\ \hline acc\_x & m/s\({}^{2}\) & 0.05 & 0.95 & \(-\)6.20 & 8.21 & 0.01 \\ acc\_y & m/s\({}^{2}\) & 0.04 & 0.79 & \(-\)3.71 & 7.42 & \(-\)0.08 \\ acc\_z & m/s\({}^{2}\) & 0.12 & 0.70 & \(-\)5.53 & 8.18 & 0.10 \\ rot\_x & rad/s & 0.03 & 0.08 & \(-\)0.66 & 0.59 & 0.01 \\ rot\_y & rad/s & 0.00 & 0.16 & \(-\)2.11 & 2.26 & 0.00 \\ rot\_z & rad/s & 0.00 & 0.38 & \(-\)6.06 & 5.33 & 0.00 \\ speed & km/h & 56.13 & 16.85 & 0.00 & 111.00 & 56.00 \\ acc\_pedal\_position & \% & 24.12 & 8.26 & 15.00 & 74.00 & 24.00 \\ throttle & \% & 62.64 & 27.77 & 14.00 & 89.00 & 84.00 \\ engine\_coolant\_temp & \({}^{\circ}\)C & 84.18 & 8.16 & 42.00 & 92.00 & 87.00 \\ engine\_load & \% & 39.60 & 35.01 & 0.00 & 100.00 & 39.00 \\ engine\_speed & rpm & 1452.67 & 286.32 & 0.00 & 3677.00 & 1418.50 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Statistical metrics of numerical features.  
Figure 1: Visualization of a correlation matrix heatmap of the numerical features.  
Distraction durations varied significantly across tasks, as shown in the boxplots in Figure 3. The longest average distraction was _drinking_ (15.9 s), while the shortest was _other_ (1.98 s). The interquartile ranges indicate that _drinking_ and _infotainment_ have the greatest variability in duration, while _reaching_behind_ has more consistent durations.  
Additional plots providing further insights into the distribution of distraction durations are included in Appendix A.  
Figure 3: Boxplots with the durations of distracting activities.  
Figure 2: Visualization of the class distribution of the dataset among the drivers.