Fast Supervised Hashing with Decision Trees for High-Dimensional Data

Guosheng Lin, Chunhua Shen, Qinfeng Shi, Anton van den Hengel, David Suter · DOI

TL;DR

FastHash is a novel supervised hashing framework that leverages boosted decision trees to create compact binary codes for high-dimensional data. By combining an efficient GraphCut-based binary code inference step with the non-linear mapping power of decision tree ensembles, it achieves state-of-the-art retrieval precision while being orders of magnitude faster to train than traditional kernel-based methods.

What Problem Does This Paper Address?

In the world of large-scale image retrieval, we need a way to search through millions of items instantly. Hashing solves this by mapping high-dimensional features (like image descriptors) into short binary strings. Ideally, similar items should have similar binary codes, allowing for lightning-fast searches using Hamming distance.

While supervised hashing (which uses category labels to learn these mappings) is generally more accurate than unsupervised methods, it faces a major scalability wall. Existing high-performing methods often rely on kernel functions to capture non-linear relationships. However, kernels are computationally expensive to train and evaluate, especially when feature dimensions reach the tens of thousands. The authors aim to bridge this gap: creating a method that is both highly non-linear and efficient enough for massive, high-dimensional datasets.

Methods

The authors propose a two-step learning strategy called FastHash:

  1. Binary Code Inference (Step 1): The goal here is to determine what the binary codes ($z$) for the training data should actually be to preserve similarity. The authors formulate this as a binary quadratic problem. Unlike previous methods that used "loose" spectral relaxations, they prove that this problem can be framed as a sub-modular optimization under specific conditions. This allows them to use an efficient Block GraphCut (Block-GC) algorithm to solve for the codes bit-by-bit, which is both faster and more accurate than spectral methods.
  2. Hash Function Learning (Step 2): Once the target binary codes are known, the task becomes a standard binary classification problem: learn a function that maps the original features to these codes. FastHash uses boosted decision trees (specifically Adaboost) for this.

Ensembles of decision trees are a brilliant choice here because they provide non-linear mapping (like kernels) but are much faster to evaluate. Furthermore, they perform implicit feature selection, which is vital when dealing with high-dimensional inputs.

Figure 1: Comparison of various combinations of hash functions and binary inference methods. Note that the proposed FastHash uses decision tree as hash functions. The proposed decision tree hash function performs much better than the linear SVM hash function. Moreover, our FastHash performs much better than TSH when using the same hash function in Step 2.

Datasets

The researchers evaluated FastHash on five diverse image datasets:

  • CIFAR-10: 60,000 images across 10 classes.
  • IAPRTC12 & ESPGAME: ~20,000 images each, using keyword annotations for similarity.
  • MIRFLICKR: 25,000 images.
  • SUN397: A massive dataset with over 100,000 scene images across 397 categories, used to test large-scale scalability.

They tested both low-dimensional GIST features (320-512 dims) and high-dimensional codebook features (up to 22,400 dims).

Key Insights and Ideas

  • Trees Beat Kernels for Scaling: The "aha moment" is that decision trees offer the non-linearity required for high precision without the $O(N^2)$ or $O(N^3)$ complexity traps of kernel methods.
  • Sub-modularity Matters: By identifying the sub-modular structure of the code inference problem, the authors could move away from approximate spectral solvers to more robust GraphCut solvers, leading to higher-quality binary codes.
  • Iterative Feedback: FastHash alternates between inferring codes and training trees for each bit. This allows the model to "correct" itself; the hash function for the $k$-th bit is trained based on the errors made by the previous $k-1$ bits.

Key Results

FastHash demonstrates a dominant performance profile:

  • Retrieval Accuracy: It consistently outperforms state-of-the-art methods like KSH and TSH. On high-dimensional features, the gap is particularly large, as shown in the precision-recall curves below.
  • Training Speed: On the CIFAR-10 dataset with 11,200-dimensional features, FastHash was roughly 150x faster to train than KSH while achieving significantly higher precision (0.763 vs 0.590).
  • Scalability: FastHash successfully trained on the full SUN397 dataset (100k+ samples, 1024 bits), a feat that is computationally "intractable" for many competing supervised methods.
Figure 2: Results on high-dimensional codebook features. The precision and recall curves are given in the first row. The precision curves of the top 2000 retrieved examples are given on the second row. Both our FastHash and FastHash-Full outperform their comparators by a large margin.

Limitations and Future Work

While FastHash is highly efficient, the authors note that training on the largest datasets (like SUN397) still requires a non-trivial amount of memory (around 7GB), though this is manageable on modern workstations.

The current block construction for GraphCut is based on a simple greedy heuristic. Future work could explore more sophisticated ways to group data points into blocks to further improve the quality of the inferred binary codes. Additionally, exploring different boosting variants or deeper tree structures could yield further gains in extremely complex datasets.

Summary updated

BibTeX
@inproceedings{lin2014fast,
  author = {Guosheng Lin and Chunhua Shen and Qinfeng Shi and Anton van den Hengel and David Suter},
  title = {{Fast Supervised Hashing with Decision Trees for High-Dimensional Data}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2014},
  doi = {10.1109/cvpr.2014.253},
}
Figure