Table of Contents
Fetching ...

Counterfactual Explanations for Deep Learning-Based Traffic Forecasting

Rushan Wang, Yanan Xin, Yatao Zhang, Fernando Perez-Cruz, Martin Raubal

TL;DR

This work addresses the interpretability gap in deep learning-based traffic forecasting by introducing counterfactual explanations (CFEs) and, notably, scenario-driven CFEs that integrate user-defined constraints. It combines a graph-based forecasting model with a multi-objective NSGA-II search to generate diverse, actionable CFEs that reveal how static contextual features (e.g., POIs, lanes, speed limits) influence predictions under different spatial and temporal conditions. The study demonstrates that contextual data modestly improve predictive performance and that CFEs can illuminate learned traffic patterns, with suburban, urban, and highway settings showing distinct responses. Overall, the proposed framework enables practitioners and urban planners to understand model behavior, explore policy scenarios, and guide data-driven decision-making in mobility systems.

Abstract

Deep learning models are widely used in traffic forecasting and have achieved state-of-the-art prediction accuracy. However, the black-box nature of those models makes the results difficult to interpret by users. This study aims to leverage an Explainable AI approach, counterfactual explanations, to enhance the explainability and usability of deep learning-based traffic forecasting models. Specifically, the goal is to elucidate relationships between various input contextual features and their corresponding predictions. We present a comprehensive framework that generates counterfactual explanations for traffic forecasting and provides usable insights through the proposed scenario-driven counterfactual explanations. The study first implements a deep learning model to predict traffic speed based on historical traffic data and contextual variables. Counterfactual explanations are then used to illuminate how alterations in these input variables affect predicted outcomes, thereby enhancing the transparency of the deep learning model. We investigated the impact of contextual features on traffic speed prediction under varying spatial and temporal conditions. The scenario-driven counterfactual explanations integrate two types of user-defined constraints, directional and weighting constraints, to tailor the search for counterfactual explanations to specific use cases. These tailored explanations benefit machine learning practitioners who aim to understand the model's learning mechanisms and domain experts who seek insights for real-world applications. The results showcase the effectiveness of counterfactual explanations in revealing traffic patterns learned by deep learning models, showing its potential for interpreting black-box deep learning models used for spatiotemporal predictions in general.

Counterfactual Explanations for Deep Learning-Based Traffic Forecasting

TL;DR

This work addresses the interpretability gap in deep learning-based traffic forecasting by introducing counterfactual explanations (CFEs) and, notably, scenario-driven CFEs that integrate user-defined constraints. It combines a graph-based forecasting model with a multi-objective NSGA-II search to generate diverse, actionable CFEs that reveal how static contextual features (e.g., POIs, lanes, speed limits) influence predictions under different spatial and temporal conditions. The study demonstrates that contextual data modestly improve predictive performance and that CFEs can illuminate learned traffic patterns, with suburban, urban, and highway settings showing distinct responses. Overall, the proposed framework enables practitioners and urban planners to understand model behavior, explore policy scenarios, and guide data-driven decision-making in mobility systems.

Abstract

Deep learning models are widely used in traffic forecasting and have achieved state-of-the-art prediction accuracy. However, the black-box nature of those models makes the results difficult to interpret by users. This study aims to leverage an Explainable AI approach, counterfactual explanations, to enhance the explainability and usability of deep learning-based traffic forecasting models. Specifically, the goal is to elucidate relationships between various input contextual features and their corresponding predictions. We present a comprehensive framework that generates counterfactual explanations for traffic forecasting and provides usable insights through the proposed scenario-driven counterfactual explanations. The study first implements a deep learning model to predict traffic speed based on historical traffic data and contextual variables. Counterfactual explanations are then used to illuminate how alterations in these input variables affect predicted outcomes, thereby enhancing the transparency of the deep learning model. We investigated the impact of contextual features on traffic speed prediction under varying spatial and temporal conditions. The scenario-driven counterfactual explanations integrate two types of user-defined constraints, directional and weighting constraints, to tailor the search for counterfactual explanations to specific use cases. These tailored explanations benefit machine learning practitioners who aim to understand the model's learning mechanisms and domain experts who seek insights for real-world applications. The results showcase the effectiveness of counterfactual explanations in revealing traffic patterns learned by deep learning models, showing its potential for interpreting black-box deep learning models used for spatiotemporal predictions in general.
Paper Structure (44 sections, 7 equations, 17 figures, 5 tables)

This paper contains 44 sections, 7 equations, 17 figures, 5 tables.

Figures (17)

  • Figure 1: Location of road network (dark line).
  • Figure 2: Average speed for all the 3169 road segments from January 1st to 30th, 2019.
  • Figure 3: The architecture of the deep learning model used in this study for traffic forecasting.
  • Figure 4: The architecture of the Gated Recurrent Unit (GRU) model zhu2020astgcn.
  • Figure 5: Location of Node A and Road I (a suburban road).
  • ...and 12 more figures