# STA-GCN: Spatial-Temporal Self-Attention Graph Convolutional Networks for Traffic-Flow Prediction
## 4 Results and Discussion
### Experimental Results
\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline
**Datasets** & **T** & **Metric** & **ARIMA** & **SVR** & **FNN** & **GRU** & **FC-LSTM** & **STGCN** & **ASTGCN** & **STA-GCN** \\ \hline \multirow{6}{*}{PeMSD04} & \multirow{3}{*}{30} & MAE & 25.52 & 25.34 & 25.02 & 24.85 & 24.32 & 22.31 & 21.02 & 19.02 \\  & & RMSE & 33.21 & 32.02 & 31.89 & 30.24 & 30.08 & 35.92 & 32.98 & 29.79 \\  & & MAPE & 18.25\% & 18.02\% & 17.85 & 17.23 & 16.85 & 17.05\% & 15.21\% & 12.55\% \\  & & MAE & 31.75 & 30.23 & 29.52 & 29.20 & 28.78 & 24.02 & 21.87 & 18.05 \\  & & RMSE & 40.26 & 38.67 & 37.52 & 37.21 & 36.84 & 38.94 & 34.12 & 30.54 \\  & & MAPE & 23.56\% & 21.23\% & 20.32 & 19.85 & 18.02 & 16.83\% & 15.24\% & 12.51\% \\  & & MAE & 35.65 & 32.35 & 31.25 & 30.26 & 28.35 & 26.12 & 23.02 & 18.23 \\  & & RMSE & 52.25 & 48.28 & 47.02 & 46.32 & 44.25 & 40.89 & 36.51 & 31.20 \\  & & MAPE & 26.69\% & 23.78\% & 21.02 & 20.23 & 18.20 & 17.23\% & 16.95\% & 12.32\% \\ \hline \multirow{6}{*}{PeMSD08} & \multirow{3}{*}{30} & MAE & 19.06 & 19.07 & 19.08 & 19.21 & 19.12 & 15.26 & 14.94 & 12.01 \\  & & RMSE & 29.72 & 29.64 & 29.68 & 29.82 & 29.71 & 23.24 & 22.85 & 20.05 \\  & & MAPE & 13.10\% & 12.98\% & 13.02\% & 13.45\% & 13.07\% & 10.19\% & 9.91\% & 7.21\% \\  & & MAE & 23.12 & 21.51 & 21.05 & 20.85 & 20.13 & 15.52 & 15.04 & 12.30 \\  & & RMSE & 35.53 & 32.25 & 31.25 & 31.01 & 30.65 & 23.88 & 23.23 & 21.45 \\  & & MAPE & 16.21 & 14.62\% & 13.71\% & 13.69 & 13.54\% & 9.76\% & 9.60\% & 7.69\% \\  & & MAE & 29.21 & 24.25 & 23.91 & 23.85 & 22.35 & 17.43 & 16.91 & 12.84 \\  & & RMSE & 40.02 & 37.21 & 36.13 & 36.01 & 34.10 & 26.68 & 25.82 & 22.25 \\  & & MAPE & 18.02\% & 15.03\% & 14.35\% & 14.24\% & 14.01\% & 11.74\% & 10.95\% & 7.83\% \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Performances of traffic-flow-prediction models. Figure 6: Comparison of the number of training epochs and RMSE when three models converged. volume suddenly increases (6:00-7:00) or decreases (19:00-20:00), STA-GCN can fit the trends in traffic-volume changes better than STGCN and ASTGCN. To better study the roles of the spatial self-attention mechanisms in the models, in Figure 9, the top image displays the traffic-flow changes of four randomly selected traffic nodes (A, B, C, and D) over the course of one hour. The bottom 10 images show the self-attention-score matrices of the four traffic nodes over 10 time intervals. In the 0-2 time interval, A has a higher attention score on B because the traffic-flow trends of the two nodes show a negative correlation during this time. In the 2-4 time interval, the attention scores  
Figure 8: Comparison of traffic-flow predictions on holidays. Figure 7: Comparison of traffic-flow predictions on weekdays. of A, B, and C on D are the highest because the traffic flows of B and C are similar to that of D, and the traffic-flow trends are also similar. Moreover, A has a similar trend to D, and their traffic-flow increases are almost the same, at 20 and 24 respectively. Therefore, our model not only performs well in prediction but also has good interpretability.