mlsanityData to 7 Oct 2026

Deep k-Nearest Neighbors: Towards Confident, Interpretable and Robust Deep Learning

arXiv 1803.04765 ↗First posted 13 Mar 2018cs.LG stat.MLcited by 203

Not on the map. Why?

Abstract (arXiv)

Deep neural networks (DNNs) enable innovative applications of machine learning like image recognition, machine translation, or malware detection. However, deep learning is often criticized for its lack of robustness in adversarial settings (e.g., vulnerability to adversarial inputs) and general inability to rationalize its predictions. In this work, we exploit the structure of deep learning to enable new learning-based inference and decision strategies that achieve desirable properties such as robustness and interpretability. We take a first step in this direction and introduce the Deep k-Nearest Neighbors (DkNN). This hybrid classifier combines the k-nearest neighbors algorithm with representations of the data learned by each layer of the DNN: a test input is compared to its neighboring training points according to the distance that separates them in the representations. We show the labels of these neighboring points afford confidence estimates for inputs outside the model's training manifold, including on malicious inputs like adversarial examples--and therein provides protections against inputs that are outside the models understanding. This is because the nearest neighbors can be used to estimate the nonconformity of, i.e., the lack of support for, a prediction in the training data. The neighbors also constitute human-interpretable explanations of predictions. We evaluate the DkNN algorithm on several datasets, and show the confidence estimates accurately identify inputs outside the model, and that the explanations provided by nearest neighbors are intuitive and useful in understanding model failures.

Key facts. Cited by 203 papers in the map (data through 7 Oct 2026). First posted on arXiv 13 Mar 2018.

Builds on

No reference list yet.

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2020: 1; 2021: 64; 2022: 33; 2023: 30; 2024: 27; 2025: 30; 2026: 18.

203 papers.

Sort:

By area:

  1. 2021Interpretable Machine Learning: Fundamental Principles and 10 Grand Challengescited by 364
  2. 2021Deep Learning Through the Lens of Example Difficultycited by 139
  3. 2021Human-Centered Explainable AI (XAI): From Algorithms to User Experiencescited by 123
  4. 2023Quantifying Uncertainty in Answers from any Language Model and Enhancing their Trustworthinesscited by 121
  5. 2021Towards a Science of Human-AI Decision Making: A Survey of Empirical Studiescited by 85
  6. 2021Towards Self-Explainable Graph Neural Networkcited by 75
  7. 2022Visual Recognition with Deep Nearest Centroidscited by 59
  8. 2021Personalized Federated Learning through Local Memorizationcited by 57
  9. 2021Beyond Trivial Counterfactual Explanations with Diverse Valuable Explanationscited by 56
  10. 2023kNN Prompting: Beyond-Context Learning with Calibration-Free Nearest Neighbor Inferencecited by 47
  11. 2023Sampling-Based Accuracy Testing of Posterior Estimators for General Inferencecited by 45
  12. 2024Uncertainty in Language Models: Assessment through Rank-Calibrationcited by 40
38 more
  1. 2022Visual correspondence-based explanations improve AI robustness and human-AI team accuracycited by 37
  2. 2021Explaining Latent Representations with a Corpus of Examplescited by 30
  3. 2021A statistical framework for efficient out of distribution detection in deep neural networkscited by 27
  4. 2022iDECODe: In-distribution Equivariance for Conformal Out-of-distribution Detectioncited by 27
  5. 2024On Behalf of the Stakeholders: Trends in NLP Model Interpretability in the Era of LLMscited by 24
  6. 2022Shoring Up the Foundations: Fusing Model Embeddings and Weak Supervisioncited by 18
  7. 2024Automatic Dataset Construction (ADC): Sample Collection, Data Curation, and Beyondcited by 18
  8. 2021Ensemble-based Uncertainty Quantification: Bayesian versus Credal Inferencecited by 16
  9. 2021RETRONLU: Retrieval Augmented Task-Oriented Semantic Parsingcited by 15
  10. 2022Label-Free Explainability for Unsupervised Modelscited by 14
  11. 2022Towards Prototype-Based Self-Explainable Graph Neural Networkcited by 14
  12. 2023Defenses in Adversarial Machine Learning: A Surveycited by 14
  13. 2021Hyperdimensional Feature Fusion for Out-Of-Distribution Detectioncited by 13
  14. 2023Natural Example-Based Explainability: a Surveycited by 13
  15. 2021Multi-Expert Adversarial Attack Detection in Person Re-identification Using Context Inconsistencycited by 12
  16. 2021Channel-Wise Early Stopping without a Validation Set via NNK Polytope Interpolationcited by 11
  17. 2022CADet: Fully Self-Supervised Out-Of-Distribution Detection With Contrastive Learningcited by 11
  18. 2022TiDAL: Learning Training Dynamics for Active Learningcited by 11
  19. 2024FuseFL: One-Shot Federated Learning through the Lens of Causality with Progressive Model Fusioncited by 11
  20. 2021Mitigating belief projection in explainable artificial intelligence via Bayesian Teachingcited by 10
  21. 2021Increasing the Confidence of Deep Neural Networks by Coverage Analysiscited by 9
  22. 2021Intuitively Assessing ML Model Reliability through Example-Based Explanations and Editing Model Inputscited by 9
  23. 2021Are all outliers alike? On Understanding the Diversity of Outliers for Detecting OODscited by 9
  24. 2021Let the CAT out of the bag: Contrastive Attributed explanations for Textcited by 9
  25. 2021SoK: Machine Learning Governancecited by 9
  26. 2022Predicting and Explaining Mobile UI Tappability with Vision Modeling and Saliency Analysiscited by 9
  27. 2021RAILS: A Robust Adversarial Immune-inspired Learning Systemcited by 8
  28. 2022Taking a Step Back with KCal: Multi-Class Kernel-Based Calibration for Deep Neural Networkscited by 8
  29. 2023An Informative Path Planning Framework for Active Learning in UAV-based Semantic Mappingcited by 8
  30. 2023Faithful and Efficient Explanations for Neural Networks via Neural Tangent Kernel Surrogate Modelscited by 8
  31. 2024Towards flexible perception with visual memorycited by 8
  32. 2021Locally Adaptive Label Smoothing for Predictive Churncited by 7
  33. 2021Detecting OODs as datapoints with High Uncertaintycited by 7
  34. 2021KNN-BERT: Fine-Tuning Pre-Trained Models with KNN Classifiercited by 7
  35. 2022The Geometry of Self-supervised Learning Models and its Impact on Transfer Learningcited by 7
  36. 2024Taming False Positives in Out-of-Distribution Detection with Human Feedbackcited by 7
  37. 2021Certification of embedded systems based on Machine Learning: A surveycited by 6
  38. 2021Rethinking Nearest Neighbors for Visual Classificationcited by 6

50 most cited of 203 All 203 (JSON)