重新思考视觉分类的最近邻
Rethinking Nearest Neighbors for Visual Classification
摘要:
神经网络分类器已经成为当前“预训练然后微调”的视觉分类范例的事实上的选择。在本文中,我们研究了k最近邻(k-NN)分类器,这是前深度学习时代的一种经典的无模型学习方法,作为对基于现代神经网络的方法的增强。作为一种惰性学习方法,k-NN简单地聚合测试图像与训练集中的前k个邻居之间的距离。我们通过两个步骤采用k-NN和由监督或自监督方法产生的预训练视觉表示:(1)利用k-NN预测概率作为训练过程中简单与困难示例的指示。(2)线性插值的k-NN预测分布与增强分类器。通过对各种分类任务的广泛实验,我们的研究揭示了k-NN集成的通用性和灵活性,并提供了额外的见解:(1)k-NN实现了有竞争力的结果,有时甚至优于标准的线性分类器。(2)结合k-NN对于参数分类器性能不佳和/或处于低数据状态的任务特别有益。我们希望这些发现能鼓励人们重新思考深度学习前的作用,经典方法在计算机视觉中的作用。我们的代码可在https://github.com/KMnP/nn-revisit上获得。
英文摘要:
Neural network classifiers have become the de-facto choice for current "pre-train then fine-tune" paradigms of visual classification. In this paper, we investigate k-Nearest-Neighbor (k-NN) classifiers, a classical model-free learning method from the pre-deep learning era, as an augmentation to modern neural network based approaches. As a lazy learning method, k-NN simply aggregates the distance between the test image and top-k neighbors in a training set. We adopt k-NN with pre-trained visual representations produced by either supervised or self-supervised methods in two steps: (1) Leverage k-NN predicted probabilities as indications for easy vs. hard examples during training. (2) Linearly interpolate the k-NN predicted distribution with that of the augmented classifier. Via extensive experiments on a wide range of classification tasks, our study reveals the generality and flexibility of k-NN integration with additional insights: (1) k-NN achieves competitive results, sometimes even outperforming a standard linear classifier. (2) Incorporating k-NN is especially beneficial for tasks where parametric classifiers perform poorly and / or in low-data regimes. We hope these discoveries will encourage people to rethink the role of pre-deep learning, classical methods in computer vision. Our code is available at: https://github.com/KMnP/nn-revisit.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。