A Flexible Nadaraya-Watson Head Can Offer Explainable and Calibrated Classification
Not on the map. Why?
Abstract (arXiv)
In this paper, we empirically analyze a simple, non-learnable, and nonparametric Nadaraya-Watson (NW) prediction head that can be used with any neural network architecture. In the NW head, the prediction is a weighted average of labels from a support set. The weights are computed from distances between the query feature and support features. This is in contrast to the dominant approach of using a learnable classification head (e.g., a fully-connected layer) on the features, which can be challenging to interpret and can yield poorly calibrated predictions. Our empirical results on an array of computer vision tasks demonstrate that the NW head can yield better calibration with comparable accuracy compared to its parametric counterpart, particularly in data-limited settings. To further increase inference-time efficiency, we propose a simple approach that involves a clustering step run on the training set to create a relatively small distilled support set. Furthermore, we explore two means of interpretability/explainability that fall naturally from the NW head. The first is the label weights, and the second is our novel concept of the ``support influence function,'' which is an easy-to-compute metric that quantifies the influence of a support element on the prediction for a given query. As we demonstrate in our experiments, the influence function can allow the user to debug a trained model. We believe that the NW head is a flexible, interpretable, and highly useful building block that can be used in a range of applications.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 38 of its 57 references that are in the map. First posted on arXiv 7 Dec 2022.
Builds on
38 of 57 references.
References · 38
- 2017Attention Is All You Needcited by 59,932
- 2015Deep Residual Learning for Image Recognitioncited by 51,809
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2016Densely Connected Convolutional Networkscited by 6,691
- 2015Rethinking the Inception Architecture for Computer Visioncited by 5,451
- 2017On Calibration of Modern Neural Networkscited by 4,860
- 2017Prototypical Networks for Few-shot Learningcited by 3,001
- 2016Matching Networks for One Shot Learningcited by 2,246
- 2016Identity Mappings in Deep Residual Networkscited by 1,960
- 2017Understanding Black-box Predictions via Influence Functionscited by 1,714
- 2013Fine-Grained Visual Classification of Aircraftcited by 1,701
- 2015Show, Attend and Tell: Neural Image Caption Generation with Visual Attentioncited by 1,421
26 more
- 2021Improving language models by retrieving from trillions of tokenscited by 1,278
- 2017Learning to Compare: Relation Network for Few-Shot Learningcited by 1,139
- 2021Perceiver: General Perception with Iterative Attentioncited by 1,089
- 2018This Looks Like That: Deep Learning for Interpretable Image Recognitioncited by 731
- 2015Deep Kernel Learningcited by 440
- 2019BBN: Bilateral-Branch Network with Cumulative Learning for Long-Tailed Visual Recognitioncited by 403
- 2021Revisiting the Calibration of Modern Neural Networkscited by 387
- 2017Residual Attention Network for Image Classificationcited by 385
- 2020Influence Functions in Deep Learning Are Fragilecited by 247
- 2020Dataset Meta-Learning from Kernel Ridge-Regressioncited by 230
- 2018Deep k-Nearest Neighbors: Towards Confident, Interpretable and Robust Deep Learningcited by 203
- 2020Regularizing Class-wise Predictions via Self-knowledge Distillationcited by 144
- 2017Doubly Stochastic Variational Inference for Deep Gaussian Processescited by 143
- 2021End-to-End Training of Multi-Document Reader and Retriever for Open-Domain Question Answeringcited by 133
- 2021Interpretable Deep Learning: Interpretation, Interpretability, Trustworthiness, and Beyondcited by 116
- 2021Self-Attention Between Datapoints: Going Beyond Individual Input-Output Pairs in Deep Learningcited by 112
- 2019Analyzing and Improving Representations with the Soft Nearest Neighbor Losscited by 95
- 2018Interpreting CNNs via Decision Treescited by 89
- 2021Deep Learning for Instance Retrieval: A Surveycited by 70
- 2016One-shot Learning with Memory-Augmented Neural Networkscited by 60
- 2022Learning with Neighbor Consistency for Noisy Labelscited by 55
- 2020On Episodes, Prototypical Networks, and Few-shot Learningcited by 46
- 2016Deep Gaussian Processes for Regression using Approximate Expectation Propagationcited by 39
- 2022Visual correspondence-based explanations improve AI robustness and human-AI team accuracycited by 37
- 2018Diagnose like a Radiologist: Attention Guided Convolutional Neural Network for Thorax Disease Classificationcited by 36
- 2020TraDE: Transformers for Density Estimationcited by 18
Built on by
Citing papers per year: 2023: 3; 2024: 0; 2025: 1.
4 papers.
- 2023TabR: Tabular Deep Learning Meets Nearest Neighbors in 2023cited by 73
- 2023A Framework for Interpretability in Machine Learning for Medical Imagingcited by 9
- 2023Learning Invariant Representations with a Nonparametric Nadaraya-Watson Headcited by 1
- 2025SIC: Similarity-Based Interpretable Image Classification with Neural Networkscited by 0
- 2025SIC: Similarity-Based Interpretable Image Classification with Neural Networks28 Jan 2025
- 2023A Framework for Interpretability in Machine Learning for Medical Imaging2 Oct 2023
- 2023Learning Invariant Representations with a Nonparametric Nadaraya-Watson Head23 Sep 2023
- 2023TabR: Tabular Deep Learning Meets Nearest Neighbors in 202326 Jul 2023