Representation via Representations: Domain Generalization via Adversarially Learned Invariant Representations

Zhun Deng, Frances Ding, Cynthia Dwork, Rachel Hong, Giovanni Parmigiani, Prasad Patil, Pragya SurarXiv 2020

Introduction

A persistent challenge in machine learning is the "out-of-distribution" (OOD) problem, specifically in the context of Domain Generalization (DG). In high-stakes fields like medicine, a diagnostic model trained on data from "Hospital A" often suffers a significant drop in accuracy when deployed at "Hospital B." These performance gaps arise from differences in patient demographics, local data collection protocols, or varying imaging technologies.

This paper addresses the DG problem by bridging the gap between algorithmic fairness and machine learning robustness. The authors propose that achieving generalization across unseen environments is fundamentally a fairness issue. By treating the source domain as a "sensitive attribute"—similar to race or gender in fairness literature—they develop a method to strip away domain-specific idiosyncrasies, leaving only the universal, invariant signal necessary for robust prediction.

The RVR Framework: Adversarial Censoring

The authors introduce RVR (Representation via Representations), a framework that utilizes "adversarial censoring" to learn invariant features. The architecture is composed of three primary components:

  1. Encoder ($\phi$): This component maps raw input data into a latent representation space $Z$.
  2. Discriminator ($\psi_k$): An adversarial network that attempts to identify the specific training domain of the data based solely on the representation $Z$.
  3. Classifier ($f$): A task-specific network that predicts the target label (e.g., the presence of a tumor) from the representation $Z$.

The training process is structured as a minimax game. The encoder is optimized to assist the classifier in making accurate predictions while simultaneously "fooling" the discriminator. If the discriminator cannot distinguish which domain a data point originated from, the encoder has successfully filtered out domain-specific noise (such as a particular hospital's equipment bias), retaining only the features that are consistent across all training environments.

Theoretical Contributions

Beyond empirical implementation, the paper provides a formal characterization of adversarial loss as the number of training domains ($k$) increases. Using complex geometric arguments, the authors prove that as the diversity of training environments grows, the resulting "invariant" representation becomes increasingly refined.

This theoretical edge provides formal guarantees for adversarial invariant domain generalization. The authors demonstrate that the discriminator's ability to distinguish domains is fundamentally limited by the overlap of the true underlying distributions in the representation space. As more domains are added, the generalization error bounds tighten, providing a mathematical foundation for the intuition that environmental diversity is more critical than raw data volume from a single source.

Experimental Evaluation

The RVR approach was evaluated against state-of-the-art methods, including Invariant Risk Minimization (IRM), across three distinct benchmarks:

Synthetic Biomedical Data

In a controlled environment with 30-dimensional covariates—where some signals were invariant and others were spurious—RVR achieved 95.6% accuracy with 10 training domains. This significantly outperformed standard baselines like Logistic Regression (86.2%) and Random Forests (89.0%).

Colored MNIST

This benchmark tests a model's ability to ignore color (a spurious signal) and focus on digit shape (the invariant signal). In a challenging setup with 6 training domains, RVR reached 97.7% accuracy on the unseen test domain, surpassing IRM's 94.7%. Notably, the experiments confirmed a "scaling effect": increasing the training domains from 3 to 6 resulted in a jump from 86.1% to 97.7% accuracy.

PACS Benchmark

The PACS dataset (Photos, Art, Cartoon, Sketch) represents a real-world computer vision challenge. RVR consistently outperformed baselines; for instance, when testing on "Photos" after training on the other three domains, RVR achieved 70.7% accuracy, while IRM reached only 57.6%.

Key Insights and Future Directions

The core contribution of this work is the formalization of the "Domain as a Sensitive Attribute" concept. By censoring the domain ID, the model is forced to be blind to the data source, which inherently promotes generalization. The research proves that observing data from a larger number of "studies" or environments provides a better "cover" of the underlying distribution of possible domains.

While the results are promising, the authors identify several avenues for future work:

  • Loss Function Expansion: Current theoretical proofs focus on indicator-based loss functions; extending these to cross-entropy loss is a priority.
  • The Role of Decoders: To keep the analysis tractable, the authors omitted the decoder component often found in fair representation models. Re-integrating the decoder could provide further insights into representation quality.
  • Refining Success Conditions: While the paper provides sufficient conditions for success, further research is needed to capture the full nuance of why adversarial approaches succeed in complex, high-dimensional practical applications.

Summary updated

BibTeX
@misc{deng2020representation,
  author = {Zhun Deng and Frances Ding and Cynthia Dwork and Rachel Hong and Giovanni Parmigiani and Prasad Patil and Pragya Sur},
  title = {{Representation via Representations: Domain Generalization via Adversarially Learned Invariant Representations}},
  year = {2020},
  eprint = {2006.11478},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2006.11478},
}
Figure