SUBIC: A supervised, structured binary code for image search

Himalaya Jain, Joaquin Zepeda, Patrick Pérez, Rémi Gribonval

Abstract

For large-scale visual search, highly compressed yet meaningful representations of images are essential. Structured vector quantizers based on product quantization and its variants are usually employed to achieve such compression while minimizing the loss of accuracy. Yet, unlike binary hashing schemes, these unsupervised methods have not yet benefited from the supervision, end-to-end learning and novel architectures ushered in by the deep learning revolution. We hence propose herein a novel method to make deep convolutional neural networks produce supervised, compact, structured binary codes for visual search. Our method makes use of a novel block-softmax non-linearity and of batch-based entropy losses that together induce structure in the learned encodings. We show that our method outperforms state-of-the-art compact representations based on deep hashing or structured quantization in single and cross-domain category retrieval, instance retrieval and classification. We make our code and models publicly available online.

Introduction

In the era of massive visual datasets, the challenge of large-scale image search lies in balancing compactness with accuracy. To store and search millions of images efficiently, representations must be small enough for memory residency while remaining descriptive enough for precise retrieval. Historically, this problem has been approached from two directions: unsupervised structured quantization (like Product Quantization) which offers structural efficiency but lacks semantic supervision, and supervised deep hashing which utilizes deep neural networks but often results in unstructured bitstrings.

SUBIC (SUpervised Binary Code) bridges this gap by introducing a supervised framework that explicitly imposes a "one-hot block" structure on learned binary codes. By combining the semantic power of deep learning with the structural advantages of quantization, SUBIC achieves superior performance in both category and instance-based retrieval tasks.

Architecture and Methodology

The core of the SUBIC framework is the integration of a specialized encoding layer into a standard Convolutional Neural Network (CNN) pipeline. Unlike traditional hashing that produces a random string of bits, a SUBIC code is divided into $M$ blocks. Each block is constrained to be "one-hot," meaning exactly one bit per block is active (set to 1). This structure directly mimics Product Quantization but is learned end-to-end.

The SUBIC architecture integrates a base CNN with a specialized encoding layer featuring block-softmax and binary encoding.

To facilitate training via backpropagation, the discrete one-hot requirement is relaxed during the learning phase using a novel block-softmax non-linearity. This allows the network to optimize the representations continuously before they are quantized into binary codes for deployment.

Entropy-Based Learning

A critical component of SUBIC is the use of dual entropy-based losses to shape the distribution of the learned codes. These losses ensure the codes are both discriminative for individual images and diverse across the dataset:

  1. Mean Entropy Loss: This forces each individual block toward a low-entropy state, effectively pushing the block-softmax output to be as close to a one-hot vector as possible.
  2. Batch Entropy Loss: This ensures high entropy across a batch, preventing the network from collapsing into a state where only a few bits are ever used. It encourages the uniform use of all available "codewords" across the database.
The distribution of learned codes is highly sensitive to the ratio of mean and batch entropy losses (gamma/mu).

The balance between these losses, controlled by the hyperparameter ratio $\gamma/\mu$, is vital for performance. As shown in the experimental analysis, a balanced ratio (typically 1:1) prevents the representation from becoming either too sparse or too uniform, maintaining the necessary structure for efficient search.

Experimental Results

The authors evaluated SUBIC across several benchmarks, demonstrating its versatility and robustness:

  • Category Retrieval: On Cifar-10, SUBIC consistently outperformed major deep hashing competitors (e.g., DSH, DNNH). At a 48-bit rate, SUBIC achieved a mean Average Precision (mAP) of 0.686.
  • Cross-Domain Performance: SUBIC showed exceptional transferability. When trained on ImageNet and tested on Pascal VOC 2007, it reached an mAP of 0.560, significantly outperforming unsupervised PQ (0.496) and other supervised hashing methods.
  • Instance Retrieval: Despite being trained on category labels, the learned features proved robust enough to beat specialized unsupervised quantizers on the Oxford 5K and Paris 6K datasets.

Conclusion

SUBIC demonstrates that imposing structure on supervised binary codes acts as a powerful regularizer, leading to better generalization and more efficient search. By utilizing asymmetric search—where queries remain real-valued while the database is binary—SUBIC enables extremely fast similarity calculations (requiring only $M$ additions per image) without sacrificing the semantic depth provided by deep supervision. Future work may explore dynamic structures or extending the framework to weakly-supervised environments.

Summary updated

BibTeX
@inproceedings{jain2017subic,
  author = {Himalaya Jain and Joaquin Zepeda and Patrick Pérez and Rémi Gribonval},
  title = {{SUBIC: A supervised, structured binary code for image search}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2017},
  url = {https://openreview.net/forum?id=r1VLjez_WH},
}
Figure