Out-of-distribution (OOD) generalization is critical for machine learning models deployed in the real world. However, achieving this can be fundamentally challenging, as it requires the ability to learn invariant features across different domains or environments. In this paper, we propose a novel framework HYPO (HYPerspherical OOD generalization) that provably learns domain-invariant representations in a hyperspherical space. In particular, our hyperspherical learning algorithm is guided by intra-class variation and inter-class separation principles -- ensuring that features from the same class (across different training domains) are closely aligned with their class prototypes, while different class prototypes are maximally separated. We further provide theoretical justifications on how our prototypical learning objective improves the OOD generalization bound. Through extensive experiments on challenging OOD benchmarks, we demonstrate that our approach outperforms competitive baselines and achieves superior performance. Code is available at https://github.com/deeplearning-wisc/hypo.
翻译:分布外(OOD)泛化对于部署在现实世界中的机器学习模型至关重要。然而,实现这一目标具有根本性挑战,因为需要具备跨不同领域或环境学习不变特征的能力。本文提出了一种新型框架HYPO(超球面分布外泛化),该框架可在超球面空间中可证明地学习领域不变表征。具体而言,我们的超球面学习算法遵循类内变异与类间分离原则——确保来自同一类别(跨不同训练领域)的特征与其类原型紧密对齐,同时不同类原型实现最大程度分离。我们进一步提供了理论依据,论证了这种原型学习目标如何改进OOD泛化边界。通过在具有挑战性的OOD基准上进行大量实验,我们证明所提方法优于竞争基线方法并实现了卓越性能。代码已开源在https://github.com/deeplearning-wisc/hypo。