Introduction
Domain Generalization (DG) addresses the challenge of training models on multiple source domains to ensure robust performance on an unseen target domain. In real-world scenarios, data distributions often shift—for instance, an image classifier trained on one camera brand may fail on another due to varying sensor properties. Domain2Vec (D2V) proposes a solution by learning domain-specific embeddings that act as "fingerprints" of the data distribution, enabling models to adapt without needing target-domain labels at test time.
Methodology
The D2V architecture integrates two primary components to achieve contextual classification:
- Task Network: This network processes a batch of data from a single domain to learn a domain-specific statistic, $T_X \in R^D$. This vector embedding represents the marginal distribution of the domain and is designed to be permutation invariant, ensuring it learns the distribution rather than specific data sequences.
- Main Network: This extracts standard features, $\Phi(X) \in R^{d'}$, from individual data points.
The core innovation lies in concatenating the domain embedding $T_X$ with the point features $\Phi(X)$. This augmented vector allows the final classifier to interpret features within their specific distributional context, effectively shifting decision boundaries based on domain characteristics.
Experimental Evaluation
The authors evaluated D2V using two primary benchmarks:
- Synthetic 2D Dataset: Data points in a unit box are rotated by an angle $\theta$, creating distinct domains. This tests the model's ability to capture geometric shifts via its embeddings.
- VLCS Benchmark: A real-world image dataset comprising VOC2007, LabelMe, Caltech-101, and SUN09, which share object classes but differ significantly in photo style and background.
Results and Discussion
D2V demonstrated significant improvements over traditional pooling methods. In the synthetic rotation task, D2V achieved 96% accuracy, compared to 73% for a standard pooling network. On the VLCS benchmark, D2V reached an average accuracy of 70.82%, outperforming multi-task autoencoders and domain-adversarial methods.
A key insight is that the learned embeddings $T_X$ capture physical domain properties; in synthetic tests, embedding similarity correlated strongly with true rotation differences. Furthermore, the model's performance scales effectively with both the number of domains and the number of examples per domain, as shown in the heatmap above, reaching peak performance with more diverse and dense source data.
Conclusion
Domain2Vec provides a robust framework for deep domain generalization by leveraging contextual embeddings. While currently tested on relatively shallow architectures and image/synthetic data, future work aims to scale D2V to deeper models like Transformers and extend its application to text and speech modalities where "domain" might refer to different languages or acoustic environments.
Summary updated