A dynamic traffic flow prediction method based on spatio-temporal graph transformer
摘要
Due to the complexity and diverse spatio-temporal correlations of traffic flow data, traffic flow prediction has become a hotly discussed topic in intelligent transportation systems. Inspired by the success of Transformer in the field of image processing, this paper proposes a dynamic traffic flow prediction method based on Spatio-Temporal Graph Transformer (STGTrans), which achieves more accurate traffic flow prediction by effectively modeling complex spatio-temporal dependencies within traffic network data. Firstly, to address the diversity of traffic flow data types, taking into account that an adaptive adjacency matrix can effectively fuse multi-modal data, a Multi-Feature Fusion Layer (MFL) is designed. This layer comprehensively captures the correlations between different data sources within the traffic network. Secondly, to address the impact of spatio-temporal correlations on traffic flow prediction, a Global Spatio-Temporal Network (GSTN) is constructed utilizing spatio-temporal encoding and decoding to capture spatio-temporal dependency information. This network extracts spatio-temporal dependencies from upstream and downstream of the traffic network, enabling traffic flow prediction. Lastly, to tackle the dynamic nature of traffic flow, a Dynamic Window Attention (DWA) mechanism is introduced, which flexibly adjusts the focused time period through sliding windows. This attention mechanism enables the model to adaptively focus on different time segments within the data, thereby enhancing the accuracy of traffic flow prediction. Experiments show that the method effectively enhances the adaptability of the traffic flow prediction model to diverse data and dynamic spatio-temporal correlation, while achieving higher prediction accuracy.