Context-aware knowledge graph framework for traffic speed forecasting using graph neural network
Yatao Zhang, Yi Wang, Song Gao, Martin Raubal
TL;DR
This work introduces a context-aware knowledge graph (CKG) framework to model spatio-temporal urban contexts for traffic speed forecasting. It combines two KG units (spatial and temporal) with a relation-dependent embedding and a dual-view multi-head self-attention mechanism, integrated into a CKG-GNN built on a DCRNN backbone. Empirical results show that the optimal spatial embedding uses ComplEx with a Buffer of [10-100] and Link of [6], while the temporal embedding uses KG2E with Past[60] and HDW temporal links, yielding state-of-the-art predictions for 10–120 minutes ahead (MAE $3.46\pm0.01$, MAPE $14.76\pm0.09\%$, RMSE $5.08\pm0.01$). The model outperforms baselines like DCRNN and other context-aware approaches, highlighting the value of structured context integration for traffic forecasting and its potential for real-time traffic management applications.
Abstract
Human mobility is intricately influenced by urban contexts spatially and temporally, constituting essential domain knowledge in understanding traffic systems. While existing traffic forecasting models primarily rely on raw traffic data and advanced deep learning techniques, incorporating contextual information remains underexplored due to insufficient integration frameworks and the complexity of urban contexts. This study proposes a novel context-aware knowledge graph (CKG) framework to enhance traffic speed forecasting by effectively modeling spatial and temporal contexts. Employing a relation-dependent integration strategy, the framework generates context-aware representations from the spatial and temporal units of CKG to capture spatio-temporal dependencies of urban contexts. A CKG-GNN model, combining the CKG, dual-view multi-head self-attention (MHSA), and graph neural network (GNN), is then designed to predict traffic speed utilizing these context-aware representations. Our experiments demonstrate that CKG's configuration significantly influences embedding performance, with ComplEx and KG2E emerging as optimal for embedding spatial and temporal units, respectively. The CKG-GNN model establishes a benchmark for 10-120 min predictions, achieving average MAE, MAPE, and RMSE of $3.46\pm0.01$, $14.76\pm0.09\%$, and $5.08\pm0.01$, respectively. Compared to the baseline DCRNN model, integrating the spatial unit improves the MAE by 0.04 and the temporal unit by 0.13, while integrating both units further reduces it by 0.18. The dual-view MHSA analysis reveals the crucial role of relation-dependent features from the context-based view and the model's ability to prioritize recent time slots in prediction from the sequence-based view. Overall, this study underscores the importance of merging context-aware knowledge graphs with graph neural networks to improve traffic forecasting.
