Domain Conditional Predictors for Domain Adaptation

João Monteiro, Xavier Gibert Serra, Jianqiao Feng, Vincent Dumoulin, Dar-Shyang Lee

Introduction

Instead of forcing machine learning models to ignore the differences between data sources—a concept known as domain invariance—this paper proposes Domain Conditional Predictors. By utilizing a secondary network to extract domain-specific context and "conditioning" the main model via FiLM layers, the authors achieve state-of-the-art performance. Crucially, this method offers a much simpler and more stable training process than traditional adversarial approaches.

The Challenge of Domain Shift

Most machine learning models rely on the "i.i.d. assumption": the premise that training and test data come from the same independent and identically distributed source. In real-world applications, this assumption frequently collapses. For instance, a model trained exclusively on photographs of objects will likely struggle to recognize those same objects in sketches—a phenomenon known as domain shift.

The standard playbook for addressing this involves Domain Adaptation (DA) or Domain Generalization (DG). Researchers typically strive for domain invariance, often employing adversarial training to "trick" the model into ignoring domain-specific features (like lighting, background, or artistic style) so it focuses solely on the core object. However, this approach introduces two major hurdles:

  1. Instability: It relies heavily on "minimax" adversarial formulations, which are notoriously difficult to train, sensitive to hyperparameters, and prone to crashing.
  2. Restrictive Assumptions: It often assumes "covariate shift," meaning the relationship between features and labels remains exactly the same across domains, which is rarely true in practice.

Embracing Domain Context

The authors flip the traditional script: rather than ignoring the domain, they embrace it as context.

Architecture and FiLM Layers

The proposed architecture utilizes two distinct neural networks:

  • $M_{domain}$: A network that analyzes the input and extracts a "domain embedding" ($z$).
  • $M_{task}$: The primary predictor network, which takes both the original input and the domain embedding $z$.

To allow $z$ to influence the main model, the authors employ FiLM (Feature-wise Linear Modulation) layers. Essentially, $z$ dictates how the main network should scale and shift its internal features: $FiLM(x, z) = \gamma(z)F(x) + \beta(z)$. This mechanism allows the model to dynamically "reconfigure" itself based on the environment it perceives.

Regularization and Self-Modulation

To prevent the model from becoming overly complex and overfitting to specific domains, the authors introduce a penalty ($\Omega_{FiLM}$). This regularization encourages the FiLM layers to remain close to an "identity map" (effectively doing nothing) unless the domain information is genuinely useful for the task.

In a fascinating twist, the researchers also tested a "self-modulated" version where domain labels are withheld during training. The model is forced to deduce the context entirely on its own, proving highly effective.

Datasets and Evaluation

The authors evaluated their approach across several rigorous domain generalization benchmarks:

  • MNIST (Proof of Concept): The team applied transformations like horizontal flips, color swaps, blurring, and rotations to simulate distinct domains.
Examples of MNIST transformations used to simulate different domains.
  • PACS: A classic benchmark featuring four distinct visual domains: Photo, Art painting, Cartoon, and Sketch.
  • VLCS: A compilation of images from four different datasets (VOC2007, LabelMe, Caltech-101, SUN).
  • OfficeHome: A dataset containing 65 classes across four domains (Art, Clipart, Product, Real-world).
  • DomainNet: A massive-scale dataset featuring 345 classes distributed across 6 distinct domains.

Key Insights and Results

The results demonstrate that forcing a model to be "blind" to domains can actually hinder its learning capacity. By allowing the model to "know" its domain, it utilizes its full representational power more effectively.

  • State-of-the-Art Performance: On the PACS dataset, the Domain Conditional Predictor matched or outperformed leading invariant methods, achieving 86.28% accuracy on Art Painting and 96.75% on Photos.
  • Outperforming Privileged Baselines: On the massive DomainNet dataset, the proposed model outperformed several "privileged" baselines—models that were given the unfair advantage of seeing unlabeled data from the target domain during training.
  • The Power of Self-Modulation: Even when domain labels were dropped, the self-modulated model naturally learned to cluster data by domain. This suggests that high-capacity models inherently pick up on domain context; the proposed architecture simply provides a formal mechanism to exploit it.
  • Training Stability: Because this method relies on standard maximum likelihood estimation rather than adversarial training, it avoids the delicate balancing act required by models like DANN, making it far more practical for real-world engineering.

Limitations and Future Directions

While highly effective, the approach has a few limitations. Running a separate $M_{domain}$ network to extract the context $z$ introduces additional computational overhead during inference. Furthermore, the current model infers the domain context from a single image at test time.

The authors suggest that using a small batch of unlabeled images at test time could yield a more stable estimate of $z$, further boosting performance. Additionally, a promising future direction involves integrating actual metadata (such as GPS coordinates, timestamps, or camera settings) as the conditioning variable $z$, rather than relying solely on pixel-derived embeddings.

Summary updated

BibTeX
@inproceedings{monteiro2020domain,
  author = {João Monteiro and Xavier Gibert Serra and Jianqiao Feng and Vincent Dumoulin and Dar-Shyang Lee},
  title = {{Domain Conditional Predictors for Domain Adaptation}},
  booktitle = {Preregister @ NeurIPS},
  year = {2020},
}
Figure