Introduction
Large-scale image retrieval necessitates efficient storage and rapid search capabilities. Hashing has emerged as a standard solution, mapping high-dimensional visual features into compact binary codes. This allows for fast similarity searches using Hamming distance. While deep learning has significantly advanced hashing by learning features and codes end-to-end, many existing methods rely on pairwise labels (binary similarity/dissimilarity). This paper argues that pairwise labels are insufficient for capturing the nuanced relative similarities inherent in visual data. Instead, the authors propose a deep supervised hashing framework based on triplet labels.
Methodology
The core of the proposed approach is a Siamese-triplet network designed to learn feature representations and hash codes simultaneously.
Architecture
The framework utilizes three identical sub-networks with shared weights. Each sub-network processes one component of a triplet: a query image, a positive image (similar to the query), and a negative image (dissimilar). The architecture typically employs a CNN-F backbone for feature extraction, followed by a fully connected layer that maps features to a continuous space representing potential hash codes.
Loss Function and Optimization
The model is trained using a novel loss function that optimizes two primary objectives:
- Triplet Label Likelihood: This term maximizes the probability that the query image is closer to the positive image than the negative image in the resulting Hamming space. By using triplets, the model learns relative rankings rather than just absolute categories.
- Quantization Error: To bridge the gap between the continuous outputs of the neural network and the discrete binary hash codes (±1), a penalty term is added. This forces the network to produce values close to the binary targets during training, reducing information loss during final quantization.
Furthermore, the authors introduce a positive margin parameter (α) within the likelihood function. This margin prevents the vanishing gradient problem by ensuring the model continues to learn even after it has correctly ranked a triplet, pushing the positive and negative examples further apart.
Experimental Evaluation
The proposed method was evaluated on two benchmark datasets: CIFAR-10 and NUS-WIDE.
Performance on CIFAR-10
On the CIFAR-10 dataset, which contains 60,000 images across 10 categories, the triplet-based method demonstrated superior performance. In a standard retrieval setting, it achieved a Mean Average Precision (MAP) of 0.774 at 48 bits, outperforming the previous state-of-the-art pairwise method, DPSH (0.757). In more intensive experimental configurations, the MAP reached as high as 0.926.
Performance on NUS-WIDE
The NUS-WIDE dataset presents a more challenging multi-label retrieval task with approximately 270,000 images. The proposed framework consistently outperformed both pairwise and other triplet-based deep hashing models, achieving a MAP of 0.824 at 48 bits.
Conclusion
This research demonstrates that triplet labels provide a more informative supervisory signal for deep hashing than traditional pairwise labels. By combining triplet likelihood maximization with an explicit quantization error penalty and a gradient-preserving margin, the proposed framework achieves state-of-the-art results in image retrieval. Future work may explore more advanced network backbones, complex hash layer modules, and hard triplet mining strategies to further enhance performance.
Summary updated