Class Is Invariant to Context and Vice Versa: On Learning Invariance for Out-Of-Distribution Generalization
Jiaxin Qi, Kaihua Tang, Qianru Sun, Xian-Sheng Hua, and Hanwang Zhang

TL;DR
This paper proposes a novel approach to improve out-of-distribution generalization by leveraging the invariance of class features to context, using contrastive learning across classes without requiring explicit context labels.
Contribution
It introduces a contrastive learning method that treats classes as varying environments to learn context-invariant features, achieving state-of-the-art OOD performance without explicit context annotations.
Findings
Achieves state-of-the-art OOD generalization on various benchmarks.
Effectively handles imbalanced and biased datasets.
Theoretically justified approach with practical implementation.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsDomain Adaptation and Few-Shot Learning · Hydrological Forecasting Using AI · Anomaly Detection Techniques and Applications
