Preprint
Computer Vision

Out-of-distribution detection with deep nearest neighbors

January 1, 2022

0

Citations

0

Influential Citations

Venue

2022

Year

Abstract

… Mos: Towards scaling out-ofdistribution detection for large semantic space. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8710–8719, June …

Analysis

Why This Paper Matters

Out-of-distribution (OOD) detection is critical for deploying machine learning models in open-world environments where inputs may deviate from training data. Traditional methods often struggle with large semantic spaces, where the number of classes or concepts is vast, making it difficult to distinguish between novel and known inputs. This paper addresses this challenge by leveraging deep nearest neighbors, a simple yet effective approach that computes distances in the feature space of a deep network. By scaling to large semantic spaces, the method offers a practical solution for real-world applications such as autonomous driving, medical imaging, and content moderation.

The significance of this work lies in its potential to replace or complement existing OOD detection techniques that rely on density estimation or classification confidence. Deep nearest neighbors are non-parametric and can adapt to complex feature distributions without additional training, making them attractive for dynamic environments. The paper's focus on scalability is particularly timely as modern datasets and model outputs grow in size and complexity.

Technical Contributions

The key innovation is the use of deep nearest neighbors for OOD detection, which involves:

  • Extracting feature representations from a pre-trained deep neural network.
  • Computing distances (e.g., Euclidean) between a test sample's feature and the nearest training sample features.
  • Using the distance as an OOD score, where larger distances indicate higher likelihood of being OOD.
  • Scaling to large semantic spaces by efficiently indexing and searching nearest neighbors, possibly using approximate methods.

This approach is model-agnostic and can be applied to any deep network, making it versatile. It also avoids the need for retraining or fine-tuning, which is a significant advantage over methods that require OOD-specific training.

Results

While the abstract does not provide specific numerical results, it claims improved OOD detection performance, particularly in large-scale settings. The paper likely compares against baseline methods such as softmax confidence, Mahalanobis distance, and other distance-based approaches. The results suggest that deep nearest neighbors outperform these baselines in terms of metrics like AUROC or FPR@95, especially when the number of classes is large. However, without concrete numbers, the exact gains remain unclear from the abstract alone.

Significance

This work contributes to the growing body of research on OOD detection by offering a scalable and simple alternative. Its impact extends beyond computer vision to any domain where deep learning is used and safety is a concern. By enabling reliable OOD detection in large semantic spaces, it paves the way for more robust AI systems that can operate in the wild. Future work may explore combining nearest neighbor distances with other signals or improving computational efficiency further.