# A VR Truck Docking Simulator Platform for Developing Personalized Driver Assistance
## 3 Driver Behaviour Analysis
### Expertise Estimation Using Machine Learning  
As shown in the previous section, there is a strong correlation between the expertise level of a driver and a number of performance indicators. Therefore, a small neural network should be able to estimate the expertise of a complete docking manoeuvre. Here, the question asked was whether such a network can also estimate the driver performance given a much shorter time-window from an ongoing docking manoeuvre. Such a network could then be used to inform a feedback component to provide support within a reasonable timeframe (see Figure 15). Figure 14: The figure shows pronounced differences in (**a**) task duration, (**b**) number of gear shifts, (**c**) vehicle acceleration changes, (**d**) steering wheel movements, (**e**) head yaw-rotation and (**f**) trailer-cabin angular changes for two selected expertise levels (novice and expert). Figure 15: Driver expertise prediction. A neural network estimates the current expertise of the driver. Observable values like the steering wheel angle, the truck velocity and the current gear are aggregated over a sliding window (width = 50 s) and fed into the network. The network output provides an estimation of the current driver expertise within this time frame. To test the idea, a multilayer perceptron was trained on the regression task to estimate the driver's expertise given only the following locally observable values: the steering wheel angle, the cabin-trailer angle, the truck velocity, the current gear, the drivers head yaw-rotation and optionally a list of gazed objects within the time-frame (acquired using eye-tracking, see Section 2.3.5). Locally observable values are comparatively easy to measure, are readily available in real vehicles (e.g., from the CAN-Bus) and do not require external cameras and sophisticated computer vision. Dataset pre-processing: Each stream of local data in the dataset was individually scaled to the range \([-1,1]\), to ease network training. Categorical like the current gear was one-hot encoded or multi-hot encoded (gazed objects from eye-tracking). The values were then down-sampled from 90 to 1 Hz using a block-wise average. It was found that using the block-wise average method gave slightly better results than another down sampling method (two-stage downsampling with an order 8 Chebyshev type I filter, see python package scipy.signal.decimate). An explanation for this might be that the closely related moving average method is optimal for filtering white noise while preserving sharp edges in data streams [31]. Sliding window: A sliding window (width = 50 s) was moved frame-by-frame (1 Hz) over each trial of the down-sampled dataset. The data within each window were either further processed by extracting the performance indicators shown in Section 3.2 and Figure 14, or concatenated into a long input vector for the neural network (\"raw data\" in Figure 16). For example, 150 training samples can be extracted from a 200-s trial. Network layout and training: A small multilayer perceptron with one hidden layer (\(n=5\) neurons, ReLU activation function) and a single, linear output neuron was implemented using Keras, a high-level neural network API for Tensorflow [32]. The single output neuron will provide an expertise rating with the same scale as that used for the self-rating, see Section 3.2. Hence, the network was trained on the regression task of estimating the driver expertise within the sliding-window time-frame. The specific training setup was: Adam Optimizer using gradient clipping (clipnorm = 1.0); a batch size of 25 and a fixed number of 15 epochs. The mean-squared error was used as the loss function. Network evaluation: The performance of a trained network can significantly fluctuate mainly for two reasons: 1. local minima encountered during training (depending on initial weight values) and 2. the specific split of samples into the training- and test-dataset.