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

Weakly Supervised Deep Hyperspherical Quantization for Image Retrieval

Jinpeng Wang, Bin Chen, Qiang Zhang, Zaiqiao Meng, Shangsong Liang, Shutao Xia

Abstract

Deep quantization is essential for efficient large-scale image retrieval, yet traditional supervised methods rely heavily on labor-intensive, manually labeled datasets. This paper introduces Weakly Supervised Deep Hyperspherical Quantization (WSDHQ), a novel framework that leverages noisy, user-provided web tags for supervision. By mapping image features and tag embeddings onto a shared semantic hypersphere and employing an adaptive margin loss, WSDHQ effectively manages tag sparsity and semantic ambiguity. Experimental results on benchmark datasets demonstrate that WSDHQ achieves state-of-the-art performance, significantly outperforming existing unsupervised and weakly-supervised quantization techniques.

Introduction

In the era of big data, searching through billions of images requires high-speed retrieval and minimal memory footprints. Quantization addresses this by compressing high-dimensional features into compact binary codes. While deep learning has advanced quantization accuracy, most models are "data-hungry," requiring perfectly labeled datasets like ImageNet.

In contrast, web-scale data often comes with "weak tags"—user-provided metadata that is abundant but messy, sparse, and semantically vague. Furthermore, standard deep networks often produce features with high norm variance, complicating the quantization process. WSDHQ addresses these challenges by learning high-quality quantization directly from impure web tags, bridging the gap between available data and supervised learning requirements.

Methodology

The WSDHQ framework is an end-to-end system designed to handle the inherent noise in web tags while optimizing quantization.

The WSDHQ framework overview, illustrating the joint learning of image features and quantization codebooks on a semantic hypersphere.

The architecture consists of five integrated components:

  1. Tag Semantic Enhancement: To mitigate noise and sparsity, tags are converted into embeddings using Word2Vec. A correlation graph is constructed to identify relationships, and synonymous tags are merged via density-based clustering.
  2. Semantic Hypersphere Mapping: Both image representations and tag embeddings are $\ell_2$-normalized to a unit hypersphere. This eliminates norm variance, forcing the model to focus on semantic direction (angular distance) rather than vector magnitude.
  3. Adaptive Cosine Margin Loss: Unlike standard losses that treat all negative samples uniformly, WSDHQ employs an adaptive margin. The margin is smaller for semantically related negative tags (e.g., "cat" vs. "dog") and larger for unrelated ones, facilitating the learning of fine-grained semantic nuances.
  4. Supervised Cosine Quantization: The model learns the quantizer (codebooks) simultaneously with the embeddings, minimizing the distance between continuous image embeddings and their compressed versions directly on the hypersphere.
  5. Joint Optimization: The entire pipeline, from feature extraction to codebook generation, is trained together to ensure optimal alignment between semantic representation and binary compression.

Experimental Evaluation

WSDHQ was evaluated on two prominent "image-tag-label" benchmarks: MIR-FLICKR25K (25,000 images, 1,386 tags) and NUS-WIDE (~270,000 images, 5,000+ tags). Notably, while these datasets include ground-truth labels, WSDHQ utilized only the tags for training, reserving labels strictly for evaluation.

Key Results

WSDHQ consistently outperformed both unsupervised and existing weakly-supervised methods across multiple metrics.

Precision curves for top-N returned samples on MIR-FLICKR25K and NUS-WIDE datasets, showing WSDHQ's superior performance.
  • Accuracy Gains: On the NUS-WIDE dataset, WSDHQ achieved a 15.9% increase in Mean Average Precision (MAP) over leading unsupervised methods.
  • State-of-the-Art Performance: It surpassed the previous best weakly-supervised method, WDHT, by 3.4% to 5.3% across the tested datasets.
  • Top-N Precision: As shown in the precision curves, WSDHQ maintains high precision for the top-ranked results, which is critical for practical search engine applications.

Discussion and Insights

The success of WSDHQ stems from several key design choices. Forcing features onto a hypersphere acts as a stabilizer, significantly reducing quantization error by focusing on semantic angles. Furthermore, leveraging multi-semantic tags provides a richer context than single labels; for instance, tags like #husky and #snow offer more descriptive power than a simple "dog" label. Finally, the end-to-end joint optimization of embeddings and codebooks proves superior to traditional two-stage processes.

Conclusion and Future Work

WSDHQ represents a significant advancement in weakly-supervised image retrieval. While effective, future work could explore incorporating external knowledge bases to learn tag relationships from scratch or implementing "tag completion" to address missing user metadata. Additionally, reducing the computational complexity of joint optimization remains an area for further refinement.

Summary updated

BibTeX
@inproceedings{wang2021weakly,
  author = {Jinpeng Wang and Bin Chen and Qiang Zhang and Zaiqiao Meng and Shangsong Liang and Shutao Xia},
  title = {{Weakly Supervised Deep Hyperspherical Quantization for Image Retrieval}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i4.16380},
}
Figure