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

Baoyu Jing, Dawei Zhou, Kan Ren, Carl Yang

Introduction

Spatiotemporal time series data, collected from sensor networks monitoring phenomena like traffic flow or air quality, are essential for urban planning and environmental science. However, these datasets are frequently incomplete due to sensor malfunctions or transmission failures. While deep learning models—particularly Graph Neural Networks (GNNs) and Transformers—have significantly improved imputation accuracy, they often suffer from being "correlation-hungry." These models tend to exploit any available statistical correlation, including spurious ones caused by unobserved confounders, leading to poor generalization in complex real-world environments.

The Causal Perspective on Imputation

The core challenge in spatiotemporal imputation is distinguishing between true causal relationships and shortcut correlations. For instance, two air quality sensors might show similar readings because they are geographically close, but if they are separated by a mountain range, their relationship is likely driven by a shared regional weather pattern (a confounder) rather than direct interaction.

The Structural Causal Model (SCM) illustrating how confounders (C) create non-causal paths between inputs (G) and ground truth (Y).

As shown in the Structural Causal Model (SCM) above, unobserved confounders establish "backdoor paths" that mislead models into learning relationships that do not hold under different conditions. To address this, a model must be able to block these paths and focus on the direct causal effect of observed data on missing values.

The Casper Framework

To overcome these limitations, the authors propose Casper (Causality-Aware Spatiotemporal Graph Neural Network). Casper integrates causal inference principles directly into the architecture through two primary components: Spatiotemporal Causal Attention (SCA) and a Prompt-Based Decoder (PBD).

Overview of the Casper architecture, featuring the encoder with Spatiotemporal Causal Attention and the Prompt-Based Decoder.

Spatiotemporal Causal Attention (SCA)

Unlike standard attention mechanisms that allow every node to attend to every other node, SCA introduces a causal gate ($\beta$). This gate learns to prune non-causal connections, effectively discovering a sparse causal graph from the data. By using the Gumbel-Softmax trick and $L_1$ regularization, the model remains differentiable while enforcing a sparsity prior that prevents it from "cheating" via irrelevant nearby sensors.

Prompt-Based Decoder (PBD)

To mitigate the influence of unknown confounders, Casper employs frontdoor adjustment. This technique requires capturing the "global context" of the dataset to isolate causal effects. Casper implements this efficiently using learnable "prompts"—embedding vectors that represent the dataset's global state. These prompts refine the final predictions without the computational overhead of processing the entire dataset during inference.

Experimental Results

Casper was evaluated across five diverse datasets, including traffic speed (METR-LA, PEMS-BAY), air quality (AQI, AQI-36), and gene expression (DREAM-3).

  • Imputation Accuracy: Casper consistently outperformed state-of-the-art baselines like SPIN and GRIN. On the AQI-36 dataset, it reduced the Mean Squared Error (MSE) from approximately 455 to 396.16.
  • Causal Discovery: On the DREAM-3 benchmark, where the ground truth causal structure is known, Casper achieved an AUC of 0.6325, surpassing specialized causal discovery models.
  • Interpretability: Qualitative analysis demonstrated that Casper correctly identifies physical barriers. For example, it learned to ignore nearby sensors separated by topographical features that block actual airflow, proving its ability to move beyond simple distance-based heuristics.

Conclusion

Casper represents a significant step forward in spatiotemporal modeling by shifting the focus from mere correlation to causal discovery. By integrating frontdoor adjustment and sparse causal attention, it provides a robust, interpretable, and highly accurate solution for the pervasive problem of missing data in sensor networks.

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