## 4 Experiment and Result Analysis
### Sensitivity Analysis  
The sensitivity of the proposed MRWG BiAtten model is analyzed. Figure 2(a) demonstrates that the RMSE error first drops then rises with the increase in attention layers performed on the BikeNYC inflow dataset, and the MAE error has a similar tendency. Therefore, moderately increasing the network depth can increase the prediction accuracy. However, it could face overfitting or other issues if the network is too deep, which can explain the reason that the RMSE error increases with more than four attention layers. Figure 2(b) shows that the model also behaves similarly on the TaxiNYC inflow dataset.  
Within the constraints of the specified attention head count, we have explored the impact of different numbers of heads. Figure 4 depicts the RMSE and MAE values on the BikeNYC and TaxiNYC datasets as the number of attention heads varies. The results indicate that, when the number of the attention heads is set to less than 8, both RMSE and MAE values gradually decrease with the increase in the attention head count. However, once the count exceeds 8, RMSE and MAE values begin to rise, suggesting that appropriately increasing the number of attention heads can enhance the performance. Nevertheless, exceeding a certain number may lead to overfitting.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Dataset**} & \multirow{2}{*}{**Method**} & **With Acc** & **No Acc** \\ \cline{3-4}  & & **RMSE** & **RMSE** \\ \hline \multirow{4}{*}{TaxiNYC} & LSTM & 18.58 & 18.75 \\  & ConvLSTM & 18.88 & 18.75 \\  & STDN & 16.47 & 16.93 \\  & Our method & 16.28 & 16.51 \\ \hline \multirow{4}{*}{BikeNYC} & LSTM & 9.54 & 9.46 \\  & ConvLSTM & 9.35 & 9.45 \\ \cline{1-1}  & STDN & 8.34 & 8.61 \\ \cline{1-1}  & Our method & 7.98 & 8.42 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Analysis of the role of the accident module.  
Eventually, the best prediction performance is achieved when all components are combined together. As displayed in Figure 5, high prediction accuracy can be obtained in most regions with high proportion, indicating that the model performs satisfactorily in traffic flow prediction.  
There are two main reasons that the MRWG BiAtten model works better than the alternative methods: (1) The MRWG BiAtten model uses the position attention mechanism to capture both global and local spatial correlations in the data and the temporal attention modules to model the interdependencies between short-term and long-term temporal features, while bidirectional attention mechanisms are applied to integrate spatiotemporal  
Figure 4: Attention head analysis for MRWG BiAtten. (**a**) Results of adding attention heads on the BikeNYC dataset. (**b**) Results of adding attention heads on the TaxiNYC dataset.  
Figure 5: Flow matrix at the latest timestamp on the two datasets.  
Figure 3: Attention layer analysis for MRWG BiAtten. (**a**) Results of adding more attention layers on BikeNYC dataset. (**b**) Results of adding more attention layers on TaxiNYC dataset.  
features, designating the entire traffic data tensor as the input. (2) The MRWG BiAtten model addresses the impact of abnormal traffic events by designing a random walk mechanism based on the multi-graph attention mechanism to account for the fluctuations in the local and global traffic flow of the city region network when abnormal traffic events occur in the future. This could be beneficial for making accurate short-term traffic flow predictions in the event of traffic accidents and congestion.