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: The Limits of Local Similarity
Efficient image and video retrieval relies on hashing: transforming high-dimensional data into compact binary codes. Ideally, similar items (e.g., two pictures of dogs) should have very similar binary codes, while dissimilar items (a dog and a car) should be far apart in the "Hamming space" (the space of binary strings).
Most existing deep hashing methods use local similarity metrics, such as pairwise or triplet losses. These methods compare two or three samples at a time to adjust their codes. However, this approach has three major flaws:
- Computational Complexity: Comparing all possible pairs or triplets is computationally expensive ($O(n^2)$ or $O(n^3)$), making it hard to scale.
- Insufficient Coverage: Local comparisons often fail to capture the global distribution of the data.
- Data Imbalance: In the real world, there are vastly more "dissimilar" pairs than "similar" ones, which can drown out the learning signal in local-based methods.
Methodology: Central Similarity Quantization (CSQ)
The authors introduce Central Similarity Quantization (CSQ). Instead of comparing samples to each other, they compare every sample to a pre-defined hash center.
1. Defining Hash Centers
A hash center is a specific binary code that acts as a "target" for a category. For these centers to be effective, they must be far apart from one another. The authors propose two ways to generate these:
- Hadamard Matrices: Using rows from a Hadamard matrix ensures that every center is mathematically orthogonal to the others, providing the maximum possible distance between categories.
- Bernoulli Distributions: If the number of categories exceeds the dimensions of the Hadamard matrix, they randomly sample bits from a Bernoulli distribution, which statistically ensures a large mutual distance.
2. The CSQ Framework
- Central Similarity Loss: During training, the model uses a Binary Cross Entropy (BCE) loss to force the generated hash code of an image to match its assigned category center.
- Multi-label Handling: For images with multiple labels, the authors use a "voting" mechanism. They take the centers of all labels present in the image and create a new "centroid" center by bit-wise voting.
- Quantization Loss: To ensure the neural network outputs actual binary values (0 or 1) rather than continuous numbers, they use a smooth
log coshfunction to push values toward the extremes.
Key Results and Insights
The researchers evaluated CSQ on five major benchmarks, including ImageNet, MS COCO, and NUS-WIDE.
- Accuracy: CSQ outperformed previous leaders like HashNet and DCH by 3% to 20% in Mean Average Precision (mAP). On ImageNet (64-bit), CSQ achieved 0.873 mAP compared to HashNet's 0.739.
- Efficiency: Training time was reduced significantly. CSQ trained 3x to 5.5x faster than DHN and HashNet because it avoids the overhead of generating and processing pairs/triplets.
- Cohesion: Visualization (via t-SNE) showed that hash codes generated by CSQ "collapsed" tightly around their assigned centers, creating very distinct clusters for different categories compared to the more scattered results of triplet-based methods.
Conclusion
The "aha moment" of this research is that you don't need to see every pair of images to know they are similar. If both images are forced to look like the same "center," they will naturally become similar to each other. This shifts the complexity from $O(n^2)$ to $O(nm)$, where $m$ is the number of classes. While current implementation treats all categories as equidistant, future work could explore hierarchical hash centers to incorporate inter-class semantic relationships.
Summary updated