Skip to main content
QUICK REVIEW

[Paper Review] Learning Deep Nearest Neighbor Representations Using Differentiable Boundary Trees

Daniel Zoran, Balaji Lakshminarayanan|arXiv (Cornell University)|Feb 28, 2017
Anomaly Detection Techniques and ApplicationsComputer Science11 references7 citations
TL;DR

This paper proposes differentiable boundary trees, a method that enables end-to-end learning of deep representations for k-nearest neighbor (k-NN) methods by making tree traversals differentiable. By back-propagating through the tree structure using a stochastic traversal formulation, the approach learns compact, interpretable representations that significantly improve k-NN performance, achieving under 2% test error on MNIST with only 25 tree nodes.

ABSTRACT

Nearest neighbor (kNN) methods have been gaining popularity in recent years in light of advances in hardware and efficiency of algorithms. There is a plethora of methods to choose from today, each with their own advantages and disadvantages. One requirement shared between all kNN based methods is the need for a good representation and distance measure between samples. We introduce a new method called differentiable boundary tree which allows for learning deep kNN representations. We build on the recently proposed boundary tree algorithm which allows for efficient nearest neighbor classification, regression and retrieval. By modelling traversals in the tree as stochastic events, we are able to form a differentiable cost function which is associated with the tree's predictions. Using a deep neural network to transform the data and back-propagating through the tree allows us to learn good representations for kNN methods. We demonstrate that our method is able to learn suitable representations allowing for very efficient trees with a clearly interpretable structure.

Motivation & Objective

  • To address the challenge of learning effective, data-driven representations for k-NN methods, which traditionally rely on handcrafted or fixed distance metrics.
  • To enable end-to-end training of deep neural networks with k-NN inference by differentiating through the tree traversal process.
  • To construct compact, interpretable tree structures that store prototypical and boundary examples, enhancing model interpretability.
  • To demonstrate that learned representations can outperform raw features and even directly trained classifiers in terms of k-NN efficiency and performance.

Proposed method

  • The method models tree traversals as stochastic decisions, enabling back-propagation through the discrete path selection process.
  • A differentiable cost function is derived based on the probability of selecting a particular traversal path, allowing gradient flow into the representation network.
  • The deep neural network transforms input data into a representation space where k-NN queries via boundary trees become more accurate and efficient.
  • Boundary trees are constructed online: each query is traversed to the closest node, and if misclassified, the query becomes a new child node, preserving class boundary crossings.
  • The approach uses a differentiable relaxation of the discrete traversal to allow gradient updates to the network parameters via back-propagation.
  • The final model learns a representation that separates classes clearly in embedding space, enabling small, high-performing trees.

Experimental results

Research questions

  • RQ1Can we learn deep representations for k-NN methods that are both accurate and efficient through end-to-end training?
  • RQ2How can we make the discrete tree traversal process differentiable to allow back-propagation through the k-NN inference mechanism?
  • RQ3Does the resulting representation lead to compact, interpretable boundary trees that store only prototypical and boundary examples?
  • RQ4Can the learned representation outperform raw features or directly trained classifiers in terms of k-NN performance and tree size?

Key findings

  • The method achieves less than 2% test error on MNIST using only 25 nodes in the boundary tree, significantly outperforming the use of raw pixel features.
  • The learned 20-dimensional representation separates MNIST classes more clearly than a directly trained classifier's features, as shown by t-SNE visualization.
  • Training a deep network directly on classification yields a representation less suited for k-NN, as evidenced by higher error and larger tree size.
  • On CIFAR-10, a boundary tree trained on a pre-trained VGG-style representation using only 100 samples achieved 13.06% test error with just 22 nodes.
  • As training progresses, the number of nodes in the tree decreases dramatically—dropping to around 25 nodes by the end—indicating improved representation quality.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.