Domain Generalization via Conditional Invariant Representations

Ya Li, Mingming Gong, Xinmei Tian, Tongliang Liu, Dacheng Tao

Introduction

A fundamental challenge in machine learning is training models on multiple datasets (domains) such that they generalize effectively to entirely new, unseen environments. This paper, presented at AAAI-18, identifies a critical oversight in existing domain generalization (DG) methods: the failure to account for the shifting relationship between features and labels across different environments.

The Problem: Dataset Bias and Causal Structure

Standard machine learning assumes that training and test data are independent and identically distributed (i.i.d.). In practice, dataset bias is prevalent. For instance, a car recognition model trained in sunny conditions may fail in snow because the background distribution has shifted.

Existing DG methods typically attempt to find a feature representation $h(X)$ where the marginal distribution $P(h(X))$ is invariant across domains. However, the authors argue this is insufficient when the causal direction is $Y \to X$ (where the label causes the features, as in medical diagnosis or face recognition). In such cases, if the environment changes, the conditional distribution $P(Y|X)$ also changes. Models assuming a stable $P(Y|X)$ will inevitably fail to generalize.

Conditional Invariant Domain Generalization (CIDG)

The authors propose Conditional Invariant Domain Generalization (CIDG). Instead of global alignment, CIDG ensures that the distribution of features given a specific class remains consistent across domains.

Key technical components include:

  • Kernel Mean Embedding: Mapping distributions into a Reproducing Kernel Hilbert Space (RKHS) to compare them without parametric assumptions.
  • Class-Conditional Regularization: Minimizing the variance of $P(h(X)|Y=j)$ across source domains for every class $j$.
  • Prior-Normalized Marginal Scatter: Adjusting for class imbalance across domains to prevent bias.
  • Discriminative Power: Integrating Kernel Fisher Discriminant Analysis (KFDA) to ensure features remain useful for classification by maximizing inter-class distance.

Experimental Evaluation

The authors evaluated CIDG against several baselines, including DICA and SCA, using synthetic data and real-world image benchmarks (VLCS and Office+Caltech).

Synthetic Visualization

In synthetic tests involving a 2D Gaussian toy problem, CIDG was the only method capable of perfectly clustering three classes across three domains into well-separated, compact groups. As shown in the visualization, other methods often mixed classes while attempting to force global domain overlap.

Benchmark Performance

On the VLCS dataset (comprising VOC2007, LabelMe, Caltech-101, and SUN09), CIDG achieved state-of-the-art results. It outperformed other invariant learning methods in 9 out of 10 domain-transfer scenarios, demonstrating its robustness to real-world distribution shifts.

Key Insights and Future Work

The success of CIDG highlights that causality matters in representation learning. By performing "local" alignment per class rather than "blurring" domains globally, CIDG preserves the structural boundaries necessary for accurate classification.

While CIDG shows significant promise, future work may address its scalability—as kernel methods can be computationally expensive for very large datasets—and explore deep neural network architectures that natively implement these conditional invariance constraints.

Summary updated

BibTeX
@inproceedings{li2018domain,
  author = {Ya Li and Mingming Gong and Xinmei Tian and Tongliang Liu and Dacheng Tao},
  title = {{Domain Generalization via Conditional Invariant Representations}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2018},
  doi = {10.1609/aaai.v32i1.11682},
}
Figure