TL;DR
This paper introduces Dual Purpose Hashing (DPH), a unified deep learning framework that generates a single, compact binary code for an image capable of handling both category-based and attribute-based retrieval. By training a CNN on partially labeled data, the authors demonstrate that one "multifunctional" hash can outperform specialized state-of-the-art models while significantly reducing storage and computation costs.
The Challenge: Bridging Categories and Attributes
In modern image retrieval, users often have diverse needs. Sometimes the goal is to find images in the same category (e.g., "show me more shoes"). Other times, the search is for specific attributes (e.g., "show me shoes that are 'red' and 'leather'").
Traditionally, these have been treated as separate problems. Hashing—mapping high-dimensional images into short binary strings—is the standard for scaling retrieval. However, most hashing methods are "single-purpose": they preserve either category similarity or attribute similarity, but rarely both. Training separate models for every task is computationally expensive and redundant, as categories and attributes often share underlying visual features. Furthermore, datasets containing both category and attribute labels are rare, making joint training difficult.
Dual Purpose Hashing (DPH) Framework
The authors propose Dual Purpose Hashing (DPH), an end-to-end framework built on Convolutional Neural Networks (CNNs) designed to map images into a shared Hamming space that respects both semantic levels.
- The Architecture: The network uses standard convolutional layers to extract features. The core innovation is a binary-like layer with a sigmoid activation function. This layer produces a vector of values between 0 and 1, which are quantized into binary bits (0 or 1) during inference.
- Joint Optimization: The network is optimized using two distinct "heads": a Category Classifier using Softmax loss and Attribute Predictors using a modified, cost-sensitive Sigmoid Cross Entropy loss.
- Handling Partial Labels: To address data scarcity, the loss functions ignore missing labels. If an image only has a category label, it only contributes to the category loss. This allows the model to leverage vast amounts of partially labeled web data.
- Cost-Sensitivity: Because many attributes are sparse, the authors use a weighting parameter to balance the influence of positive and negative samples, preventing the model from defaulting to "absent" predictions.
Experimental Setup and Datasets
The authors evaluated DPH on two large-scale datasets:
- ImageNet-150K: A subset of ILSVRC2012 with 150,000 images across 1,000 categories, manually annotated with 25 attributes (color, texture, shape, etc.).
- CFW-60K: A face dataset containing 60,000 images of 500 subjects, annotated with 14 attributes (gender, race, age, etc.).
Key Insights and Results
- Shared Feature Hierarchy: Categories and attributes are descriptions of objects at different semantic levels. A CNN's hierarchical structure is naturally suited to capture these correlations simultaneously.
- Superior Performance: On ImageNet-150K, DPH achieved a Mean Average Precision (mAP) for category retrieval of 0.343 (128-bit), outperforming specialized CNN-based hashing methods like DLBHC (0.339) and DNNH (0.267).
- Efficiency through Recovery: Instead of storing real-valued attribute predictions, DPH stores only the binary hash. Attribute scores can be "recovered" via a simple matrix multiplication between the hash and learned attribute weights, making the system highly storage-efficient.
- Data Generalization: Training on a large amount of partially labeled data led to better generalization and less overfitting than training on a smaller set of fully labeled data.
Conclusion
DPH demonstrates that a single 256-bit code can perform three distinct tasks—category, attribute, and combined retrieval—more effectively than multiple specialized models. While future work may explore more complex attribute correlations or non-linear fusion strategies, DPH provides a robust foundation for multifunctional, scalable image retrieval.
Summary updated