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.
翻译:本文通过实验分析了一种简单、无需学习且非参数的Nadaraya-Watson(NW)预测头,该结构可与任意神经网络架构结合使用。在NW分类头中,预测结果被定义为支持集标签的加权平均值,其中权重由查询特征与支持特征之间的距离计算得出。这与当前主流的可学习分类头(如全连接层)方法形成对比——后者在特征分类中难以解释且校准效果欠佳。我们在多个计算机视觉任务上的实验结果表明,与参数化分类头相比,NW分类头在数据量有限的场景下能以相近准确率实现更优的校准效果。为进一步提升推理效率,我们提出一种简单方法:在训练集上执行聚类步骤以构建规模较小的精简支持集。此外,我们探索了NW分类头天然提供的两种可解释性/可解释性方法:其一是标签权重,其二是我们提出的创新概念——“支持影响函数”,这是一种易于计算的度量指标,可量化支持元素对给定查询预测结果的影响程度。实验证明,该影响函数可辅助用户调试已训练模型。我们认为NW分类头是一种灵活、可解释且具有高度实用性的基础组件,可广泛应用于各类场景。