论文标题
与最近的邻居分发检测
Out-of-Distribution Detection with Deep Nearest Neighbors
论文作者
论文摘要
分布(OOD)检测是在开放世界中部署机器学习模型的关键任务。基于距离的方法已经证明了有望,如果测试样品离分布(ID)数据相对遥远,则将测试样品视为OOD。但是,先前的方法对基础特征空间施加了强有力的分布假设,这可能并不总是存在。在本文中,我们探讨了非参数最近邻居距离的疗效,以检测OOD,这在文献中很大程度上被忽略了。与先前的工作不同,我们的方法不会施加任何分布假设,因此提供了更强的灵活性和一般性。我们证明了基于邻居的OOD检测在几个基准测试中的有效性,并建立了卓越的性能。在对Imagenet-1K训练的同一模型下,我们的方法将假阳性率(FPR@tpr95)降低了24.77%,而强劲的基线SSD+使用了参数方法Mahalanobis在检测中。代码可用:https://github.com/deeplearning-wisc/knn-ood。
Out-of-distribution (OOD) detection is a critical task for deploying machine learning models in the open world. Distance-based methods have demonstrated promise, where testing samples are detected as OOD if they are relatively far away from in-distribution (ID) data. However, prior methods impose a strong distributional assumption of the underlying feature space, which may not always hold. In this paper, we explore the efficacy of non-parametric nearest-neighbor distance for OOD detection, which has been largely overlooked in the literature. Unlike prior works, our method does not impose any distributional assumption, hence providing stronger flexibility and generality. We demonstrate the effectiveness of nearest-neighbor-based OOD detection on several benchmarks and establish superior performance. Under the same model trained on ImageNet-1k, our method substantially reduces the false positive rate (FPR@TPR95) by 24.77% compared to a strong baseline SSD+, which uses a parametric approach Mahalanobis distance in detection. Code is available: https://github.com/deeplearning-wisc/knn-ood.