Central Similarity Quantization for Efficient Image and Video Retrieval

Yuan, Li, Tao Wang, Xiaopeng Zhang, Francis Eh Tay, Zequn Jie, Wei Liu, Jiashi Feng · DOI

Abstract

Existing data-dependent hashing methods usually learn hash functions from pairwise or triplet data relationships, which only capture the data similarity locally, and often suffer from low learning efficiency and low collision rate. In this work, we propose a new global similarity metric, termed as central similarity, with which the hash codes of similar data pairs are encouraged to approach a common center and those for dissimilar pairs to converge to different centers, to improve hash learning efficiency and retrieval accuracy. We principally formulate the computation of the proposed central similarity metric by introducing a new concept, i.e., hash center that refers to a set of data points scattered in the Hamming space with a sufficient mutual distance between each other. We then provide an efficient method to construct well-separated hash centers by leveraging the Hadamard matrix and Bernoulli distributions. Finally, we propose the Central Similarity Quantization (CSQ) that optimizes the central similarity between data points w.r.t. their hash centers instead of optimizing the local similarity. CSQ is generic and applicable to both image and video hashing scenarios. Extensive experiments on large-scale image and video retrieval tasks demonstrate that CSQ can generate cohesive hash codes for similar data pairs and dispersed hash codes for dissimilar pairs, achieving a noticeable boost in retrieval performance, i.e. 3%-20% in mAP over the previous state-of-the-arts.

Introduction

Efficient image and video retrieval relies on hashing: transforming high-dimensional data into compact binary codes. Ideally, similar items should have similar codes (low Hamming distance), and dissimilar items should have very different codes. Most existing "deep learning to hash" methods rely on local similarity metrics, comparing pairs or triplets of data points during training. This leads to three major bottlenecks: computational complexity scaling at $O(n^2)$ or $O(n^3)$, insufficient global coverage, and severe data imbalance between similar and dissimilar pairs.

Central Similarity Quantization (CSQ) addresses these issues by replacing traditional local hashing with a global hash center approach. By encouraging similar data points to collapse toward pre-defined, well-separated centers in Hamming space, CSQ achieves a 3%–20% boost in retrieval accuracy (mAP) and trains up to 5.5x faster than previous state-of-the-art methods.

Methods: From Local to Global Similarity

The core innovation is Central Similarity, a global metric that measures the distance between a data point's hash code and a pre-defined hash center.

Comparison of local similarity learning (Doublet, Triplet) vs. the proposed global Central Similarity approach.

Defining Hash Centers

A hash center is a point in the $K$-dimensional Hamming space. To ensure different classes are easily distinguishable, these centers must be as far apart as possible. The authors propose two systematic ways to generate them:

  • Hadamard Matrices: Utilizing the properties of Hadamard matrices to create mutually orthogonal rows, ensuring a mutual Hamming distance of exactly $K/2$.
  • Bernoulli Distributions: Randomly sampling bits, which provides a mutual distance of $K/2$ in expectation—useful when the number of classes exceeds the dimensions of a Hadamard matrix.

Central Similarity Quantization (CSQ)

Instead of asking "Is Image A like Image B?", the model asks "How close is Image A to its assigned Class Center?". For single-label data, each category is assigned one unique hash center. For multi-label data, the target center is calculated as the "centroid" of the centers of all labels the image possesses, determined via a bit-wise voting mechanism. The loss function combines a Central Similarity Loss ($L_C$) using Binary Cross Entropy and a Quantization Loss ($L_Q$) using a smooth "log-cosh" function to force convergence toward discrete binary values.

Key Results

The authors evaluated CSQ on five major benchmarks: ImageNet, MS COCO, NUS-WIDE, UCF101, and HMDB51.

t-SNE visualizations comparing the distribution of hash codes for different hashing methods. CSQ (d) shows significantly tighter clusters around global centers.
  • Accuracy Boost: CSQ outperformed previous SOTA methods (like HashNet and DCH) across the board. On ImageNet, it improved Mean Average Precision (mAP) by roughly 11.5% to 20% depending on the bit length.
  • Training Speed: CSQ achieved a 3x to 5.5x speedup in training time compared to DHN and HashNet.
  • Visual Cohesion: As seen in the t-SNE plots above, CSQ successfully causes hash codes to "collapse" toward their centers while maintaining large distances between dissimilar centers.

Conclusion

CSQ provides a "North Star" intuition: by providing a fixed global target for every class, the model doesn't need to see every possible pair of images. This significantly improves efficiency and robustness to data imbalance. While current centers are agnostic to semantic similarity between classes (e.g., "dog" vs "cat"), future work may explore "data-aware" centers or dynamic bit lengths to further refine performance.

Summary updated

BibTeX
@inproceedings{li2020central,
  author = {Yuan, Li and Tao Wang and Xiaopeng Zhang and Francis EH Tay and Zequn Jie and Wei Liu and Jiashi Feng},
  title = {{Central Similarity Quantization for Efficient Image and Video Retrieval}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  doi = {10.1109/cvpr42600.2020.00315},
}
Figure