Rank Subspace Learning for Compact Hash Codes

Kai Li, Guojun Qi, Jun Ye, Kien A. HuaarXiv 2015

Abstract

The era of Big Data has spawned unprecedented interest in developing hashing algorithms for efficient storage and fast nearest neighbor search. Most existing works learn hash functions that are numeric quantizations of feature values in projected feature space. In this work, we propose a novel hash learning framework that encodes feature rank orders instead of numeric values in a number of optimal low-dimensional ranking subspaces. We formulate the ranking subspace learning problem as the optimization of a piece-wise linear convex-concave function and present two versions of our algorithm: one with independent optimization of each hash bit and the other exploiting a sequential learning framework. Our work is a generalization of the Winner-Take-All (WTA) hash family and naturally enjoys all the numeric stability benefits of rank correlation measures while being optimized to achieve high precision at very short code length.

Introduction

In the world of massive datasets, finding "nearest neighbors" (similar items) quickly is a major challenge. Hashing solves this by compressing high-dimensional data into short binary strings. Most existing methods rely on numeric quantization—essentially asking whether a projected value exceeds a certain threshold. However, numeric values are sensitive to noise, scaling, and rotations.

An alternative is rank-based hashing, such as Winner-Take-All (WTA), which asks which feature is the largest. This approach is naturally robust to noise and scale-invariant. However, existing rank-based methods are often "data-agnostic," using random permutations of features. This makes them inefficient, often requiring very long bit-strings to achieve high accuracy because they do not learn the intrinsic structure of the data.

Methodology: Rank Subspace Hashing

To bridge the gap between robust ranking and data-dependent learning, we propose two main algorithms:

  1. Rank Subspace Hashing (RSH): Instead of randomly picking features to compare, RSH learns a set of optimal linear projections (subspaces). For an input vector, it projects the data into $K$ subspaces and uses the index of the subspace with the maximum value as the hash code.
  2. Sequential Rank Subspace Hashing (SRSH): To avoid redundant hash bits, we wrap RSH in an AdaBoost-inspired sequential framework. Each new hash bit is trained to focus on the data pairs that previous bits failed to distinguish correctly.

Optimizing an "argmax" function is difficult due to its discontinuity. We reformulate the problem by seeking a piecewise linear upper bound of the error function, turning it into a solvable MinMax optimization problem updated via a gradient-based approach.

Experimental Results

We evaluated our approach on three benchmarks: LabelMe (512-dim Gist), Peekaboom (512-dim Gist), and MNIST (70,000 handwritten digits). PCA was used to reduce dimensionality to the top 40 directions for fair comparison.

Performance Across Code Lengths

A key advantage of the proposed method is its performance at extremely short code lengths. As shown in the following figure, SRSH consistently maintains higher average precision than baseline methods even when the code length is as small as 8 or 12 bits.

Average precision across varying code lengths for LabelMe, MNIST, and Peekaboom datasets.

Retrieval Precision

The Sequential Rank Subspace Hashing (SRSH) variant significantly outperforms state-of-the-art methods like Minimal Loss Hashing (MLH) and Spectral Hashing (SH). The precision-recall curves demonstrate that our learned ranking subspaces capture more discriminative information than traditional numeric binarization.

Precision-Recall curves at code length L=32, demonstrating the superior retrieval quality of SRSH.

Discussion and Conclusion

RSH serves as a powerful generalization of the Winner-Take-All hash. While WTA is restricted to axis-aligned projections, RSH learns arbitrary directions in the feature space. Even though the projections are linear, the "argmax" selection introduces high non-linearity, allowing the hash codes to capture complex data structures.

One limitation is that the objective function is convex-concave, meaning optimization can reach local minima. However, this diversity can actually benefit the creation of complementary hash bits. Future work may explore non-linear projections or integration into deep learning architectures to further enhance the robustness and discriminative power of rank-based hashing.

Summary updated

BibTeX
@misc{li2015rank,
  author = {Kai Li and Guojun Qi and Jun Ye and Kien A. Hua},
  title = {{Rank Subspace Learning for Compact Hash Codes}},
  year = {2015},
  eprint = {1503.05951},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1503.05951},
}
Figure