NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

SpaCE: The Spatial Confounding Environment

Mauricio Tec, Ana Trisovic, Michelle Audirac, Sophie Mirabai Woodward, Jie Kate Hu, Naeem Khoshnevis, Francesca Dominici

While "correlation is not causation" is a foundational principle in data science, fields like public health, climate science, and economics demand the identification of true causal relationships. Does air pollution directly cause higher mortality rates, or is it simply that people in dense, polluted cities share other lifestyle factors? This challenge is known as confounding.

When these hidden factors vary across geography—such as urbanization, socioeconomic status, or climate patterns—researchers face spatial confounding. To address this, researchers from Harvard University introduced SpaCE (The Spatial Confounding Environment), a comprehensive toolkit designed to help researchers systematically measure how well their models handle invisible geographic biases.

SpaCE serves as the first comprehensive benchmarking toolkit for spatial causal inference. It provides over 100 realistic, semi-synthetic datasets complete with "ground truth" counterfactuals, allowing researchers to rigorously test if their models can truly isolate causal effects from spatially-correlated noise.

The Challenge of Spatial Confounding

Causal inference is inherently difficult due to the "fundamental problem": we can never observe what would have happened to the exact same unit under a different treatment (the counterfactual). In spatial data, this problem is exacerbated. If you are studying the effect of a wildfire on local health, you cannot ignore that nearby areas share similar weather, demographics, and infrastructure. These "smoothly varying" factors often act as unobserved confounders.

Dimensions of the SpaCE toolkit

Existing benchmarks for causal inference usually ignore spatial dimensions entirely or rely on purely simulated data that is too "clean" to represent the messy real world. Without a realistic benchmark that includes geographic coordinates, spatial graphs, and known counterfactuals, it is nearly impossible to determine which spatial models actually work and which are merely overfitting to local noise.

Methods: Generating Realistic Benchmarks

To bridge the gap between clean simulations and messy reality, the authors developed a sophisticated pipeline to create "semi-synthetic" data:

  1. Real Foundations: The process begins with real-world treatment and covariate data (e.g., actual air pollution levels and census data across US counties).
  2. AutoML Ensembles: State-of-the-art machine learning (AutoGluon) is used to model the complex relationships between these variables and real outcomes.
  3. Residual Sampling: To maintain realism, the pipeline analyzes the "noise" (residuals) from real models and replaces it with synthetic noise generated from a Gaussian Markov Random Field (GMRF). This ensures the synthetic data retains the same spatial "smoothness" as the real world.
  4. Spatially-Aware Splitting: Standard random train/test splits fail with spatial data because neighboring points are too similar, leading to massive overfitting. SpaCE introduces a Breadth-First Search (BFS) splitting method to ensure models are tested on truly distinct geographic areas.
  5. Controlled Masking: To create the benchmark task, the researchers intentionally hide a group of related variables (like "urbanization indicators") and challenge models to recover the true causal effect without them.
Semi-synthetic data generation pipeline showing true vs. synthetic outcomes and counterfactuals

The SpaCE Datasets

SpaCE introduces six major data collections covering diverse domains and scales:

  • Health & Environment: Air pollution and mortality (US counties), Heat exposure and wildfires (California).
  • Social Science: Social vulnerability and welfare (Texas), Welfare and election results (US counties).
  • High-Resolution Physics: $PM_{2.5}$ chemical components on a massive 1km x 1km grid across the USA.
  • Infrastructure: Socioeconomic status and broadband usage (US Zip codes).

In total, the environment offers 124 individual datasets ranging from 3,000 to nearly 4 million spatial nodes.

Key Insights and Results

The authors tested several baselines, including standard OLS, XGBoost, and specialized spatial models like SPATIAL+.

  • The "Aha" Moment on Overfitting: The researchers found that standard machine learning models overfit spatial data so aggressively that they appear to perform perfectly on validation sets while failing miserably at causal estimation. The spatially-aware split proved to be a necessary reality check.
  • Quantifying Difficulty: Every dataset includes a "smoothness score" and a "confounding score." This allows researchers to see exactly where models break down—for instance, a model might succeed when confounders change rapidly but fail when they vary slowly across a whole state.
  • The Cost of Hiding Data: Masking spatial confounders significantly increased error across all models, proving that spatial confounding is a major "performance killer" that current methods haven't fully solved.
  • Winning Algorithms: The SPATIAL+ algorithm (which uses spatial splines) was the top performer for binary treatments, while traditional spatial error models (GMERROR) often held the lead for continuous treatments. Interestingly, complex deep learning models like Graph Convolutional Networks (GCNNs) often performed worse than traditional spatial statistics.
  • Scalability Gap: Many existing spatial confounding methods couldn't scale to the larger SpaCE datasets (like the 4-million-node $PM_{2.5}$ set), highlighting a major need for more efficient algorithm design.

Limitations and Future Work

While SpaCE is a massive step forward, the authors note a few areas for future growth:

  • Interference: Currently, the model assumes one unit's treatment doesn't affect its neighbor's outcome (no "spill-over" effects). In reality, spatial interference is common.
  • Time: The current version focuses on "snapshots" in time. Future versions could incorporate temporal confounding to study how effects evolve over years.
  • Model Assumptions: The counterfactuals are generated using an Additive Noise Model, which might not capture highly complex, non-linear interactions between hidden variables and the treatment.

SpaCE is publicly available as a Python package, providing a much-needed "gym" for the next generation of spatial AI and causal inference research.

Summary updated

BibTeX
@inproceedings{tec2024space,
  author = {Mauricio Tec and Ana Trisovic and Michelle Audirac and Sophie Mirabai Woodward and Jie Kate Hu and Naeem Khoshnevis and Francesca Dominici},
  title = {{SpaCE: The Spatial Confounding Environment}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=D9rJdtmIG6},
}
Figure