TasksSotADatasetsPapersMethodsSubmitAbout
Papers With Code 2

A community resource for machine learning research: papers, code, benchmarks, and state-of-the-art results.

Explore

Notable BenchmarksAll SotADatasetsPapersMethods

Community

Submit ResultsAbout

Data sourced from the PWC Archive (CC-BY-SA 4.0). Built by the community, for the community.

Papers/Nearest Neighbor Guidance for Out-of-Distribution Detection

Nearest Neighbor Guidance for Out-of-Distribution Detection

Jaewoo Park, Yoon Gyo Jung, Andrew Beng Jin Teoh

2023-09-26Out-of-Distribution Detection
PaperPDFCode(official)Code(official)

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 \url{https://github.com/roomo7time/nnguide}.

Results

TaskDatasetMetricValueModel
Out-of-Distribution DetectionImageNet-1k vs OpenImage-OAUROC97.73NNGuide (RegNet)
Out-of-Distribution DetectionImageNet-1k vs OpenImage-OFPR9510.79NNGuide (RegNet)
Out-of-Distribution DetectionImageNet-1k vs OpenImage-OLatency, ms31NNGuide (RegNet)
Out-of-Distribution DetectionImageNet-1k vs OpenImage-OAUROC92.49NNGuide (ResNet50 w/ ReAct)
Out-of-Distribution DetectionImageNet-1k vs OpenImage-OFPR9535.1NNGuide (ResNet50 w/ ReAct)
Out-of-Distribution DetectionImageNet-1k vs OpenImage-OLatency, ms11.1NNGuide (ResNet50 w/ ReAct)
Out-of-Distribution DetectionImageNet-1K vs ImageNet-OAUROC92.96NNGuide-ViM (ViT-B/16)
Out-of-Distribution DetectionImageNet-1K vs ImageNet-OFPR9533.1NNGuide-ViM (ViT-B/16)
Out-of-Distribution DetectionImageNet-1k vs iNaturalistAUROC99.57NNGuide (RegNet)
Out-of-Distribution DetectionImageNet-1k vs iNaturalistFPR951.83NNGuide (RegNet)
Out-of-Distribution DetectionImageNet-1k vs iNaturalistLatency, ms31NNGuide (RegNet)
Out-of-Distribution DetectionImageNet-1k vs iNaturalistAUROC97.7NNGuide (ResNet50 w/ ReAct)
Out-of-Distribution DetectionImageNet-1k vs iNaturalistFPR9511.12NNGuide (ResNet50 w/ ReAct)
Out-of-Distribution DetectionImageNet-1k vs iNaturalistLatency, ms11.1NNGuide (ResNet50 w/ ReAct)
Out-of-Distribution DetectionImageNet-1k vs TexturesAUROC96.11NNGuide (ResNet50 w/ ReAct)
Out-of-Distribution DetectionImageNet-1k vs TexturesFPR9517.27NNGuide (ResNet50 w/ ReAct)
Out-of-Distribution DetectionImageNet-1k vs TexturesLatency, ms11.1NNGuide (ResNet50 w/ ReAct)
Out-of-Distribution DetectionImageNet-1k vs TexturesAUROC95.82NNGuide (RegNet)
Out-of-Distribution DetectionImageNet-1k vs TexturesFPR9517NNGuide (RegNet)
Out-of-Distribution DetectionImageNet-1k vs TexturesLatency, ms31NNGuide (RegNet)
Out-of-Distribution DetectionImageNet-1k vs PlacesAUROC91.87NNGuide (RegNet)
Out-of-Distribution DetectionImageNet-1k vs PlacesFPR9531.47NNGuide (RegNet)
Out-of-Distribution DetectionImageNet-1k vs SUNAUROC94.43NNGuide (RegNet)
Out-of-Distribution DetectionImageNet-1k vs SUNFPR9521.58NNGuide (RegNet)
Out-of-Distribution DetectionImageNet-1k vs Curated OODs (avg.)AUROC95.42NNGuide (RegNet)
Out-of-Distribution DetectionImageNet-1k vs Curated OODs (avg.)FPR9517.97NNGuide (RegNet)
Out-of-Distribution DetectionImageNet-1k vs Curated OODs (avg.)AUROC95.45NNGuide (ResNet50 w/ ReAct)
Out-of-Distribution DetectionImageNet-1k vs Curated OODs (avg.)FPR9519.72NNGuide (ResNet50 w/ ReAct)

Related Papers

Safe Domain Randomization via Uncertainty-Aware Out-of-Distribution Detection and Policy Adaptation2025-07-08FA: Forced Prompt Learning of Vision-Language Models for Out-of-Distribution Detection2025-07-06Out-of-distribution detection in 3D applications: a review2025-07-01Generative Adversarial Evasion and Out-of-Distribution Detection for UAV Cyber-Attacks2025-06-26Enclosing Prototypical Variational Autoencoder for Explainable Out-of-Distribution Detection2025-06-17A Variational Information Theoretic Approach to Out-of-Distribution Detection2025-06-17DIsoN: Decentralized Isolation Networks for Out-of-Distribution Detection in Medical Imaging2025-06-10EviNet: Evidential Reasoning Network for Resilient Graph Learning in the Open and Noisy Environments2025-06-08