SOTAVerified

Out-of-Distribution Detection with Deep Nearest Neighbors

2022-04-13Code Available1· sign in to hype

Yiyou Sun, Yifei Ming, Xiaojin Zhu, Yixuan Li

Code Available — Be the first to reproduce this paper.

Reproduce

Code

Abstract

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.

Tasks

Benchmark Results

DatasetModelMetricClaimedVerifiedStatus
ImageNet-1k vs iNaturalistKNN (ResNet-50 SupCon)AUROC94.72Unverified
ImageNet-1k vs iNaturalistKNN (ResNet-50)AUROC86.2Unverified
ImageNet-1k vs PlacesKNN (ResNet-50 SupCon)FPR9560.02Unverified
ImageNet-1k vs PlacesKNN (ResNet-50)FPR9577.09Unverified
ImageNet-1k vs SUNKNN (ResNet-50)FPR9569.53Unverified
ImageNet-1k vs SUNKNN (ResNet-50 SupCon)FPR9548.91Unverified
ImageNet-1k vs TexturesKNN (ResNet-50)AUROC97.18Unverified
ImageNet-1k vs TexturesKNN (ResNet-50 SupCon)AUROC94.45Unverified

Reproductions