Out-Of-Distribution generalization (OOD) is all about learning invariance against environmental changes. If the context in every class is evenly distributed, OOD would be trivial because the context can be easily removed due to an underlying principle: class is invariant to context. However, collecting such a balanced dataset is impractical. Learning on imbalanced data makes the model bias to context and thus hurts OOD. Therefore, the key to OOD is context balance. We argue that the widely adopted assumption in prior work, the context bias can be directly annotated or estimated from biased class prediction, renders the context incomplete or even incorrect. In contrast, we point out the everoverlooked other side of the above principle: context is also invariant to class, which motivates us to consider the classes (which are already labeled) as the varying environments to resolve context bias (without context labels). We implement this idea by minimizing the contrastive loss of intra-class sample similarity while assuring this similarity to be invariant across all classes. On benchmarks with various context biases and domain gaps, we show that a simple re-weighting based classifier equipped with our context estimation achieves state-of-the-art performance. We provide the theoretical justifications in Appendix and codes on https://github.com/simpleshinobu/IRMCon.
翻译:类别在上下文中是不变的,反之亦然:关于学习对于跨分布泛化的不变性。
翻译摘要:
跨分布泛化(OOD)涉及学习对于环境变化的不变性。如果每个类别中的上下文均匀分布,OOD将是微不足道的,因为类别在上下文中是不变的,上下文可以很容易地被移除,这是一种基本原则。然而,收集这样平衡的数据集是不切实际的。在不平衡的数据上学习会使模型对上下文产生偏见,因此会损害OOD。因此,OOD的关键是上下文平衡。我们认为先前工作中广泛采用的假设,即从有偏的类别预测中直接注释或估计上下文偏差,使上下文不完整甚至不正确。相反,我们指出了上述原则的另一面,即上下文也不变,这激发了我们考虑将类别(已经标记)作为不同的环境来解决上下文偏差(没有上下文标签)。我们通过最小化某一类内样本相似性的对比损失来实现这一想法,同时确保这种相似性对于所有类别都是不变的。在具有各种上下文偏差和领域差异的基准测试中,我们展示了一个简单的基于重新加权的分类器,配备我们的上下文估计来实现最先进的性能。我们在附录中提供了理论证明和 https://github.com/simpleshinobu/IRMCon 上的代码。