# Predictive Analysis of Vehicular Lane Changes: An Integrated LSTM Approach
## 3 Results and Analysis
### Trajectory Prediction  
We now pivot to another crucial aspect: the trajectory prediction. Before model training, both the training and testing sets underwent normalization. Each vehicle's data were transformed into a sequential time series. Subsequently, sequences from all vehicles were amalgamated into a unified set.  
During the training process, the testing set doubles as the validation set. For every epoch, losses for both the training and validation sets are computed. As depicted in Figure 7, there was a noticeable downward trend in the losses. After 100 epochs, the losses stabilized at an acceptable threshold.  
The root mean square error (RMSE) was computed for both the training and testing sets for their respective outputs. Table 9 presents the results for the Simple-LSTM model.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Best Training Set**} & \multicolumn{3}{c}{**Predicted Labels**} & \multicolumn{3}{c}{**Predicted Labels**} \\ \cline{2-7}  & \(-\)**1** & **+1** & & & \(-\)**1** & **+1** \\ \hline True & \(-\)1 & 38,610 & 92 & True & \(-\)1 & 5517 & 9 \\ Labels & +1 & 92 & 8855 & labels & +1 & 8 & 1273 \\ \hline \hline \end{tabular}
\end{table}
Table 8: Confusion matrices of the top-performing MLP model.  
In the training set, the average deviation for the longitudinal position of the trajectory was 18.653 ft, while the lateral position averaged a deviation of 1.725 ft. In contrast, the testing set displayed a longitudinal deviation of 16.658 ft and a lateral deviation of 1.614 ft for the trajectory.  
\begin{table}
\begin{tabular}{c c c} \hline \hline  & **Training Set RMSE (ft)** & **Testing Set RMSE (ft)** \\ \hline \(y\) & 18.653 & 16.658 \\ \(x\) & 1.725 & 1.614 \\ \hline \hline \end{tabular}
\end{table}
Table 9: Results for Simple-LSTM.  
Figure 6: Maneuver classification results.  
Figure 7: Training loss and validation loss vs. epoch.  
Considering that the standard width of a highway lane is approximately 12 ft, the deviations observed in the testing set are relatively more acceptable. The discrepancies in the training set's errors are notably greater than those in the testing set. Ideally, the error margins between the two datasets should be similar. Further validation and analytical exploration are warranted to enhance the model's performance.  
Regarding the graphical representation, the \(y\) axis denotes the longitudinal position, while the \(x\) axis represents the lateral position. The blue line traces the actual trajectory, and the red line depicts the predicted trajectory, which aligns well with the actual data.  
Tables 10 and 11 present the results of the two distinct models.  
When contrasting the two models, the LK-LSTM model demonstrated lower errors in both positions on the testing set compared with the LC-LSTM model. However, the LK-LSTM model exhibited higher errors in both positions on the training set than the LC-LSTM model. Overall, the performances of the two models are comparable. It is worth noting that lane changing typically occurs over a few seconds; hence, the data available for the LC-LSTM model may be limited. Gathering more lane-changing data could contribute to the development of a more accurate and robust model.  
In relation to the Simple-LSTM model, the errors in the two specific models (LK-LSTM and LC-LSTM) were diminished. This enhancement in performance underscores the value of employing specialized models tailored to specific datasets.