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

Unleashing the Full Potential of Product Quantization for Large-Scale Image Retrieval

Yu Liang, Shiliang Zhang, Kenli Li, Xiaoyu WangNeurIPS 2023

Introduction

Large-scale image retrieval—such as searching through millions of faces or products—requires compressing high-dimensional data into compact binary codes to ensure fast search speeds and low storage costs. While deep hashing has seen significant progress, most methods are validated on relatively small datasets.

When scaled up to real-world scenarios like the Glint360K dataset (which contains 17 million images), existing deep hashing methods often struggle with massive computational overhead or poor accuracy. Even the industry-standard Product Quantization (PQ) suffers from a "performance cliff": its retrieval accuracy drops sharply as codes get shorter. This decay happens because the feature subspaces in traditional PQ are not naturally suited for clustering.

To bridge the gap between classic product quantization and deep learning for massive-scale image retrieval, researchers have introduced FPPQ (Full Potential Product Quantization). By using differentiable PQ branches and class-level supervision, FPPQ achieves state-of-the-art accuracy even with extremely short code lengths on datasets containing millions of images.

Methodology: The FPPQ Framework

FPPQ is an end-to-end framework that trains a neural network backbone to produce features specifically optimized for product quantization. It avoids the massive $N \times N$ similarity matrix calculations (where $N$ is the number of classes) that bottleneck other deep hashing methods, making it highly efficient for massive datasets.

The FPPQ framework consists of a training phase with parallel classification and PQ branches, and a simplified retrieval phase.

The architecture introduces four key innovations:

  1. Differentiable PQ Branch: Alongside a standard classification head, the model includes a specialized PQ branch that divides features into distinct segments (subspaces).
  2. Class-Level PQ Labels: To guide the network, "ideal" PQ codes are pre-calculated for each class by performing k-means clustering on average features from a pre-trained model. These serve as fixed targets during training.
  3. Angular Optimization: Instead of standard Euclidean distance, FPPQ uses a softmax-based angular loss (inspired by CosFace) to maximize the discriminative power of each feature segment.
  4. Simplified Retrieval: Unlike traditional PQ, which requires a separate, computationally expensive clustering step after training, FPPQ uses the learned weights of its fully connected layers directly as the codebook.

Datasets and Evaluation

The researchers tested FPPQ across a range of scales to ensure robustness. Benchmarks included Glint360K (a massive face recognition dataset with ~360,000 identities and 17 million images), ImageNet1K & ImageNet100 (standard benchmarks for general image recognition), and MegaFace & FaceScrub (used for cross-dataset evaluation to test generalization to unseen data).

Key Insights and Results

Traditional PQ fails at short code lengths because sub-vectors are often evenly distributed, making them hard to compress. FPPQ forces the network to learn features that naturally cluster into predefined subspaces.

Perhaps the most important finding is FPPQ's "low-slope decay." The framework's performance degrades much more gracefully than traditional PQ as code length decreases, making it highly viable for extreme compression scenarios like edge device deployment.

FPPQ maintains high accuracy even as compression efficiency increases (left) and creates much more distinct sub-vector clusters compared to standard PQ (right).

Key performance highlights include:

  • Massive Performance Gains: On the Glint360K dataset using 32-bit codes, FPPQ achieved a Top-1 accuracy of 93.43%, compared to just 17.24% for traditional PQ and 36.88% for the best competing deep hashing method (GreedyHash).
  • Superior Clustering: t-SNE visualizations demonstrate that FPPQ creates much tighter, more distinct clusters in the feature subspaces compared to standard methods.
  • Architectural Robustness: The method showed consistent improvements across different backbones, including ResNet18, ResNet50, and ResNet100.

Limitations and Future Work

While highly effective, FPPQ relies on obtaining good initial class-level PQ labels from a pre-trained model. If the initial model is weak, the labels might not capture inter-class relationships effectively. Additionally, in scenarios with very few bits and hundreds of thousands of classes, different classes might be assigned the same PQ code. While the authors use a deduplication strategy, this remains a challenge for extreme compression.

Future work will explore ways to learn PQ labels dynamically during training rather than pre-defining them, which could further streamline the pipeline and improve overall retrieval performance.

Summary updated

BibTeX
@inproceedings{liang2023unleashing,
  author = {Yu Liang and Shiliang Zhang and Kenli Li and Xiaoyu Wang},
  title = {{Unleashing the Full Potential of Product Quantization for Large-Scale Image Retrieval}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=scG0cwftEe},
}
Figure