NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Learning Hash Codes with Listwise Supervision

Jun Wang, Wei Liu, Andy X. Sun, Yu-Gang Jiang

Abstract

This paper presents Ranking-based Supervised Hashing (RSH), a novel framework for large-scale image retrieval that optimizes hash codes using listwise supervision. Unlike traditional pointwise or pairwise methods that rely on binary similarity labels, RSH leverages the relative ordering of search results represented as triplets. By minimizing a ranking-based objective function with an orthogonality constraint, RSH learns linear projections that preserve the nuanced similarity hierarchy of high-dimensional data in a compact Hamming space. Evaluations on CIFAR-10, NUS-WIDE, and a one-million image dataset demonstrate that RSH significantly outperforms state-of-the-art hashing techniques in terms of ranking accuracy and retrieval quality.

Introduction

In large-scale image retrieval, hashing is essential for mapping high-dimensional data into short binary strings, enabling rapid searches via Hamming distance. Most existing "learning to hash" methods are either pointwise (treating learning as classification) or pairwise (matching similar items and separating dissimilar ones). However, search is fundamentally a ranking problem: if image A is more similar to a query than image B, it should appear higher in the results. Pointwise and pairwise methods often fail to explicitly optimize for this relative ordering, leading to suboptimal retrieval where the hierarchical structure of similarity is lost.

Methods

The core innovation of RSH is the use of listwise supervision via a triplet representation to capture the relative order of search results.

The RSH framework: from query point and ranking list to triplet matrix optimization and hash code generation.

The Triplet Matrix and Objective

For a given query $q$, the framework converts a ranked list of results into a triplet matrix $S$. If image $i$ is ranked higher than image $j$ for query $q$, the entry $S_{ij}$ is $1$; if lower, it is $-1$. The goal is to learn a linear projection matrix $A$ such that the resulting hash codes $H(x) = \text{sgn}(A^T x)$ produce a ranking in Hamming space consistent with this ground-truth triplet matrix.

Optimization

Since the sign function and ranking are non-differentiable, the objective is relaxed into a smooth quadratic form. An orthogonality constraint ($A^T A = I$) is enforced to ensure the learned hash bits are non-redundant. To solve this constrained optimization efficiently at scale, the authors employ the Augmented Lagrange Multipliers (ALM) method, providing robust convergence for large datasets.

Experimental Setup

The authors evaluated RSH on three significant image benchmarks:

  • CIFAR-10: 60,000 images across 10 classes, using semantic labels for ranking.
  • NUS-WIDE: Approximately 270,000 Flickr images, where ranking was determined by shared tag counts.
  • One-Million Tiny Images: A massive dataset where ground-truth ranking was established by Euclidean distance in the original feature space.

Key Results

RSH consistently outperformed state-of-the-art methods such as Semi-Supervised Hashing (SSH) and Minimal Loss Hashing (MLH) across all benchmarks.

Performance comparison of RSH against other hashing methods on the CIFAR-10 dataset using NDCG and ACG metrics.
  • Superior Ranking Accuracy: RSH showed a significant lead in Normalized Discounted Cumulative Gain (NDCG), particularly on the 1-million image dataset, confirming its ability to preserve complex similarity hierarchies.
  • Efficiency and Scalability: Despite the complexity of listwise supervision, the ALM optimization proved scalable to a million points. While offline training is computationally intensive ($O(DN^2)$), the online generation of hash codes remains extremely fast due to the simple linear projection model.
  • Semantic Relevance: Qualitative analysis indicated that RSH-returned images were more semantically relevant to queries compared to those from randomized or pairwise methods.

Conclusion

RSH demonstrates that ranking-based supervision provides a much richer signal for learning hash codes than coarse binary labels. By explicitly optimizing for relative order and ensuring bit independence through orthogonality, RSH achieves superior retrieval quality. Future work may explore extending this framework to non-linear kernel-based functions or multi-table hashing to further enhance precision in complex data distributions.

Summary updated

BibTeX
@inproceedings{wang2013learning,
  author = {Jun Wang and Wei Liu and Andy X. Sun and Yu-Gang Jiang},
  title = {{Learning Hash Codes with Listwise Supervision}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2013},
  doi = {10.1109/iccv.2013.377},
}
Figure