In this paper, we propose energy-based sample adaptation at test time for domain generalization. Where previous works adapt their models to target domains, we adapt the unseen target samples to source-trained models. To this end, we design a discriminative energy-based model, which is trained on source domains to jointly model the conditional distribution for classification and data distribution for sample adaptation. The model is optimized to simultaneously learn a classifier and an energy function. To adapt target samples to source distributions, we iteratively update the samples by energy minimization with stochastic gradient Langevin dynamics. Moreover, to preserve the categorical information in the sample during adaptation, we introduce a categorical latent variable into the energy-based model. The latent variable is learned from the original sample before adaptation by variational inference and fixed as a condition to guide the sample update. Experiments on six benchmarks for classification of images and microblog threads demonstrate the effectiveness of our proposal.
翻译:本文提出了一种基于能量的测试时样本自适应方法,用于解决领域泛化问题。与以往将模型适配到目标域的研究不同,我们通过将未见过的目标样本适配到源域预训练模型来实现领域适应。为此,我们设计了一个判别式能量模型,该模型在源域上训练,能同时建模用于分类的条件分布和用于样本自适应的数据分布。该模型通过联合优化分类器与能量函数实现协同学习。为将目标样本适配至源域分布,我们采用随机梯度Langevin动力学通过能量最小化迭代更新样本。此外,为在自适应过程中保留样本的类别信息,我们在能量模型中引入类别隐变量。该隐变量通过变分推断从自适应前的原始样本中学习获得,并作为固定条件引导样本更新。在六个图像分类和微博话题分类基准上的实验结果验证了本方法的有效性。