Causality-Aware Spatiotemporal Graph Neural Networks for Spatiotemporal Time Series Imputation

Baoyu Jing, Dawei Zhou, Kan Ren, Carl Yang · DOI

TL;DR

Casper is a novel spatiotemporal graph neural network that moves beyond simple correlation to perform "causality-aware" missing data imputation. By leveraging causal frontdoor adjustment and a sparse causal attention mechanism, it effectively ignores misleading noise and "shortcut" connections, resulting in state-of-the-art accuracy and more robust, interpretable models for sensor networks.

What Problem Does This Paper Address?

Spatiotemporal time series—data collected from sensors across different locations over time, like traffic flow or air quality—are notoriously prone to missing values due to sensor failure or network outages. While deep learning has become the standard for "imputing" (filling in) these gaps, most models are "correlation-hungry." They treat every nearby data point as a potential clue, regardless of whether a real physical relationship exists.

The authors identify a major pitfall: confounders. These are hidden factors (like background noise or arbitrary "shortcut" edges in a distance-based sensor network) that create spurious correlations. If a model over-relies on these non-causal paths, it overfits and becomes brittle when faced with real-world noise. The challenge is to build a model that can distinguish between "this sensor is related to that one because of wind flow" (causal) and "these sensors just happen to be noisy at the same time" (non-causal).

Methods

The researchers introduce Casper (Causality-Aware Spatiotemporal Graph Neural Network), which is built on the theoretical foundation of Structural Causal Models (SCM).

Figure 1: The Structure Causal Model (SCM) for spatiotempo- ral imputation. The frontdoor adjustment removes the edge between confounder C and input G.

To block the influence of unknown confounders, Casper employs two primary innovations:

  1. Frontdoor Adjustment via Prompt Based Decoder (PBD): In causal theory, if you can't observe a confounder, you can use an intermediate variable (in this case, the model's embeddings) to "block" the backdoor path. Implementing this mathematically requires a complex summation over the entire dataset. Casper approximates this efficiently using learnable prompts in the decoder. These prompts act as a "global context" for the dataset, allowing the model to marginalize out the noise.
  2. Spatiotemporal Causal Attention (SCA): Standard attention mechanisms are often "dense," assigning some weight to almost everything. SCA introduces a causal gate (using Gumbel-Softmax) that forces the model to learn sparse, Granger-causal relationships.
Figure 4: Spatiotemporal Causal Attention (SCA). Corr. Weight and Causal Prob. correspond to Equation (14)(16).

The overall architecture (Figure 2 in the paper) combines these with standard Transformer layers to capture temporal dynamics before applying the causal spatial attention.

Datasets

The authors evaluated Casper on several real-world benchmarks:

  • AQI & AQI-36: Air quality records from monitoring stations in China (full and reduced versions).
  • METR-LA & PEMS-BAY: Traffic speed time series from Los Angeles and the San Francisco Bay Area.
  • DREAM-3: A quasi-realistic gene expression regulation dataset used specifically to evaluate the model's ability to discover true causal graphs.

Key Insights and Ideas

  • Sparsity is Robustness: By forcing the model to focus only on causal relationships, Casper achieves significantly lower standard deviations in its error rates. It isn't just more accurate; it's more consistent.
  • Built-in Explainability: The causal gate in SCA isn't just a performance booster; it's a gradient-based explainer. The model essentially tells you why it chose specific neighbors to help fill in a missing value.
  • Geography isn't Everything: The visualization of Casper's learned relationships shows it can ignore nearby sensors if a physical barrier (like the Fragrant Hills in Beijing) prevents air flow, whereas standard distance-based models would be misled.
  • One-Stage Causal Discovery: Unlike previous methods that require a two-stage process (impute first, then find causes), Casper learns to do both simultaneously in an end-to-end fashion.

Key Results

Casper consistently outperformed state-of-the-art baselines like SPIN, PoGeVon, and GRIN across all datasets and missing data scenarios (point missing and block missing).

  • Accuracy: On the AQI-36 dataset, Casper achieved a Mean Absolute Error (MAE) of 10.09, compared to 10.92 for the next best model (PoGeVon).
  • Causal Discovery: On the DREAM-3 dataset, Casper achieved an AUC of 0.6325, significantly higher than specialized causal discovery models like CUTS (0.5915).
  • Convergence: Theoretical analysis and experimental results confirmed that the causal probabilities ($\rho$) successfully converge to 0 or 1, ensuring clear, non-ambiguous causal decisions.

Limitations and Future Work

While Casper is highly effective, the authors note that the complexity of the SCA module is $O(ET)$ (where $E$ is the number of edges). While efficient for sparse sensor networks, it could become a bottleneck for very dense graphs.

Future work could explore more complex causal structures beyond the frontdoor adjustment or investigate how Casper performs in "extreme" missing data scenarios where more than 90% of the data is absent. Additionally, extending this causal framework to other spatiotemporal tasks like forecasting or anomaly detection remains an open and promising direction.

Summary updated

BibTeX
@inproceedings{jing2024causality,
  author = {Baoyu Jing and Dawei Zhou and Kan Ren and Carl Yang},
  title = {{Causality-Aware Spatiotemporal Graph Neural Networks for Spatiotemporal Time Series Imputation}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2024},
  doi = {10.1145/3627673.3679642},
}
Figure