In the context of modern machine learning, models deployed in real-world scenarios often encounter diverse data shifts like covariate and semantic shifts, leading to challenges in both out-of-distribution (OOD) generalization and detection. Despite considerable attention to these issues separately, a unified framework for theoretical understanding and practical usage is lacking. To bridge the gap, we introduce a graph-theoretic framework to jointly tackle both OOD generalization and detection problems. By leveraging the graph formulation, data representations are obtained through the factorization of the graph's adjacency matrix, enabling us to derive provable error quantifying OOD generalization and detection performance. Empirical results showcase competitive performance in comparison to existing methods, thereby validating our theoretical underpinnings. Code is publicly available at https://github.com/deeplearning-wisc/graph-spectral-ood.
翻译:在现代机器学习背景下,部署于实际场景的模型常遭遇协变量偏移与语义偏移等多种数据分布变化,这给分布外(OOD)泛化与检测均带来了挑战。尽管这些问题已分别受到广泛关注,但目前仍缺乏统一的理论理解与实践应用框架。为弥补这一空白,我们提出一种图论框架以协同解决OOD泛化与检测问题。通过利用图结构建模,数据表示可通过分解图的邻接矩阵获得,从而使我们能够推导出可证明的误差度量,以量化OOD泛化与检测性能。实验结果表明,相较于现有方法,本框架取得了具有竞争力的性能,从而验证了我们的理论基础。代码公开于 https://github.com/deeplearning-wisc/graph-spectral-ood。