Nearest Neighbor Guidance for Out-of-Distribution Detection
Jaewoo Park, Yoon Gyo Jung, Andrew Beng Jin Teoh
Code Available — Be the first to reproduce this paper.
ReproduceCode
- github.com/jingkang50/openoodOfficialIn paperpytorch★ 1,040
- github.com/roomo7time/nnguideOfficialIn paperpytorch★ 22
Abstract
Detecting out-of-distribution (OOD) samples are crucial for machine learning models deployed in open-world environments. Classifier-based scores are a standard approach for OOD detection due to their fine-grained detection capability. However, these scores often suffer from overconfidence issues, misclassifying OOD samples distant from the in-distribution region. To address this challenge, we propose a method called Nearest Neighbor Guidance (NNGuide) that guides the classifier-based score to respect the boundary geometry of the data manifold. NNGuide reduces the overconfidence of OOD samples while preserving the fine-grained capability of the classifier-based score. We conduct extensive experiments on ImageNet OOD detection benchmarks under diverse settings, including a scenario where the ID data undergoes natural distribution shift. Our results demonstrate that NNGuide provides a significant performance improvement on the base detection scores, achieving state-of-the-art results on both AUROC, FPR95, and AUPR metrics. The code is given at https://github.com/roomo7time/nnguide.
Tasks
Benchmark Results
| Dataset | Model | Metric | Claimed | Verified | Status |
|---|---|---|---|---|---|
| ImageNet-1k vs Curated OODs (avg.) | NNGuide (ResNet50 w/ ReAct) | FPR95 | 19.72 | — | Unverified |
| ImageNet-1k vs Curated OODs (avg.) | NNGuide (RegNet) | FPR95 | 17.97 | — | Unverified |
| ImageNet-1K vs ImageNet-O | NNGuide-ViM (ViT-B/16) | FPR95 | 33.1 | — | Unverified |
| ImageNet-1k vs iNaturalist | NNGuide (RegNet) | AUROC | 99.57 | — | Unverified |
| ImageNet-1k vs iNaturalist | NNGuide (ResNet50 w/ ReAct) | AUROC | 97.7 | — | Unverified |
| ImageNet-1k vs OpenImage-O | NNGuide (RegNet) | AUROC | 97.73 | — | Unverified |
| ImageNet-1k vs OpenImage-O | NNGuide (ResNet50 w/ ReAct) | AUROC | 92.49 | — | Unverified |
| ImageNet-1k vs Places | NNGuide (RegNet) | FPR95 | 31.47 | — | Unverified |
| ImageNet-1k vs SUN | NNGuide (RegNet) | FPR95 | 21.58 | — | Unverified |
| ImageNet-1k vs Textures | NNGuide (RegNet) | AUROC | 95.82 | — | Unverified |
| ImageNet-1k vs Textures | NNGuide (ResNet50 w/ ReAct) | AUROC | 96.11 | — | Unverified |