A Visual Analytics System for Improving Attention-based Traffic Forecasting Models

Seungmin Jin, Hyunwook Lee, Cheonbok Park, Hyeshin Chu, Yunwon Tae, Jaegul Choo, Sungahn Ko · DOI

TL;DR

AttnAnalyzer is a new visual analytics system designed to crack open the "black box" of attention-based traffic forecasting models. By combining interactive spatio-temporal visualizations with automated methods like Granger causality, it allows engineers to diagnose why models fail during sudden traffic shifts and improve performance through a novel "attention enforcement" technique.

What Problem Does This Paper Address?

Deep learning (DL) has become the gold standard for predicting traffic speeds and arrival times. However, these models are notoriously opaque. In the traffic domain, where a single accident on one road can trigger a ripple effect across an entire city's network, understanding why a model predicts a slowdown is as important as the prediction itself.

Current DL models often struggle with "spatio-temporal dependencies"—the complex ways that traffic patterns on one road influence another over time. When these models produce high errors, developers are often left guessing: Is the model looking at the wrong neighboring roads? Is it ignoring historical trends? AttnAnalyzer aims to bridge this gap by providing a suite of tools to visualize and refine the internal attention mechanisms of these models.

Methods

The researchers developed AttnAnalyzer, a system built around the ST-GRAT (Spatio-Temporal Graph ATtention) model. The workflow integrates several sophisticated components:

  • Automated Dependency Analysis: The system uses Dynamic Time Warping (DTW) to find roads with similar speed patterns across different time lags and Granger causality tests to identify "preceding" patterns (e.g., if Road A consistently slows down 15 minutes before Road B).
  • Interactive Visualizations:
    • Map View with "AttnArrows": Visualizes which roads the model is "attending" to when making a prediction for a specific target road.
  • Attention Heatmaps: Displays the spatio-temporal attention matrix, showing how much weight the model gives to specific roads at specific past time steps.
  • Attention Enforcement: This is the system's most novel feature. If a user discovers that a model is ignoring a causally linked road or losing focus during high-fluctuation periods, they can "enforce" better attention weights derived from successful predictions on similar roads.
The AttnAnalyzer system overview, showing the filter, table, map, and attention views.

Datasets

The system was evaluated using two distinct road networks:

  1. Ulsan, South Korea: An urban road network using Dedicated Short Range Communication (DSRC) data from 116 sensors covering 68 main roads.
  2. METR-LA (Los Angeles): A standard benchmark highway dataset collected from 207 loop detectors on LA highways.

Key Insights and Ideas

  • The "Fluctuation" Failure: The authors found that models consistently produce high errors on roads with high speed fluctuations (high standard deviation). In these moments, the model often "disperses" its attention to unimportant, distant roads instead of maintaining a strong "self-reference" to the road's own recent history.
  • Missing the "Lead" Car: A major discovery was that models often fail to recognize preceding traffic patterns. For example, even if Road 112's speed drops consistently before Road 113's, the model might fail to attend to Road 112 during a crisis.
  • Spatial vs. Temporal Logic: By using Granger causality, the team proved that a model’s accuracy improves when it is forced to look at roads that statistically "cause" (precede) the target road's traffic changes, rather than just roads that are geographically close.
Visualizing how Road 112's traffic pattern precedes Road 113's, a relationship the model initially struggled to capture.

Key Results

The researchers demonstrated that insights gained from AttnAnalyzer could be directly translated into better model performance. By applying the Attention Enforcement method—replacing the "confused" attention weights of high-error roads with weights from successful, similar road clusters—they achieved significant accuracy gains.

On the METR-LA dataset, the "Enforced" model improved the Mean Absolute Error (MAE) across all prediction horizons (15, 30, and 60 minutes). Specifically, for the top 10% most problematic roads, the average MAE dropped from 7.68 to 7.48. While these numbers seem small, in the competitive field of traffic forecasting, such gains are considered significant, especially since they were achieved without retraining the entire model.

Limitations and Future Work

The authors acknowledge that their clustering approach currently uses a fixed range of error (quartiles), which might be too simplistic for all datasets. Additionally, while the "Attention Enforcement" proves the concept, the process still requires some manual intervention.

Future work aims to automate the "switch" between lightweight and heavy forecasting models based on real-time attention analysis, potentially saving massive computational resources for navigation service providers. The team also plans to expand the system to handle travel time prediction, which involves analyzing complex sub-paths rather than just individual road links.

Summary updated

BibTeX
@article{jin2023visual,
  author = {Seungmin Jin and Hyunwook Lee and Cheonbok Park and Hyeshin Chu and Yunwon Tae and Jaegul Choo and Sungahn Ko},
  title = {{A Visual Analytics System for Improving Attention-based Traffic Forecasting Models}},
  journal = {IEEE Trans. Vis. Comput. Graph.},
  year = {2023},
  doi = {10.1109/tvcg.2022.3209462},
}
Figure