# A CNN-LSTM-Attention Model for Near-Crash Event Identification on Mountainous Roads
## 5 Results
### Evaluation of Model Performance
#### 5.2.2 Experimental Results  
To evaluate the performance of the proposed CNN-LSTM-Attention model, the model is benchmarked against various models, including CNN, LSTM, Attention, CNN-LSTM, CNN-Attention, and LSTM-Attention. The parameter settings of the models are detailed in Table 3. The number of model parameters in Table 3 is output by the TensorFlow. Keras used in the study. For the sake of space, only the structure of the proposed CNN-LSTM-Attention model is provided in Table 4. Figure 10 shows the performance of each model on the validation set, where it is observed that the proposed CNN-LSTM-Attention model outperforms the other models in terms of accuracy and loss. The ROC curves for all models are shown in Figure 11. It indicates that the AUC value of the CNN-LSTM-Attention model is higher than that of the other models, demonstrating the highest overall prediction accuracy. To further evaluate the performance of the proposed model in the classification tasks of normal events and near-crash events, we use confusion matrices to compare the classification results of the CNN-LSTM-Attention model and other comparison models. \begin{table}
\begin{tabular}{c c} \hline \hline
**Layer** & **Output Shape** \\ \hline Input layer & (height, width, channels) = (200, 5, 1) \\ Convolutional layer (with Relu) & (height, width, channels) = (200, 5, 64) \\ Maxpooling layer & (height, width, channels) = (100, 2, 64) \\ Convolutional layer (with Relu) & (height, width, channels) = (100, 2, 64) \\ Maxpooling layer & (height, width, channels) = (50, 1, 64) \\ Reshape layer & (length, number of features) = (50, 64) \\ LSTM layer & (length, number of hidden units) = (50, 64) \\ LSTM layer & (length, number of hidden units) = (50, 64) \\ LSTM layer & (length, number of hidden units) = (50, 64) \\ Attention layer & (length, number of hidden units) = (50, 64) \\ Global Average Pooling layer & (length, number of hidden units) = (64) \\ Dense layer (with Relu) & (number of units) = (256) \\ Dropout layer & (number of units) = (256) \\ Dense layer (with Sigmoid) & (number of units) = (1) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Structure of CNN-LSTM-Attention model. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Model Parameters** & **Number of CNN Layers** & **Number of Filters** & **Width of Convolution Kernel** & **Number of LSTM Layers** & **Number of Units** & **Attention Layers** & **Number of Model Parameters** \\ \hline CNN & 2 & 64 & 3 & 0 & 0 & 0 & 54,465 \\ LSTM & 0 & 0 & 0 & 3 & 32 & 0 & 100,865 \\ CNN-LSTM & 2 & 64 & 3 & 3 & 32 & 0 & 153,537 \\ Attention & 0 & 0 & 0 & 0 & 0 & 1 & 1913 \\ CNN-Attention & 2 & 64 & 3 & 0 & 0 & 1 & 120,833 \\ LSTM-Attention & 0 & 0 & 0 & 3 & 32 & 1 & 117,505 \\ CNN-LSTM-Attention & 2 & 64 & 3 & 3 & 32 & 1 & 170,177 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Model parameters. Table 5 shows the performance of each model in identifying normal events and near-crash events. The four columns of data in the table represent the number of correctly and incorrectly identified normal events, as well as the number of incorrectly and correctly identified near-crash events. It can be observed that the CNN model performs well in identifying normal events but poorly in identifying near-crash events, with 38 normal events being incorrectly identified  
Figure 11: ROC curves of various models. Figure 10: Accuracy and loss of each model on the validation datasets. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Model**} & \multicolumn{4}{c}{**Counts**} \\ \cline{2-5}  & **Correctly Identified** & **Incorrectly Identified** & **Correctly Identified** & **Incorrectly Identified** \\  & **Normal Events** & **Normal Events** & **Near-Crash Events** & **Near-Crash Events** \\ \hline CNN & 594 & 24 & 3 & 62 \\ LSTM & 603 & 15 & 2 & 63 \\ Attention & 510 & 108 & 12 & 53 \\ CNN-LSTM & 605 & 13 & 2 & 63 \\ CNN-Attention & 590 & 28 & 3 & 62 \\ LSTM-Attention & 591 & 27 & 3 & 62 \\ CNN-LSTM-Attention & 611 & 7 & 1 & 64 \\ \hline \hline \end{tabular}
\end{table}