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.
翻译:远程方法显示有希望,测试样品被检测为OOD,如果它们相对远离分布(ID)数据。然而,先前的方法对基本地貌空间的分布假设力强,但不一定总能维持。在本文中,我们探讨了非参数近邻距离对OOOD探测的功效,文献中基本上忽视了这一功效。与以前的工作不同,我们的方法没有强加任何分配假设,从而提供了更大的灵活性和普遍性。我们展示了以近邻为基础的OOOD探测在几个基准上的有效性,并确立了更高的性能。根据在图像Net-1k上培训的同一模型,我们的方法大大降低了假阳率(FPR@TPR95)24.77%,而其基准为SSD+,在探测时使用了对等方法的马哈拉诺比距离。代码:https://github.com/deepleclearning-wisc/knn-ood。