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

Deep Spherical Quantization for Image Search

Sepehr Eghbali, Ladan TahvildariCVPR 2019

Abstract

Deep Spherical Quantization (DSQ) is a supervised quantization framework designed to improve large-scale image search. By mapping deep neural network features onto a unit hypersphere, DSQ eliminates norm variance, a common issue that hinders the efficiency of traditional quantization methods. Through a joint supervised learning approach involving multiple loss functions, DSQ produces compact and highly discriminative binary codes. Our evaluation on standard benchmarks shows that DSQ consistently outperforms state-of-the-art hashing and quantization methods.

Introduction

In large-scale image retrieval, finding the nearest neighbor in a high-dimensional space is computationally expensive. Approximate Nearest Neighbor (ANN) search using hashing or multi-codebook quantization (MCQ) is the standard approach to achieve efficiency. However, deep learning features often suffer from high norm variance, where the lengths of feature vectors vary significantly. This variance increases quantization error and reduces search accuracy. Deep Spherical Quantization (DSQ) addresses this by enforcing a spherical constraint on features, ensuring they all lie on a unit hypersphere.

Methodology

The Spherical Constraint and Normalization

The core of DSQ is the $L_2$ normalization of output features. This projects data points onto a unit hypersphere, where Euclidean distance is equivalent to the inner product. This simplification removes the negative effects of varying vector lengths, allowing the quantization process to focus on the angular distribution of features, which is more semantically meaningful.

Joint Supervised Learning

DSQ integrates quantization into the training process using a composite loss function:

  • Softmax Loss: Ensures the network learns basic classification.
  • Center Loss: Pulls features of the same class toward a central point to increase intra-class compactness.
  • Quantization Loss ($L_Q$): Minimizes the error between deep features and their quantized approximations.
  • Discriminative Dictionary Learning ($L_D$): Encourages quantized points to remain close to their respective class centers.
Ablation study demonstrating the impact of different loss components on the Mean Average Precision (MAP).

Sparse Extension (SDSQ)

A sparse variant, SDSQ, is also proposed. By applying $L_1$ regularization during codebook learning, the model generates sparse codewords. This sparsity can be exploited to skip redundant calculations during the search phase, potentially improving lookup speeds by 30% without significantly compromising retrieval accuracy.

Experimental Results

DSQ was evaluated on three major datasets: CIFAR-10, NUS-WIDE, and ImageNet.

State-of-the-Art Comparison

DSQ consistently achieves higher Mean Average Precision (MAP) than existing methods like DTQ, SUBIC, and DQN across various bit lengths. For example, on ImageNet with 64-bit codes, DSQ achieves a MAP of 0.6940, surpassing the previous state-of-the-art.

Retrieval performance comparison of DSQ against various baseline methods across three benchmark datasets.

Key Insights

  • Normalization as a Baseline: Simply normalizing features improves the performance of most MCQ methods, as it simplifies the distance metric.
  • Flexible Codebook Learning: Unlike Product Quantization, DSQ does not enforce strict orthogonality between codebooks, allowing for a better fit to the data distribution.
  • Semantic Separability: The joint loss function ensures that the final binary codes preserve the semantic structure of the data, leading to better generalization on unseen classes.

Conclusion

Deep Spherical Quantization provides a robust solution to the norm variance problem in deep feature quantization. By combining geometric constraints with supervised learning, it achieves superior retrieval accuracy. Future research could explore the application of DSQ to more modern architectures and its scalability to even larger datasets.

Summary updated

BibTeX
@inproceedings{eghbali2019deep,
  author = {Sepehr Eghbali and Ladan Tahvildari},
  title = {{Deep Spherical Quantization for Image Search}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  doi = {10.1109/cvpr.2019.01196},
}
Figure