Learning Invariant Representations with Missing Data

Mark Goldstein, Joern-Henrik Jacobsen, Olina Chau, Adriel Saporta, Aahlad Manas Puli, Rajesh Ranganath, Andrew Miller

Abstract

Spurious correlations, or shortcuts, allow flexible models to predict well during training but poorly on related test populations. Recent work has shown that models that satisfy particular independencies involving the correlation-inducing nuisance variable have guarantees on their test performance. However, enforcing such independencies requires nuisances to be observed during training. But nuisances such as demographics or image background labels are often missing. Enforcing independence on just the observed data does not imply independence on the entire population. In this work, we derive the missing-mmd estimator used for invariance objectives under missing nuisances. On simulations and clinical data, missing-mmds enable improvements in test performance similar to those achieved by using fully-observed data.

Introduction

Machine learning models are notorious for exploiting "shortcuts"—spurious correlations that exist in training data but fail to generalize to new environments. For instance, a medical imaging model might learn to predict a disease based on a patient's age or the specific hospital's equipment (nuisance variables) rather than actual pathology. When deployed in a different demographic or clinical setting, the model's performance often collapses.

To mitigate this, researchers employ invariant representation learning, which forces the model's internal representations to be independent of these nuisance variables. However, a significant practical hurdle exists: these methods typically require the nuisance variable (e.g., race, age, or background texture) to be labeled for every example in the training set. In real-world scenarios, particularly in clinical settings, these labels are frequently missing.

Causal graph illustrating the relationship between label Y, features X, nuisance variable Z, and missingness indicator Δ.

The Challenge of Missing Nuisances

A common but flawed approach to missing data is to enforce invariance only on the "observed" portion of the dataset. The authors prove (Proposition 2) that this "observed-only" strategy is a trap: a model can appear perfectly invariant on the labeled subset while remaining highly biased across the entire population. This can lead models to discard correct features or falsely signal that they have achieved robustness.

Methodology: Missing-MMD Estimators

The authors focus on the Maximum Mean Discrepancy (MMD), a metric used to measure the distance between two distributions. To achieve invariance, the MMD between representations of different nuisance groups should be zero. To handle missing nuisance labels ($Z$), the paper derives three new estimators for MMD:

  1. $G_W$-based (Re-weighted): This uses the probability of a label being missing to re-weight observed samples, similar to Inverse Probability Weighting.
  2. $m_W$-based (Regression): This uses a secondary model to predict the missing nuisance values.
  3. Doubly-Robust (DR): This combines both re-weighting and regression. It is "doubly robust" because it remains a consistent estimator if either the missingness model or the nuisance prediction model is correctly specified.

By integrating these estimators into the loss function, the model can be penalized for dependence on the nuisance variable even when that variable is only partially observed.

Experimental Evaluation

The proposed estimators were evaluated across three distinct environments:

  • Synthetic Simulation: A controlled setting with strong correlations to test the mathematical limits of the estimators.
  • Textured MNIST: A semi-synthetic dataset where MNIST digits are superimposed on textures from the Brodatz dataset. The task is to predict the digit while ignoring the background texture, even when background labels are missing.
  • MIMIC-III: A real-world clinical dataset used to predict ICU length of stay. "Race" was treated as a nuisance variable to ensure generalization across demographic shifts, simulating a scenario where demographic data is incomplete.
Example from the Textured MNIST dataset, where digits are superimposed on spurious background textures.

Key Results and Discussion

The Doubly-Robust (DR) and Regression (REG) estimators consistently outperformed both the baseline (no invariance) and the naive observed-only (OBS) methods.

  • Performance Gains: In the Textured MNIST experiments, the baseline model achieved only 13% test accuracy due to background shifts. While the naive "observed-only" MMD improved this to 63%, the Doubly-Robust estimator reached 72-73%, nearly matching the 74% accuracy achieved with a fully-labeled "gold standard" dataset.
  • Population-Level Invariance: The DR and REG methods successfully drove the "true" MMD (calculated on hidden data) close to zero, whereas the OBS method often failed to achieve actual population-level invariance.
  • Clinical Viability: On the MIMIC-III dataset, the REG estimator matched the performance of models trained on full data, demonstrating the practical utility of these techniques for noisy clinical datasets.

Conclusion

This work provides a robust framework for learning invariant representations when nuisance labels are missing. By adapting doubly-robust estimation techniques into differentiable deep learning objectives, the authors enable models to ignore spurious correlations more effectively than naive methods. Future work includes addressing the high variance inherent in MMD estimation and scaling these methods to smaller batch sizes and continuous nuisance variables.

Summary updated

BibTeX
@inproceedings{goldstein2022learning,
  author = {Mark Goldstein and Joern-Henrik Jacobsen and Olina Chau and Adriel Saporta and Aahlad Manas Puli and Rajesh Ranganath and Andrew Miller},
  title = {{Learning Invariant Representations with Missing Data}},
  booktitle = {CLeaR},
  year = {2022},
  url = {https://openreview.net/forum?id=YrADFoblKrX},
}
Figure