Abstract
Free-hand sketch-based image retrieval (SBIR) is a specific cross-view retrieval task, in which queries are abstract and ambiguous sketches while the retrieval database is formed with natural images. Work in this area mainly focuses on extracting representative and shared features for sketches and natural images. However, these can neither cope well with the geometric distortion between sketches and images nor be feasible for large-scale SBIR due to the heavy continuous-valued distance computation. In this paper, we speed up SBIR by introducing a novel binary coding method, named Deep Sketch Hashing (DSH), where a semi-heterogeneous deep architecture is proposed and incorporated into an end-to-end binary coding framework. Specifically, three convolutional neural networks are utilized to encode free-hand sketches, natural images and, especially, the auxiliary sketch-tokens which are adopted as bridges to mitigate the sketch-image geometric distortion. The learned DSH codes can effectively capture the cross-view similarities as well as the intrinsic semantic correlations between different categories. To the best of our knowledge, DSH is the first hashing work specifically designed for category-level SBIR with an end-to-end deep architecture. The proposed DSH is comprehensively evaluated on two large-scale datasets of TU-Berlin Extension and Sketchy, and the experiments consistently show DSH's superior SBIR accuracies over several state-of-the-art methods, while achieving significantly reduced retrieval time and memory footprint.
Introduction
Sketch-Based Image Retrieval (SBIR) provides an intuitive way for users to search for visual content using hand-drawn queries. Despite its appeal, SBIR faces two significant hurdles: the domain gap and scalability. Sketches are inherently abstract, lacking the texture and color of natural images, and often suffer from significant geometric distortion. Furthermore, traditional SBIR methods rely on high-dimensional continuous vectors, making large-scale retrieval computationally expensive and memory-intensive.
To address these challenges, we propose Deep Sketch Hashing (DSH). DSH is an end-to-end framework that maps both sketches and natural images into a shared Hamming space. By representing images as compact binary codes, we can leverage fast bitwise operations for near-instantaneous retrieval, even in massive databases.
Methodology: The Deep Sketch Hashing (DSH) Framework
The DSH framework employs a semi-heterogeneous architecture designed to learn discriminative binary codes while bridging the gap between sketches and photos.
Architecture and Components
The system consists of three distinct Convolutional Neural Networks (CNNs):
- C1-Net: Encodes natural images from the retrieval gallery.
- C2-Net (Middle): Processes auxiliary "sketch-tokens" derived from natural images.
- C2-Net (Top): Processes the user's free-hand sketch query.
The "Middle" and "Top" networks share weights in a Siamese configuration, as sketch-tokens and hand-drawn sketches share similar structural patterns.
Bridging the Domain Gap with Sketch-Tokens
A key innovation in DSH is the use of sketch-tokens—simplified edge maps extracted from natural images—to act as a domain stabilizer. By training the model to align hand-drawn sketches with these intermediate tokens, we mitigate the impact of geometric distortion.
Optimization and Loss Functions
DSH is trained using a multi-objective loss function:
- Cross-view Pairwise Loss: Ensures that sketches and images from the same category are mapped to similar binary codes.
- Semantic Factorization Loss: Incorporates word2vec embeddings to capture latent semantic relationships between categories (e.g., ensuring a "cheetah" sketch is closer to a "tiger" photo than a "dolphin" photo).
- Quantization Loss: Minimizes information loss during the conversion from continuous neural outputs to discrete bits.
Datasets and Experimental Setup
We evaluated DSH on two large-scale benchmarks:
- TU-Berlin Extension: Comprising 250 categories with 20,000 sketches and over 200,000 natural images.
- Sketchy: A fine-grained dataset with 125 categories, containing approximately 75,000 sketches and 73,000 natural images.
Results and Discussion
DSH demonstrates superior performance across all metrics compared to state-of-the-art (SOTA) methods.
- Accuracy: On the TU-Berlin dataset, DSH achieved a Mean Average Precision (MAP) of 0.570 (using 128-bit codes), significantly outperforming the next best deep method, Triplet-AlexNet (0.448).
- Efficiency: Retrieval from a 200,000-image gallery took only ~1 millisecond per query, compared to over 5 seconds for traditional continuous-feature methods.
- Memory Footprint: The memory required for the gallery was reduced from 6,390 MB (AlexNet features) to a mere 3.12 MB (128-bit DSH codes).
Conclusion
Deep Sketch Hashing represents a significant step forward in large-scale SBIR. By combining a semi-heterogeneous architecture with sketch-tokens and semantic word embeddings, DSH achieves high accuracy and unprecedented efficiency. While the current model focuses on category-level retrieval, future work will explore fine-grained SBIR and end-to-end learning of the sketch-token extraction process.
Summary updated