Table of Contents
Fetching ...

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.

Context-aware knowledge graph framework for traffic speed forecasting using graph neural network

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 , MAPE , RMSE ). 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 , , and , 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.
Paper Structure (30 sections, 13 equations, 6 figures, 13 tables, 1 algorithm)

This paper contains 30 sections, 13 equations, 6 figures, 13 tables, 1 algorithm.

Figures (6)

  • Figure 1: An overview of the CKG-GNN model for traffic speed forecasting. It comprises three parts: spatio-temporal KG construction, relation-dependent KG embedding and integration, and context-aware traffic forecast. The model processes inputs of traffic speed, spatial context, and temporal context data from the past $a$ time steps, and outputs traffic speeds for the forthcoming $b$ time steps.
  • Figure 2: Diagrams illustrating multi-hop relation path integration and attribute augmentation for (a) distance-based models and (b) similarity-based models. The primary distinction between them lies in the method of relation path integration, with addition ($+$) employed in (a) and multiplication ($\times$) utilized in (b).
  • Figure 3: Overview of Singapore's Core Central Region (CCR) and the used datasets. The speed shown in the figure is a demo dataset collected from HERE technologies.
  • Figure 4: Attention weight heatmaps for context-view and sequence-view features in CKG-$\mathbb{K}_{ST}$. (a) Heatmap for context-view features with $[0-9]_a$ for the spatial unit and $[10-16]_a$ for the temporal unit. $[0]_a$: road-only spatial feature; $[1-3]_a$: relation-dependent features for roads, POIs, and land uses, respectively; $[4-9]_a$: spatial links from 1 to 6. $[10]_a$: road-only temporal feature; $[11-13]_a$: relation-dependent features for time indicators, jam factors, and weather conditions, respectively; $[14-16]_a$: temporal links for hour, day, and week, respectively. (b) Heatmap for sequence-view features in the last 12 time slots with masks. $[0]_b$: the earliest; $[11]_b$: the latest.
  • Figure 5: Embedding performance of both-side (b), left-side (head, h), and right-side (tail, t) link predictions for $\mathbb{K}_S$ and $\mathbb{K}_T$. (a) ComplEx for $\mathbb{K}_{S}$. (b) TransE for $\mathbb{K}_{S}$. (c) KG2E for $\mathbb{K}_{T}$. (d) TransE for $\mathbb{K}_{T}$.
  • ...and 1 more figures