When deploying a trained machine learning model in the real world, it is inevitable to receive inputs from out-of-distribution (OOD) sources. For instance, in continual learning settings, it is common to encounter OOD samples due to the non-stationarity of a domain. More generally, when we have access to a set of test inputs, the existing rich line of OOD detection solutions, especially the recent promise of distance-based methods, falls short in effectively utilizing the distribution information from training samples and test inputs. In this paper, we argue that empirical probability distributions that incorporate geometric information from both training samples and test inputs can be highly beneficial for OOD detection in the presence of test inputs available. To address this, we propose to model OOD detection as a discrete optimal transport problem. Within the framework of optimal transport, we propose a novel score function known as the \emph{conditional distribution entropy} to quantify the uncertainty of a test input being an OOD sample. Our proposal inherits the merits of certain distance-based methods while eliminating the reliance on distribution assumptions, a-prior knowledge, and specific training mechanisms. Extensive experiments conducted on benchmark datasets demonstrate that our method outperforms its competitors in OOD detection.
翻译:在现实世界中部署训练好的机器学习模型时,不可避免地会遇到来自分布外(OOD)源的输入。例如,在持续学习场景中,由于领域的非平稳性,经常遭遇OOD样本。更一般地,当获取到一组测试输入样本时,现有丰富的OOD检测方案(尤其是近期颇具前景的基于距离的方法)在有效利用训练样本和测试输入的分布信息方面存在不足。本文论证,在可获取测试输入的情况下,融合训练样本与测试输入几何信息的经验概率分布对OOD检测极为有利。为此,我们提出将OOD检测建模为离散最优传输问题。在最优传输框架下,我们提出了一种新颖的评分函数——条件分布熵(conditional distribution entropy),用以量化测试输入属于OOD样本的不确定性。本方法继承了若干基于距离方法的优点,同时消除了对分布假设、先验知识及特定训练机制的依赖。在基准数据集上开展的大量实验表明,本方法在OOD检测任务中优于现有竞争方法。