A General Two-Step Approach to Learning-Based Hashing

Guosheng Lin, Chunhua Shen, David Suter, Anton van den Hengel

Abstract

Learning-based hashing has become a cornerstone of large-scale image retrieval, yet traditional methods often suffer from a tight coupling between the hashing loss function and the specific form of the hash function. This paper introduces Two-Step Hashing (TSH), a framework that decouples binary code inference from hash function learning. By reformulating code generation as a Binary Quadratic Problem and treating hash function learning as a standard classification task, TSH offers unprecedented flexibility and state-of-the-art performance across various datasets.

Introduction

In the era of big data, high-dimensional image features must be mapped into short binary codes to enable efficient similarity searches via Hamming distance. However, existing supervised hashing methods like Kernel-Based Supervised Hashing (KSH) or Minimal Loss Hashing (MLH) are often "tightly coupled." Their optimization procedures are inextricably linked to specific hash function forms, such as linear projections. Switching to more powerful functions, such as kernel-based ones, typically requires deriving complex, non-convex optimization algorithms from scratch. TSH addresses this by breaking the problem into two independent, manageable steps.

Methods

The TSH framework employs a "divide and conquer" strategy:

  1. Binary Code Inference: The algorithm first determines the optimal binary bits ($z$) for the training data, ensuring similar items have similar bits. The authors demonstrate that many popular hashing loss functions can be unified into a Binary Quadratic Problem (BQP), solved efficiently using bit-wise block coordinate descent.
  2. Hash Function Learning: With the "ideal" bits acting as labels, learning the hash function is reduced to a standard binary classification problem. This allows the use of any off-the-shelf classifier, such as Linear SVMs, RBF-Kernel SVMs, or Adaboost.
Figure 2: Compression time vs. binary code length for various TSH implementations on LABLEME and CIFAR10 datasets.

This decoupling allows for the use of sophisticated optimization tools for the first step and mature machine learning libraries for the second. Furthermore, because the second step uses standard classification, it can be easily parallelized, with each bit of the hash code learned by a separate processor simultaneously.

Results

TSH was evaluated on diverse datasets including MNIST, CIFAR-10, LabelMe, Tiny-580K, and Flickr 1M.

  • State-of-the-Art Accuracy: TSH consistently outperformed supervised baselines. On CIFAR-10 with 32-bit codes, TSH achieved a Mean Average Precision (MAP) of ~0.44, significantly higher than KSH (~0.40) and MLH (~0.26).
  • Training Fit: The BQP formulation proved highly effective, often achieving 1.0 MAP on training sets for MNIST and CIFAR-10, demonstrating its ability to capture underlying data similarity.
  • Flexibility in Action: The authors showed that using "Kernel Transferred Features" (TSH-KF) provided a balance between kernel accuracy and high testing speeds.
Figure 4: Qualitative retrieval results showing the effectiveness of the TSH framework in identifying similar objects like airplanes and cars.

Conclusion

The TSH framework demonstrates that decoupling code generation from function learning simplifies the hashing problem while improving performance. By unifying disparate hashing theories into a standard quadratic form, it provides a flexible foundation for future developments. While the performance is limited by the chosen classifier's capacity, the framework's ability to incorporate complex models like deep neural networks points toward the future of the field.

Summary updated

BibTeX
@inproceedings{lin2013general,
  author = {Guosheng Lin and Chunhua Shen and David Suter and Anton van den Hengel},
  title = {{A General Two-Step Approach to Learning-Based Hashing}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2013},
  doi = {10.1109/iccv.2013.317},
}
Figure