Transformer-Based Generative Adversarial Network for Traffic Forecasting
Bingyi Liu, Luying Yuan, Xun Shao, Enshu Wang, Zhenchang Xia, Weizhen Han, Celimuge Wu · IEEE Transactions on Consumer Electronics · 2025
Accurate traffic flow forecasting is crucial for enhancing the performance and capabilities of navigation applications. The traffic flow data collected from sensors across widely distributed areas exhibits complex and diverse spatial-temporal correlations, posing a significant challenge for effective capture. Additionally, existing models primarily focus on improving the model architecture to enhance prediction accuracy, while overlooking the importance of training methods, resulting in suboptimal performance. To deal with these problems, we propose a Transformer-based Generative Adversarial Network (TGAN) consisting of a meticulously crafted transformer encoder as the generator and Gated Recurrent Units (GRUs) as the discriminator for adversarial training. Specifically, on the generator side, we propose a Time-Dependent Network (TDN) that integrates 1D-CNNs with varying kernel sizes and multi-head attention mechanisms to effectively capture diverse temporal patterns. For spatial modeling, we introduce a Spatial-Dependent Graph Convolutional Network (SDGCN) designed to model dynamic spatial correlations through a learnable masked adjacency matrix. Moreover, criticality embedding is introduced to emphasize the crucial nodes within the road network, while distance embedding is designed to enhance the model’s spatial awareness. On the discriminator side, we concatenate the predicted data from the generator with historical data as input and modify the training loss, thereby ensuring the consistency of the predictions. Subsequently, the generator further improves prediction accuracy through adversarial training with the discriminator. We conduct extensive experiments on four real-world traffic datasets. The experimental results show that the proposed TGAN outperforms the baselines in prediction accuracy.