Abstract
Large-scale image retrieval increasingly relies on deep supervised hashing to transform high-dimensional data into compact binary codes. However, existing methods often fail to capture the full semantic class structure or struggle to unify single-label and multi-label scenarios. This paper introduces Hierarchy Neighborhood Discriminative Hashing (HNDH), a framework that optimizes a hierarchical loss function. By combining a coarse-grained bipartite graph to align image embeddings with sub-class centers and a fine-grained pairwise constraint to preserve instance-level similarities, HNDH generates highly discriminative hash codes. Experimental results on CIFAR-10 and NUS-WIDE demonstrate that HNDH outperforms state-of-the-art methods while maintaining a more accurate data manifold.
Introduction
The rapid growth of digital imagery necessitates efficient retrieval techniques. Hashing has emerged as a standard solution, enabling fast searches in Hamming space using simple bitwise operations. Despite the success of deep supervised hashing, a significant gap remains: many models focus exclusively on pairwise or triplet relationships, often neglecting the broader semantic class structure. Furthermore, multi-label hashing often oversimplifies the relationship between images and multiple categories, potentially destroying the natural manifold of the data. HNDH addresses these challenges by providing a unified view for both single-label and multi-label retrieval through a hierarchical neighborhood approach.
Methods
The HNDH framework utilizes a one-stream deep neural network based on a pre-trained VGG-19 backbone. The core innovation lies in its hierarchical objective function, which consists of two primary components designed to capture different levels of semantic granularity:
- Coarse Neighborhood Discriminative Loss ($J_1$): This loss constructs a bipartite graph between sub-class feature centers (representing category averages) and individual image embeddings. By employing a softmax-based probability, it encourages images to align with their correct semantic category centers, thereby minimizing intra-class variation and maximizing inter-class separation.
- Fine Neighborhood Discriminative Loss ($J_2$): To ensure the model preserves instance-level nuances, a pairwise constraint is integrated. This ensures that images sharing labels remain close in Hamming space, regardless of their global category assignment.
The final objective function is a weighted sum ($J = N J_1 + \lambda J_2$), allowing the model to learn a discrete space that respects both global category boundaries and local similarities. This unified view naturally simplifies to standard single-label classification when appropriate, while scaling gracefully to multi-label scenarios.
Results and Discussion
HNDH was evaluated on two benchmark datasets: the single-label CIFAR-10 and the multi-label NUS-WIDE. The model consistently outperformed state-of-the-art baselines such as DDSH, DSDH, and MLDH across various bit lengths (12, 24, 32, and 48 bits).
On CIFAR-10, HNDH achieved a Mean Average Precision (MAP) of 0.838 at 48 bits, representing a 1.1% improvement over existing top-performing methods. On NUS-WIDE, it reached a MAP@5K of 0.848 at 48 bits, outperforming the multi-label specialist MLDH by approximately 0.7%.
Qualitative analysis via t-SNE visualizations confirms the effectiveness of the hierarchical approach. As shown in the figures, the full HNDH model produces tighter, more distinct clusters with clearer boundaries compared to ablation variants (HNDH-F using only fine loss, or HNDH-C using only coarse loss). This suggests that the combination of class-level and instance-level constraints is crucial for preserving the intrinsic structure of the feature space without causing the "collapse" seen in methods that force multi-label images toward a single geometric center.
Conclusion
HNDH provides a robust and unified framework for image hashing. By leveraging a hierarchical neighborhood structure, it effectively handles the complexities of both single-label and multi-label data while preserving the underlying data manifold. Future research will explore extending this approach to cross-modal retrieval and investigating its scalability to datasets with significantly larger and more fine-grained label sets.
Summary updated