HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

Out-of-Distribution Detection with Deep Nearest Neighbors

Yiyou Sun Yifei Ming Xiaojin Zhu Yixuan Li

Out-of-Distribution Detection with Deep Nearest Neighbors

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.

Code Repositories

deeplearning-wisc/knn-ood
Official
pytorch
Mentioned in GitHub
ArthurHoa/deep-eknn
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
out-of-distribution-detection-on-imagenet-1k-10KNN (ResNet-50 SupCon)
AUROC: 94.45
FPR95: 16.97
out-of-distribution-detection-on-imagenet-1k-10KNN (ResNet-50)
AUROC: 97.18
FPR95: 11.56
out-of-distribution-detection-on-imagenet-1k-3KNN (ResNet-50 SupCon)
AUROC: 94.72
FPR95: 30.83
out-of-distribution-detection-on-imagenet-1k-3KNN (ResNet-50)
AUROC: 86.2
FPR95: 59.08
out-of-distribution-detection-on-imagenet-1k-8KNN (ResNet-50 SupCon)
AUROC: 88.40
FPR95: 48.91
out-of-distribution-detection-on-imagenet-1k-8KNN (ResNet-50)
AUROC: 80.10
FPR95: 69.53
out-of-distribution-detection-on-imagenet-1k-9KNN (ResNet-50)
AUROC: 74.87
FPR95: 77.09
out-of-distribution-detection-on-imagenet-1k-9KNN (ResNet-50 SupCon)
AUROC: 84.62
FPR95: 60.02

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
Out-of-Distribution Detection with Deep Nearest Neighbors | Papers | HyperAI