Abstract
Deep incremental hashing has become a subject of considerable interest due to its capability to learn hash codes in an incremental manner, eliminating the need to generate codes for classes that have already been learned. However, accommodating more classes requires longer hash codes, and regenerating database codes becomes inevitable when code expansion is required. In this paper, we present a unified deep hash framework that can simultaneously learn new classes and increase hash code capacity. Specifically, we design a triple-channel asymmetric framework to optimize a new CNN model with a target code length and a code projection matrix. This enables us to directly generate hash codes for new images, and efficiently generate expanded hash codes for original database images from the old ones with the learned projection matrix. Meanwhile, we propose a pairwise-label-based incremental similarity-preserving loss to optimize the new CNN model, which can incrementally preserve new similarities while maintaining the old ones. Additionally, we design a double-end quantization loss to reduce the quantization error from new and original query images. As a result, our method efficiently embeds both new and original similarities into the expanded hash codes, while keeping the original database codes unchanged. We conduct extensive experiments on three widely-used image retrieval benchmarks, demonstrating that our method can significantly reduce the time required to expand existing database codes, while maintaining state-of-the-art retrieval performance.
Introduction
In large-scale image retrieval, hashing transforms complex images into compact binary codes to enable efficient search. However, real-world applications face two significant challenges: the emergence of new image classes and the need for increased hash code capacity as the database grows. Traditional methods often require retraining the entire model and re-indexing the entire database, which is computationally prohibitive for millions of images.
This paper introduces CEDIH (Code Expansion enabled Deep Incremental Hashing), presented at AAAI-2024. CEDIH is the first deep incremental hashing method that simultaneously learns new classes and expands hash code length without re-processing the entire database.
Methodology
The core of CEDIH is a triple-channel asymmetric framework that decouples neural network learning from database code expansion.
Simultaneous Expansion and the Projection Matrix
CEDIH expands existing $k$-bit codes by adding $c$ new bits. To avoid re-running old database images through a new CNN, the framework learns a linear projection matrix ($W$). Expanding the database involves a simple matrix multiplication of old codes by $W$, which is orders of magnitude faster than a deep learning forward pass.
Triple-Channel Input and Loss Functions
The model processes three streams: new training images, query images, and original training images. This ensures the network captures relationships between old and new data. Two key losses guide optimization:
- Incremental Similarity-Preserving Loss: A pairwise loss ensuring that pre-existing similarities are maintained while new similarities are integrated.
- Double-End Quantization Loss: Minimizes the error when mapping continuous network outputs to binary values for both new and original query images.
Experimental Results
The researchers evaluated CEDIH on three benchmarks: CIFAR-10, NUS-WIDE, and ImageNet.
- Efficiency: On ImageNet, CEDIH was nearly 4 times faster at expanding the database compared to traditional retraining methods. The update process for existing codes becomes nearly instantaneous.
- Accuracy: CEDIH consistently outperformed state-of-the-art (SOTA) baselines. For instance, on ImageNet with 48-bit codes, CEDIH combined with ADSH achieved a Mean Average Precision (mAP) of 0.6728, surpassing the standard ADSH's 0.6653.
- Compatibility: The method acts as a "plug-and-play" upgrade for various existing deep hashing architectures.
Conclusion
CEDIH addresses the scalability bottleneck in incremental hashing by enabling efficient code expansion. While it relies on a linear projection and pairwise similarity matrices, it represents a significant step forward in maintaining retrieval performance as databases evolve. Future work may explore non-linear projection mechanisms to further enhance the semantic capacity of expanded codes.
Summary updated