Prominent Roles of Conditionally Invariant Components in Domain Adaptation: Theory and Algorithms

Keru Wu, Yuansi Chen, Wooseok Ha, Bin Yu

TL;DR

This paper introduces Conditionally Invariant Components (CICs) as a robust anchor for domain adaptation, allowing models to generalize even when both covariate and label distributions shift. The authors leverage CICs to create a new algorithm (IW-CIP), a failure-detection mechanism for existing methods, and an improved version of marginal-matching algorithms (JointDIP) that avoids the common pitfall of "label-flipping."

What Problem Does This Paper Address?

Machine learning models often fail when the data they encounter at test time (the target domain) differs from the data used for training (the source domain). This is the core challenge of Domain Adaptation (DA).

Traditional DA methods usually focus on two specific types of shifts:

  1. Covariate Shift: The distribution of features changes, but the relationship between features and labels stays the same.
  2. Label Shift: The frequency of the labels changes, but the features associated with each label remain consistent.

However, real-world problems are rarely so neat. Often, both happen simultaneously. Furthermore, popular algorithms like Domain Invariant Projection (DIP)—which try to make the source and target feature distributions look identical—can suffer from "label-flipping." This happens when the algorithm matches the overall distribution of features but accidentally maps a "cat" feature in the source to a "dog" feature in the target because it lacks a conditional "sanity check."

Methods

The authors propose focusing on Conditionally Invariant Components (CICs). These are feature representations that remain stable across domains when conditioned on the label. If you know the label is "cat," the distribution of these specific features should look the same in both the hospital you trained in and the hospital where you deployed the model.

The paper introduces three main technical contributions:

  • IW-CIP (Importance-Weighted Conditional Invariant Penalty): A new two-stage algorithm. First, it identifies CICs across multiple source domains using a penalty term. Second, it uses these stable components to estimate "importance weights" to correct for label shift in the target domain.
  • Risk Detection: The authors prove a theorem (Theorem 12) showing that a classifier built on CICs can act as a proxy for target labels. This allows researchers to estimate the target risk of any other DA algorithm without actually having labels for the target data.
  • JointDIP: This enhances the standard DIP algorithm. Instead of just matching the marginal distribution of features, JointDIP matches the joint distribution of the new features and the pre-identified CICs. This "anchors" the learning process, preventing the model from learning features that flip labels.

Datasets

The authors validated their approach across a diverse range of benchmarks:

  • Synthetic SCMs: Linear Structural Causal Models designed to isolate specific shifts (mean shift, label shift, and label-flipping).
  • Rotated MNIST: The classic handwritten digit dataset, where source domains are rotated at different angles and target labels are shifted.
  • CelebA: A large-scale face image dataset, modified with synthetic "color shifts" and "mouth-opening" features to simulate label-flipping scenarios.
  • Camelyon17 (from WILDS): A real-world medical imaging dataset involving tumor detection in lymph node sections across different hospitals.
  • DomainNet: A multi-domain dataset (Clipart, Quickdraw, Real, etc.) transformed into a binary classification task to test style invariance.

Key Insights and Ideas

  • Conditional > Marginal: Matching marginal distributions (making the whole cloud of data look the same) is dangerous. Matching conditional distributions (making the data look the same given a label) is the key to robustness.
  • Heterogeneity is a Strength: Finding CICs requires multiple source domains. While having diverse training data is often seen as a challenge, here it is a tool: features that stay stable across many different source environments are highly likely to remain stable in the unseen target environment.
  • CICs as a "Sanity Check": CIC-based models might be conservative (they discard non-invariant features that could be useful), but they are reliable. This reliability makes them excellent "detectors" for when more aggressive, risky algorithms (like DIP) are about to fail.

Key Results

  • Handling Complex Shifts: In synthetic tests where mean shift, label shift, and label-flipping all occurred simultaneously (SCM IV), IW-JointDIP achieved 85.1% accuracy, significantly outperforming standard ERM (58.7%) and standard DIP (35.3%).
  • Real-World Medical Data: On the Camelyon17 dataset, JointDIP-Pool reached 91.9% accuracy, outperforming the standard WILDS benchmark leaders like IRM (64.2%) and CORAL (77.9%).
  • Failure Detection: The authors successfully demonstrated that their theoretical lower bounds could predict when DIP would fail on MNIST rotations, providing a "red flag" for practitioners before deployment.

Limitations and Future Work

  • Requirement for Multiple Sources: The method relies on having multiple source domains to identify what is truly invariant. If only one source domain is available, identifying CICs becomes much more difficult.
  • Conservative Nature: By strictly adhering to conditionally invariant features, the model might ignore "style" features that are actually helpful for prediction in a specific target domain.
  • Future Directions: The authors suggest exploring how to select the best subset of source domains when some are unrelated to the target, and extending these guarantees to "semi-supervised" settings where a tiny amount of target labels might be available.

Summary updated

BibTeX
@misc{wu2023prominent,
  author = {Keru Wu and Yuansi Chen and Wooseok Ha and Bin Yu},
  title = {{Prominent Roles of Conditionally Invariant Components in Domain Adaptation: Theory and Algorithms}},
  year = {2023},
  eprint = {2309.10301},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2309.10301},
}
Figure