[Paper Review] Learning to Generalize across Domains on Single Test Samples
This paper proposes a meta-learning framework that enables deep models to adapt to unseen target domains using only a single test sample, without fine-tuning or additional training. By formulating adaptation as variational Bayesian inference conditioned on individual test samples, the model achieves state-of-the-art performance on domain generalization benchmarks with just one forward pass per test sample.
We strive to learn a model from a set of source domains that generalizes well to unseen target domains. The main challenge in such a domain generalization scenario is the unavailability of any target domain data during training, resulting in the learned model not being explicitly adapted to the unseen target domains. We propose learning to generalize across domains on single test samples. We leverage a meta-learning paradigm to learn our model to acquire the ability of adaptation with single samples at training time so as to further adapt itself to each single test sample at test time. We formulate the adaptation to the single test sample as a variational Bayesian inference problem, which incorporates the test sample as a conditional into the generation of model parameters. The adaptation to each test sample requires only one feed-forward computation at test time without any fine-tuning or self-supervised training on additional data from the unseen domains. Extensive ablation studies demonstrate that our model learns the ability to adapt models to each single sample by mimicking domain shifts during training. Further, our model achieves at least comparable -- and often better -- performance than state-of-the-art methods on multiple benchmarks for domain generalization.
Motivation & Objective
- To address domain generalization in scenarios where target domain data is unavailable during training.
- To enable models to adapt effectively to unseen target domains using only a single test sample per inference.
- To eliminate the need for fine-tuning or auxiliary networks at test time, preserving the strict source-target data separation of domain generalization.
- To improve robustness and generalization under low-data and multi-domain target scenarios.
Proposed method
- The method employs meta-learning to train a model to adapt to single test samples during inference, mimicking domain shift during training.
- Adaptation is formulated as a variational Bayesian inference problem, where the test sample conditions the generation of model parameters.
- The model uses a single feed-forward pass at test time to produce domain-adapted predictions, without any fine-tuning or extra network parameters.
- The meta-learner is trained on source domains to learn a prior over model weights that can be rapidly adapted to any single target sample.
- The adaptation mechanism generates new classifier prototypes by combining source features and the single target sample’s features, improving alignment with the target distribution.
- The method does not require access to target data during training or any additional training on target data at inference time.
Experimental results
Research questions
- RQ1Can a model learn to adapt to unseen target domains using only a single test sample, without access to target data during training?
- RQ2How effective is meta-learning in enabling rapid, single-sample adaptation for domain generalization?
- RQ3Does variational Bayesian inference provide a robust and scalable way to condition model parameters on individual test samples?
- RQ4How does the method perform under low-data or multi-domain target scenarios compared to existing test-time adaptation methods?
- RQ5Can the model generalize across diverse domains without knowing domain identities or requiring batch-level target data?
Key findings
- The proposed method achieves state-of-the-art mean accuracy on PACS (71.07% with ResNet-50) and Office-Home (66.02% with ResNet-18), outperforming prior methods.
- On PACS, the method achieves 87.51% accuracy with ResNet-50, surpassing the SOTA method by Wang et al. (2021), which used 128 target samples for fine-tuning.
- The method shows superior robustness to small or single-sample target batches, where methods like Tent degrade significantly.
- Ablation studies confirm that meta-learning is essential for the adaptation capability, as performance drops without it.
- The model generalizes effectively across multiple target domains without domain identifiers, handling each sample independently with per-sample adaptation.
- The method maintains strong performance on rotated-MNIST and Fashion-MNIST, demonstrating broad applicability across datasets.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.