Hierarchical Variational Auto-Encoding for Unsupervised Domain Generalization

Xudong Sun, Florian Buettner

TL;DR

This paper introduces HDUVA, a novel hierarchical variational autoencoder for domain generalization that learns to adapt to new, unseen data distributions without requiring explicit domain labels during training. By disentangling domain-specific and class-specific information in a hierarchical manner, HDUVA achieves state-of-the-art performance on challenging domain generalization benchmarks, particularly those with complex, hierarchical, or continuous domain shifts.

What Problem Does This Paper Address?

Deploying machine learning models in real-world scenarios often faces the challenge of "domain shift," where the data distribution at test time differs from the training data. Domain generalization aims to train a model that can adapt to these unseen domains without explicit retraining. A key difficulty arises when domain structures are not clearly defined or observable during training, such as in personalized medicine (each patient is a domain) or industrial applications where data privacy concerns limit explicit domain labeling. Existing methods often rely on observable domain labels, which is not always feasible. Furthermore, many approaches struggle with complex domain shifts like hierarchical structures (e.g., country > factory > machine) or continuous changes, and interpretability of the learned representations is often lacking.

Methods

The core contribution is HDUVA (Hierarchical Domain Unsupervised Variational Auto-encoding), a generative model built upon variational autoencoders (VAEs). HDUVA introduces a hierarchical latent space to disentangle different sources of variation:

  • Class-specific information ($z_y$): Captures the information related to the actual class label.
  • Domain-specific information ($z_d$): Encodes characteristics specific to a particular domain.
  • Hierarchical Domain Structure ($s$): A novel continuous latent variable that models the underlying, potentially unobserved, domain structure. This is a key innovation, allowing for more flexible domain representation than traditional one-hot encodings. HDUVA uses a Dirichlet prior on $s$, treating it as a "topic" that can represent nuanced domain relationships.
  • Residual variance ($z_x$): Accounts for remaining variations in the input.

The model is trained by maximizing an "extended ELBO" (Evidence Lower Bound), which serves as both the training objective and a model selection criterion, eliminating the need for a separate validation set. The paper also proposes methods for "weak domain supervision," allowing the incorporation of partial domain information.

Datasets

The paper introduces new benchmark datasets for hierarchical and sequential domain generalization:

  • Color-Mnist: Modified MNIST dataset where both foreground and background colors are used to create sub-domains, forming hierarchical nominal domains. This was used to simulate scenarios with incomplete or hierarchical domain knowledge.
  • Sequential Color-Mnist (VLAG Palette): A variation of Color-Mnist designed to simulate near-continuous domain shifts by using a smooth color palette.

Existing datasets used for evaluation include:

  • PACS: A standard domain generalization benchmark dataset.
  • Malaria Dataset: Used to evaluate performance in medical image classification, where patients are grouped into hospitals (hierarchical domains).

Key Insights and Ideas

  • Unsupervised Domain Generalization is Achievable: HDUVA demonstrates that effective domain generalization can be achieved without explicit domain labels, opening up applications where such labels are unavailable or impractical.
  • Hierarchical Latent Space for Disentanglement: The hierarchical structure of HDUVA's latent space is crucial for disentangling domain-specific and class-specific information, even in complex scenarios. The continuous latent variable $s$ is particularly effective for modeling nuanced domain relationships.
  • ELBO as Model Selection: Using the extended ELBO for model selection simplifies the training pipeline and removes the dependency on validation sets, which can be problematic in domain generalization settings.
  • Interpretability through Topics: The hierarchical domain variable $s$ can be interpreted as "topics," providing insights into how different domains relate to each other.
  • Robustness to Complex Domain Shifts: HDUVA shows superior performance on hierarchical, near-continuous, and overlapped domain shifts compared to existing methods.

Key Results

  • Outperforms State-of-the-Art: HDUVA achieves competitive or superior performance compared to existing generative and non-generative domain generalization methods on various benchmarks, including Color-Mnist, Sequential Color-Mnist, and PACS.
  • Hierarchical Domains: On Color-Mnist with hierarchical sub-domains, HDUVA significantly outperforms DIVA, demonstrating its ability to handle complex domain structures. For example, on Test Domain 1, HDUVA achieved 0.93 ± 0.02 accuracy, while DIVA achieved 0.88 ± 0.05.
  • Continuous Domain Shift: In the Sequential Color-Mnist scenario, HDUVA achieved 0.69 ± 0.05 accuracy on Test Domain 1, outperforming DIVA (0.63 ± 0.05) and Match-DG (0.67 ± 0.06).
  • Medical Image Classification: On the Malaria dataset, HDUVA achieved 0.87 ± 0.05 accuracy, outperforming DIVA (0.83 ± 0.06) and MatchDG (0.85 ± 0.09), showcasing its effectiveness in hierarchical settings.
  • PACS Benchmark: On the standard PACS dataset, HDUVA achieved an average accuracy of 69.80%, competitive with other state-of-the-art methods.
  • Interpretability: Qualitative results show HDUVA's ability to generate images that retain domain-specific characteristics while changing class-specific content, and topic plots demonstrate meaningful domain embeddings.

Limitations and Future Work

  • Hyperparameter Sensitivity: While the ELBO serves as a model selection criterion, the paper acknowledges that some hyperparameters (like $\gamma_y$) still require tuning, and suggests reporting validation accuracy during hyperparameter search to ensure robustness.
  • Computational Cost: Generative models, especially VAEs, can be computationally intensive. While not explicitly detailed as a limitation, it's an inherent aspect of the approach.
  • Weak Domain Supervision: The paper introduces weak domain supervision as a way to improve performance by incorporating partial domain information, suggesting this as a promising avenue for further exploration.
  • Alternative Inference: The paper presents an alternative inference algorithm (LHDUVA) inspired by Ladder-VAE, indicating ongoing research into optimizing the inference process.
  • Domain Embedding Tool: The authors suggest exploring HDUVA's potential as a domain embedding tool for downstream tasks.

Summary updated

BibTeX
@misc{sun2021hierarchical,
  author = {Xudong Sun and Florian Buettner},
  title = {{Hierarchical Variational Auto-Encoding for Unsupervised Domain Generalization}},
  year = {2021},
  eprint = {2101.09436},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2101.09436},
}
Figure