Deep k-Nearest Neighbors: Towards Confident, Interpretable and Robust Deep Learning
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
Citing papers per year: 2020: 1; 2021: 64; 2022: 33; 2023: 30; 2024: 27; 2025: 30; 2026: 18.
203 papers.
Sort:
By area:
- 2021Interpretable Machine Learning: Fundamental Principles and 10 Grand Challengescited by 364
- 2021Deep Learning Through the Lens of Example Difficultycited by 139
- 2021Human-Centered Explainable AI (XAI): From Algorithms to User Experiencescited by 123
- 2023Quantifying Uncertainty in Answers from any Language Model and Enhancing their Trustworthinesscited by 121
- 2021Towards a Science of Human-AI Decision Making: A Survey of Empirical Studiescited by 85
- 2021Towards Self-Explainable Graph Neural Networkcited by 75
- 2022Visual Recognition with Deep Nearest Centroidscited by 59
- 2021Personalized Federated Learning through Local Memorizationcited by 57
- 2021Beyond Trivial Counterfactual Explanations with Diverse Valuable Explanationscited by 56
- 2023kNN Prompting: Beyond-Context Learning with Calibration-Free Nearest Neighbor Inferencecited by 47
- 2023Sampling-Based Accuracy Testing of Posterior Estimators for General Inferencecited by 45
- 2024Uncertainty in Language Models: Assessment through Rank-Calibrationcited by 40
38 more
- 2022Visual correspondence-based explanations improve AI robustness and human-AI team accuracycited by 37
- 2021Explaining Latent Representations with a Corpus of Examplescited by 30
- 2021A statistical framework for efficient out of distribution detection in deep neural networkscited by 27
- 2022iDECODe: In-distribution Equivariance for Conformal Out-of-distribution Detectioncited by 27
- 2024On Behalf of the Stakeholders: Trends in NLP Model Interpretability in the Era of LLMscited by 24
- 2022Shoring Up the Foundations: Fusing Model Embeddings and Weak Supervisioncited by 18
- 2024Automatic Dataset Construction (ADC): Sample Collection, Data Curation, and Beyondcited by 18
- 2021Ensemble-based Uncertainty Quantification: Bayesian versus Credal Inferencecited by 16
- 2021RETRONLU: Retrieval Augmented Task-Oriented Semantic Parsingcited by 15
- 2022Label-Free Explainability for Unsupervised Modelscited by 14
- 2022Towards Prototype-Based Self-Explainable Graph Neural Networkcited by 14
- 2023Defenses in Adversarial Machine Learning: A Surveycited by 14
- 2021Hyperdimensional Feature Fusion for Out-Of-Distribution Detectioncited by 13
- 2023Natural Example-Based Explainability: a Surveycited by 13
- 2021Multi-Expert Adversarial Attack Detection in Person Re-identification Using Context Inconsistencycited by 12
- 2021Channel-Wise Early Stopping without a Validation Set via NNK Polytope Interpolationcited by 11
- 2022CADet: Fully Self-Supervised Out-Of-Distribution Detection With Contrastive Learningcited by 11
- 2022TiDAL: Learning Training Dynamics for Active Learningcited by 11
- 2024FuseFL: One-Shot Federated Learning through the Lens of Causality with Progressive Model Fusioncited by 11
- 2021Mitigating belief projection in explainable artificial intelligence via Bayesian Teachingcited by 10
- 2021Increasing the Confidence of Deep Neural Networks by Coverage Analysiscited by 9
- 2021Intuitively Assessing ML Model Reliability through Example-Based Explanations and Editing Model Inputscited by 9
- 2021Are all outliers alike? On Understanding the Diversity of Outliers for Detecting OODscited by 9
- 2021Let the CAT out of the bag: Contrastive Attributed explanations for Textcited by 9
- 2021SoK: Machine Learning Governancecited by 9
- 2022Predicting and Explaining Mobile UI Tappability with Vision Modeling and Saliency Analysiscited by 9
- 2021RAILS: A Robust Adversarial Immune-inspired Learning Systemcited by 8
- 2022Taking a Step Back with KCal: Multi-Class Kernel-Based Calibration for Deep Neural Networkscited by 8
- 2023An Informative Path Planning Framework for Active Learning in UAV-based Semantic Mappingcited by 8
- 2023Faithful and Efficient Explanations for Neural Networks via Neural Tangent Kernel Surrogate Modelscited by 8
- 2024Towards flexible perception with visual memorycited by 8
- 2021Locally Adaptive Label Smoothing for Predictive Churncited by 7
- 2021Detecting OODs as datapoints with High Uncertaintycited by 7
- 2021KNN-BERT: Fine-Tuning Pre-Trained Models with KNN Classifiercited by 7
- 2022The Geometry of Self-supervised Learning Models and its Impact on Transfer Learningcited by 7
- 2024Taming False Positives in Out-of-Distribution Detection with Human Feedbackcited by 7
- 2021Certification of embedded systems based on Machine Learning: A surveycited by 6
- 2021Rethinking Nearest Neighbors for Visual Classificationcited by 6
50 most cited of 203 All 203 (JSON)
- 2026Decoding Mixture Perception through Computational Modeling of Component Interactions10 Aug 2026
- 2026A Convolutional Layer Activation Dimensionality Reduction for Out-of-Distribution and Adversarial Attack Detection Methods10 Aug 2026
- 2026GUARD: Grounding Uncertainty and Ablation-Based Risk Detection for Diffusion-Based VLAs5 Aug 2026
- 2026A Classifier-Agnostic Zero-Shot Adversarial Attack Detection via CLIP29 Jun 2026
- 2026Mitigating Visual Hallucinations in Multimodal Systems through Retrieval-Augmented Reliability-Aware Inference14 Jun 2026
- 2026Low-Frequency Shortcuts in Texture-Driven Visual Learning2 Jun 2026
- 2026Efficient, Validation-Free Intrinsic Quality Estimation for Large-Scale Face Recognition Datasets28 May 2026
- 2026Exploring Trust Calibration in XAI - The Impact of Exposing Model Limitations to Lay Users18 May 2026
- 2026VLAMotor: Test-Guided Enhancement of Vision-Language-Action Models via Agent-BasedData Synthesis16 May 2026
- 2026RAPT: Retrieval-Augmented Post-hoc Thresholding for Multi-Label Classification15 May 2026
- 2026Architecture-agnostic Lipschitz-constant Bayesian header and its application to resolve semantically proximal classification errors with vision transformers7 May 2026
- 2026Detecting Adversarial Data via Provable Adversarial Noise Amplification4 May 2026
38 more
- 2026Uncertainty-Aware Transformers: Conformal Prediction for Language Models10 Apr 2026
- 2026Toward Aristotelian Medical Representations: Backpropagation-Free Layer-wise Analysis for Interpretable Generalized Metric Learning on MedMNIST7 Apr 2026
- 2026DANCE: Doubly Adaptive Neighborhood Conformal Estimation24 Feb 2026
- 2026GraphNNK -- Graph Classification and Interpretability31 Jan 2026
- 2026Towards Visually Explaining Statistical Tests with Applications in Biomedical Imaging20 Jan 2026
- 2026DiMEx: Breaking the Cold Start Barrier in Data-Free Model Extraction via Latent Diffusion Priors4 Jan 2026
- 2025Multi-Layer Confidence Scoring for Detection of Out-of-Distribution Samples, Adversarial Attacks, and In-Distribution Misclassifications22 Dec 2025
- 2025Studying Various Activation Functions and Non-IID Data for Machine Learning Model Robustness3 Dec 2025
- 2025Graph Memory: A Structured and Interpretable Framework for Modality-Agnostic Embedding-Based Inference18 Nov 2025
- 2025Additive Large Language Models for Semi-Structured Text14 Nov 2025
- 2025Robust Nearest Neighbour Retrieval Using Targeted Manifold Manipulation9 Nov 2025
- 2025Cluster Paths: Navigating Interpretability in Neural Networks8 Oct 2025
- 2025Onto-Epistemological Analysis of AI Explanations3 Oct 2025
- 2025Vicinity-Guided Discriminative Latent Diffusion for Privacy-Preserving Domain Adaptation1 Oct 2025
- 2025Feature Attribution in 5G Intrusion Detection: A Statistical vs. Logic-Based Comparison12 Sep 2025
- 2025Novel Approaches to Artificial Intelligence Development Based on the Nearest Neighbor Method26 Aug 2025
- 2025Separating Knowledge and Perception with Procedural Data12 Aug 2025
- 2025Digital Twin-Assisted Explainable AI for Robust Beam Prediction in mmWave MIMO Systems12 Jul 2025
- 2025Universal and Efficient Detection of Adversarial Data through Nonuniform Impact on Network Layers25 Jun 2025
- 2025Exploring Graph-Transformer Out-of-Distribution Generalization Abilities25 Jun 2025
- 2025Anomaly Detection in Event-triggered Traffic Time Series via Similarity Learning20 Jun 2025
- 2025SoftStep: Learning Sparse Similarity Powers Deep Neighbor-Based Regression9 Jun 2025
- 2025Towards Uncertainty Aware Task Delegation and Human-AI Collaborative Decision-Making23 May 2025
- 2025Out-of-Distribution Detection via Channelwise Feature Aggregation in Neural Network-Based Receivers21 May 2025
- 2025A Few Large Shifts: Layer-Inconsistency Based Minimal Overhead Adversarial Example Detection19 May 2025
- 2025Bi-directional Model Cascading with Proxy Confidence27 Apr 2025
- 2025Don't Lag, RAG: Training-Free Adversarial Detection Using RAG7 Apr 2025
- 2025Interpretable Multimodal Learning for Tumor Protein-Metal Binding: Progress, Challenges, and Perspectives4 Apr 2025
- 2025Exploring the Potential of Bilevel Optimization for Calibrating Neural Networks17 Mar 2025
- 2025From Pixels to Trajectory: Universal Adversarial Example Detection via Temporal Imprints6 Mar 2025
- 2025Koopman-Based Generalization of Deep Reinforcement Learning With Application to Wireless Communications4 Mar 2025
- 2025Obtaining Example-Based Explanations from Deep Neural Networks27 Feb 2025
- 2025Pulling Back the Curtain: Unsupervised Adversarial Detection via Contrastive Auxiliary Networks13 Feb 2025
- 2025Explainable and Robust Millimeter Wave Beam Alignment for AI-Native 6G Networks23 Jan 2025
- 2025Provably Safeguarding a Classifier from OOD and Adversarial Samples: an Extreme Value Theory Approach17 Jan 2025
- 2025Contrastive Learning from Exploratory Actions: Leveraging Natural Interactions for Preference Elicitation2 Jan 2025
- 2024Performance Control in Early Exiting to Deploy Large Models at the Same Cost of Smaller Ones26 Dec 2024
- 2024Lightweight Safety Classification Using Pruned Language Models18 Dec 2024
50 newest of 203 All 203 (JSON)
- 2024Lightweight Safety Classification Using Pruned Language Modelscited by 5
- 2023Towards Poisoning Fair Representationscited by 3
- 2024Lightweight Safety Classification Using Pruned Language Models18 Dec 2024
- 2023Towards Poisoning Fair Representations28 Sep 2023
- 2021Interpretable Machine Learning: Fundamental Principles and 10 Grand Challengescited by 364
- 2021Deep Learning Through the Lens of Example Difficultycited by 139
- 2021Human-Centered Explainable AI (XAI): From Algorithms to User Experiencescited by 123
- 2023Quantifying Uncertainty in Answers from any Language Model and Enhancing their Trustworthinesscited by 121
- 2021Towards a Science of Human-AI Decision Making: A Survey of Empirical Studiescited by 85
- 2021Towards Self-Explainable Graph Neural Networkcited by 75
- 2022Visual Recognition with Deep Nearest Centroidscited by 59
- 2021Personalized Federated Learning through Local Memorizationcited by 57
- 2021Beyond Trivial Counterfactual Explanations with Diverse Valuable Explanationscited by 56
- 2023kNN Prompting: Beyond-Context Learning with Calibration-Free Nearest Neighbor Inferencecited by 47
- 2023Sampling-Based Accuracy Testing of Posterior Estimators for General Inferencecited by 45
- 2024Uncertainty in Language Models: Assessment through Rank-Calibrationcited by 40
12 most cited of 190 All 190 (JSON)
- 2026Decoding Mixture Perception through Computational Modeling of Component Interactions10 Aug 2026
- 2026A Convolutional Layer Activation Dimensionality Reduction for Out-of-Distribution and Adversarial Attack Detection Methods10 Aug 2026
- 2026A Classifier-Agnostic Zero-Shot Adversarial Attack Detection via CLIP29 Jun 2026
- 2026Low-Frequency Shortcuts in Texture-Driven Visual Learning2 Jun 2026
- 2026Efficient, Validation-Free Intrinsic Quality Estimation for Large-Scale Face Recognition Datasets28 May 2026
- 2026Exploring Trust Calibration in XAI - The Impact of Exposing Model Limitations to Lay Users18 May 2026
- 2026Architecture-agnostic Lipschitz-constant Bayesian header and its application to resolve semantically proximal classification errors with vision transformers7 May 2026
- 2026Detecting Adversarial Data via Provable Adversarial Noise Amplification4 May 2026
- 2026Uncertainty-Aware Transformers: Conformal Prediction for Language Models10 Apr 2026
- 2026Toward Aristotelian Medical Representations: Backpropagation-Free Layer-wise Analysis for Interpretable Generalized Metric Learning on MedMNIST7 Apr 2026
- 2026DANCE: Doubly Adaptive Neighborhood Conformal Estimation24 Feb 2026
- 2026GraphNNK -- Graph Classification and Interpretability31 Jan 2026
12 newest of 190 All 190 (JSON)