Traffic Flow Prediction Method Based on Multi-Scale Spatio-Temporal Features and Soft Attention Mechanism
Traffic flow prediction has considerable value in design of transportation systems,optimization of road resources,and mitigation of traffic congestion.To address the issue of limited prediction accuracy due to insufficient extraction of temporal periodic features in traffic flow forecasting,in this study,a multi-scale spatio-temporal features soft attention mechanism method MSTFSA is proposed for traffic flow forecasting.The method is based on multi-scale spatial and temporal features and a soft attention mechanism.First,the Graph Talking Head Attention Network(GTHAT)is used to extract the non-Euclidean structural features of the spatial data.The dynamic weights are calculated to represent the impact of traffic flow on adjacent roads at different times.Second,a Bidirectional Enhanced Attention Gated Recurrent Unit(Bi-EAGRU)is utilized to capture the continuity correlation features of temporal data,thereby enhancing the temporal features of each moment and the continuity between adjacent moments.Subsequently,similar traffic flow trends at three scales of periodicity:weekly,daily,and nearest-neighbor time are fused based on soft attention to implement the comprehensive extraction of temporal periodic features.Finally,the prediction accuracy of MSTFSA is verified on the highway datasets PeMS04 and PeMS08.The experimental results demonstrate that MSTFSA provides distinct advantages in terms of traffic flow prediction accuracy.Compared with the baseline methods of Spatio-Temporal Synchronous Graph Convolutional Network(STSGCN)and Attention-based Spatio-Temporal Graph Convolutional Network(ASTGCN),MSTFSA not only reduces the Root Mean Square Error(RMSE)by 7.15%and 3.8%but also decreases the Mean Absolute Error(MAE)by 7.79%and 3.99%on PeMS04 dataset,respectively.In summary,MSTFSA can efficiently extract and merge the multi-temporal and spatial attributes of traffic data,thereby considerably improving the prediction accuracy of traffic flow.