# A CNN-LSTM-Attention Model for Near-Crash Event Identification on Mountainous Roads
## 5 Results
### Evaluation of Model Performance
#### 5.2.2 Experimental Results

Table 5: Confusion matrix for model comparison. as near-crash events. The LSTM model performs slightly better than the CNN model in identifying normal events, with 19 normal events being incorrectly identified as near-crash events, though some errors still exist. However, the Attention model performs the worst among all models, incorrectly identifying 108 normal events as near-crash events and misjudging 12 near-crash events as normal events. When examining other Attention-related models in Table 5, it is found that adding an Attention layer to CNN (CNN-Attention model) improves performance, whereas adding it to LSTM (LSTM-Attention model) results in the opposite effect. This indicates that, for the data used in this study, the Attention mechanism does not enhance all deep learning models. In comparison, the CNN-LSTM model performs better, with improvements in various aspects. The CNN-LSTM-Attention model correctly identified 611 normal events, with only seven normal events being incorrectly identified as near-crash events and one near-crash event misjudged as a normal event, making it the best-performing model overall. In some cases, this model may identify normal events as near-crash events, possibly due to the driver being an aggressive driver who pursues high speed and high acceleration, which could lead to misjudgments by the model. Table 6 shows the identification results of the CNN-LSTM-Attention model and the comparative models. Among them, the CNN-LSTM-Attention model achieves the highest overall accuracy (_A_) of 98.8%, and the AUC value reached 0.997. All models achieve over 95% accuracy in identifying normal events. However, in identifying near-crash events, the CNN-LSTM-Attention model performs best, with a precision of 90.1%, which is significantly higher than the 61.6% of the CNN model, 76.8% of the LSTM model, and 82.9% of the CNN-LSTM model. The recall rate (_R_) of the CNN-LSTM-Attention model is 98.5%, which is also superior to the performance of the other models. In all, the CNN-LSTM-Attention model achieve the best results in overall performance in identification of normal events and near-crash events. The model can identify more near-crash events with a lower false rate than the comparative models. In the comparison of CNN and CNN-Attention Models, it is observed that the CNN model is effective in extracting local features, while the advantage of the Attention mechanism lies in focusing on key features. However, given that the data also relies on time-series features, the inclusion of the Attention mechanism only provides marginally additional significant information, resulting in limited performance improvement. In the comparison of LSTM and LSTM-Attention models, it is observed that the LSTM model excels at processing temporal relationships within time-series data; however, due to the lack of local feature inputs of the CNNs, the introduction of the Attention mechanism may, in some instances, provide redundant information, thus the enhancement is not substantial. In the context of this study, near-crash events are the result of the combined effect of multidimensional, temporal information influenced by nearby time-series variables. While the LSTM model is well-suited for handling relationships in time-series data, the LSTM-Attention model may suffer from overfitting in the dataset used in this study. This could be attributed to the absence of dimensionality reduction in local feature inputs from the CNNs and the introduction of the Attention mechanism, which increases model