Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Out-of-Distribution Detection with Deep Nearest Neighbors

About

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.

Yiyou Sun, Yifei Ming, Xiaojin Zhu, Yixuan Li• 2022

Related benchmarks

TaskDatasetResultRank
Image ClassificationImageNet-1K--
600
Out-of-Distribution DetectioniNaturalist
AUROC94.52
219
Out-of-Distribution DetectionSUN OOD with ImageNet-1k In-distribution (test)
FPR@9526.72
204
Out-of-Distribution DetectionTextures
AUROC0.9718
168
Out-of-Distribution DetectionPlaces
FPR9539.61
142
Out-of-Distribution DetectionImageNet OOD Average 1k (test)
FPR@9529.31
137
Out-of-Distribution DetectionImageNet-1k ID iNaturalist OOD
FPR9529.17
132
OOD DetectionCIFAR-10 (IND) SVHN (OOD)
AUROC0.9942
131
Out-of-Distribution DetectionCIFAR-10
AUROC97.58
121
OOD DetectionCIFAR-10 (ID) vs Places 365 (OOD)
AUROC98.74
117
Showing 10 of 288 rows
...

Other info

Code

Follow for update