Hashing with Binary Matrix Pursuit

Fatih Çakir, Kun He, Stan SclaroffECCV 2018

Abstract

Hashing with Binary Matrix Pursuit (HBMP) introduces a powerful two-stage framework for image retrieval that treats binary code construction as a residual learning problem. By proving that a stepwise pursuit of rank-one binary matrices can fit any neighborhood structure with arbitrary accuracy, the authors achieve state-of-the-art results across major benchmarks. This approach significantly simplifies the training process for deep neural networks by decoupling the discrete optimization of binary codes from the learning of the hash function.

Introduction

"Learning to hash" is a critical task in computer vision and information retrieval, aimed at mapping high-dimensional data into short binary codes to enable efficient similarity searches. The fundamental challenge lies in the discrete nature of the optimization problem, which is inherently NP-hard. Historically, researchers have navigated this by either relaxing binary constraints—leading to high quantization errors—or employing two-stage hashing methods.

Traditional two-stage methods often suffer from a lack of scalability or require complex "bit correction" cycles to compensate for the limited capacity of linear hash functions. HBMP addresses these issues by providing a theoretical guarantee for code quality and leveraging the high capacity of Convolutional Neural Networks (CNNs) to streamline the learning process.

Methodology

Binary Matrix Pursuit (BMP)

The core of the proposed framework is the Binary Matrix Pursuit (BMP) algorithm, which handles the code inference stage through a stepwise residual learning approach. Rather than solving for all bits simultaneously, the algorithm formulates the problem as fitting an affinity matrix $R$. In each iteration, the algorithm identifies the rank-one binary matrix most correlated with the current residual and adds it to the solution. This greedy, stepwise refinement ensures that the binary codes increasingly approximate the desired similarity structure.

Weighted Hamming Distance

Unlike standard hashing techniques where every bit is treated with equal importance, HBMP introduces a weighted Hamming distance. By learning a specific weight ($\alpha$) for each bit, the framework allows binary codes to represent complex similarities with significantly higher precision. This flexibility enables the model to capture nuanced relationships that unweighted codes might miss.

Decoupled Optimization and Item-Based Affinity

A key insight of the HBMP framework is the realization that the high learning capacity of modern CNNs renders the traditional "bit correction" stage unnecessary. The authors argue that once optimal target codes are inferred, a CNN can be trained to map images to these codes using a simple hinge loss without further adjustment.

Furthermore, to enhance scalability, the authors perform inference on the items that define the neighborhood (such as class labels) rather than individual image instances. This reduces the optimization complexity from $N^2$ (where $N$ is the number of images) to $C^2$ (where $C$ is the number of classes), making the process nearly instantaneous even for large-scale datasets.

Theoretical Foundations

The authors provide a formal proof (Theorem 2) demonstrating that their residual learning scheme monotonically decreases the approximation error. Under mild assumptions, the framework can fit any neighborhood structure perfectly given a sufficient number of bits. This theoretical convergence provides a robust foundation for the empirical success of the BMP algorithm.

Experimental Results

HBMP was evaluated on four standard benchmarks: CIFAR-10, NUSWIDE, ImageNet100, and 22K LabelMe. The method consistently outperformed existing state-of-the-art (SOTA) methods, including DPSH, DTSH, and MIHash.

  • CIFAR-10: HBMP achieved a Mean Average Precision (mAP) of 0.799 with 12-bit codes, a significant jump from the 0.738 achieved by previous leading methods.
  • ImageNet100: The framework demonstrated a 4–6% improvement in mAP over recent SOTA methods across various code lengths (16 to 64 bits).
  • Scalability: The class-based inference scheme proved to be orders of magnitude faster than instance-based alternatives, particularly as the bit length increased.

Discussion and Limitations

While HBMP offers substantial improvements in accuracy and efficiency, it introduces a minor overhead in the form of weight storage. The weighted Hamming distance requires storing a small vector of floating-point weights alongside the binary codes. Although this memory requirement is negligible, it adds a layer of complexity to the distance calculation compared to vanilla Hamming distance.

Additionally, the algorithm utilizes spectral relaxation (eigenvalue decomposition) to address the NP-hard binary quadratic programming step. While empirical results suggest this approximation is highly effective, it remains a relaxation of the original discrete problem.

Conclusion

Hashing with Binary Matrix Pursuit represents a significant step forward in two-stage hashing. By treating code construction as a residual learning task and leveraging the representational power of deep networks, HBMP provides an efficient, scalable, and theoretically grounded solution for high-performance image retrieval. Future work may extend this framework to handle more complex neighborhood definitions, such as hierarchical taxonomies or cross-modal retrieval contexts.

Summary updated

BibTeX
@inproceedings{cakir2018hashing,
  author = {Fatih Çakir and Kun He and Stan Sclaroff},
  title = {{Hashing with Binary Matrix Pursuit}},
  booktitle = {European Conference on Computer Vision},
  year = {2018},
  doi = {10.1007/978-3-030-01228-1\_21},
}
Figure