# Deep Nearest Neighbor Anomaly Detection

arXiv: https://arxiv.org/abs/2002.10445 · HTML: https://mlsanity.com/paper/2002.10445/

## Key facts

- Cited by 104 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 24 Feb 2020.

## Built on by (most cited first, 30 of 104)

- [Towards Total Recall in Industrial Anomaly Detection](https://mlsanity.com/paper/2106.08265/) (2021)
- [Out-of-Distribution Detection with Deep Nearest Neighbors](https://mlsanity.com/paper/2204.06507/) (2022)
- [Deep Industrial Image Anomaly Detection: A Survey](https://mlsanity.com/paper/2301.11514/) (2023)
- [Omni-frequency Channel-selection Representations for Unsupervised Anomaly Detection](https://mlsanity.com/paper/2203.00259/) (2022)
- [Explicit Boundary Guided Semi-Push-Pull Contrastive Learning for Supervised Anomaly Detection](https://mlsanity.com/paper/2207.01463/) (2022)
- [Normalizing Flows for Human Pose Anomaly Detection](https://mlsanity.com/paper/2211.10946/) (2022)
- [Anomaly Detection with Conditioned Denoising Diffusion Models](https://mlsanity.com/paper/2305.15956/) (2023)
- [AnomalyDINO: Boosting Patch-based Few-shot Anomaly Detection with DINOv2](https://mlsanity.com/paper/2405.14529/) (2024)
- [LUNAR: Unifying Local Outlier Detection Methods via Graph Neural Networks](https://mlsanity.com/paper/2112.05355/) (2021)
- [Multimodal Industrial Anomaly Detection by Crossmodal Feature Mapping](https://mlsanity.com/paper/2312.04521/) (2023)
- [Improving neural network representations using human similarity judgments](https://mlsanity.com/paper/2306.04507/) (2023)
- [Exposing Outlier Exposure: What Can Be Learned From Few, One, and Zero Outlier Images](https://mlsanity.com/paper/2205.11474/) (2022)
- [Focus Your Distribution: Coarse-to-Fine Non-Contrastive Learning for Anomaly Detection and Localization](https://mlsanity.com/paper/2110.04538/) (2021)
- [Focus the Discrepancy: Intra- and Inter-Correlation Learning for Image Anomaly Detection](https://mlsanity.com/paper/2308.02983/) (2023)
- [ReConPatch : Contrastive Patch Representation Learning for Industrial Anomaly Detection](https://mlsanity.com/paper/2305.16713/) (2023)
- [Hierarchical Gaussian Mixture Normalizing Flow Modeling for Unified Anomaly Detection](https://mlsanity.com/paper/2403.13349/) (2024)
- [Transformaly -- Two (Feature Spaces) Are Better Than One](https://mlsanity.com/paper/2112.04185/) (2021)
- [Improving Selective Visual Question Answering by Learning from Your Peers](https://mlsanity.com/paper/2306.08751/) (2023)
- [MSFlow: Multi-Scale Flow-based Framework for Unsupervised Anomaly Detection](https://mlsanity.com/paper/2308.15300/) (2023)
- [ResAD: A Simple Framework for Class Generalizable Anomaly Detection](https://mlsanity.com/paper/2410.20047/) (2024)
- [CreativeGAN: Editing Generative Adversarial Networks for Creative Design Synthesis](https://mlsanity.com/paper/2103.06242/) (2021)
- [Anomaly Detection via Self-organizing Map](https://mlsanity.com/paper/2107.09903/) (2021)
- [Deep Learning Advancements in Anomaly Detection: A Comprehensive Survey](https://mlsanity.com/paper/2503.13195/) (2025)
- [Back to the Basics: Revisiting Out-of-Distribution Detection Baselines](https://mlsanity.com/paper/2207.03061/) (2022)
- [Unsupervised Outlier Detection using Memory and Contrastive Learning](https://mlsanity.com/paper/2107.12642/) (2021)
- [Learning image representations for anomaly detection: application to discovery of histological alterations in drug development](https://mlsanity.com/paper/2210.07675/) (2022)
- [N-pad : Neighboring Pixel-based Industrial Anomaly Detection](https://mlsanity.com/paper/2210.08768/) (2022)
- [UniFormaly: Towards Task-Agnostic Unified Framework for Visual Anomaly Detection](https://mlsanity.com/paper/2307.12540/) (2023)
- [REB: Reducing Biases in Representation for Industrial Anomaly Detection](https://mlsanity.com/paper/2308.12577/) (2023)
- [Universal Novelty Detection Through Adaptive Contrastive Learning](https://mlsanity.com/paper/2408.10798/) (2024)

## Abstract (arXiv)

Nearest neighbors is a successful and long-standing technique for anomaly detection. Significant progress has been recently achieved by self-supervised deep methods (e.g. RotNet). Self-supervised features however typically under-perform Imagenet pre-trained features. In this work, we investigate whether the recent progress can indeed outperform nearest-neighbor methods operating on an Imagenet pretrained feature space. The simple nearest-neighbor based-approach is experimentally shown to outperform self-supervised methods in: accuracy, few shot generalization, training time and noise robustness while making fewer assumptions on image distributions.
