Nearest Neighbor Guidance for Out-of-Distribution Detection

Jaewoo Park, Yoon Gyo Jung, A. Teoh
2/14/2026

No official code found. Best implementation: Jingkang50/OpenOOD (1,059 stars, MIT, last commit 2025-12-01). 1 more below.

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.

View on arXivView PDF

Code Implementations(2)

Jingkang50/OpenOODCommunity100%
MIT

Benchmarking Generalized Out-of-Distribution Detection

1,059179Shell, PythonNov 29, 202110 months agoMIT
anomaly-detectionnovelty-detectionopen-set-recognitionout-of-distribution-detectionoutlier-detection+1 more
roomo7time/nnguideCommunity100%
Apache-2.0

Code for ICCV 2023 paper "Nearest Neighbor Guidance for Out-of-Distribution Detection"

233Shell, PythonAug 15, 20231 years agoApache-2.0

Similar Papers

Cite this paper

@article{park2026nearest,
  title  = {Nearest Neighbor Guidance for Out-of-Distribution Detection},
  author = {Jaewoo Park and Yoon Gyo Jung and A. Teoh},
  year   = {2026},
  eprint = {2309.14888},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2309.14888},
  journal = {ICCV 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2309.14888.svg)](https://codeofpaper.com/paper/2309.14888)

Discussion