SketchMate: Deep Hashing for Million-Scale Human Sketch Retrieval

Peng Xu, Yongye Huang, Tongtong Yuan, Kaiyue Pang, Yi-Zhe Song, Tao Xiang, Timothy M. Hospedales, Zhanyu Ma, Jun Guo

Abstract

Sketch retrieval at scale faces unique challenges due to the abstract nature of human drawings and the importance of temporal stroke dynamics. We present SketchMate, a deep hashing framework that utilizes a dual-branch CNN-RNN architecture to capture both visual and temporal features. Central to our approach is the "sketch center loss" (SCL), which improves semantic clustering in Hamming space. Evaluated on the massive QuickDraw-3.8M dataset, SketchMate significantly outperforms existing photo-centric hashing methods in both accuracy and retrieval speed.

Introduction

While image retrieval for natural photos is a mature field, sketches present distinct hurdles. First, sketches are iconic and "messy" abstractions rather than pixel-perfect representations. Visually similar sketches (e.g., a dog vs. a pig) can belong to entirely different semantic categories. Second, unlike static photos, a sketch is a sequence of strokes. The order and direction of these strokes provide vital discriminative information often ignored by standard computer vision models.

Existing research has largely focused on small datasets (under 100k samples), which do not reflect the "data-hungry" requirements of deep hashing. Furthermore, standard hashing algorithms designed for photos fail to account for the high intra-class variance and temporal nature of human drawings.

The SketchMate Framework

To address these challenges, we propose SketchMate, an end-to-end deep hashing network designed to capture the "what" (visual appearance) and the "how" (stroke dynamics) of a sketch.

The SketchMate architecture features a dual-branch design: a CNN for raster images and a bidirectional RNN for stroke sequences, fused before a quantization-encoding layer.

The model employs a two-branch architecture:

  • CNN Branch: Processes the raster (pixel) image to extract spatial features.
  • RNN Branch: Uses a bidirectional GRU to process the vector (stroke) sequence, capturing temporal cues.
  • Late Fusion: Features from both branches are concatenated to form a robust representation.
  • Quantization-Encoding Layer: Maps high-dimensional features into compact binary codes using a sigmoid activation, optimized for fast retrieval.

Sketch Center Loss (SCL)

A core innovation of SketchMate is the Sketch Center Loss (SCL). Standard hashing often suffers from "semantic overlap" in Hamming space, where different categories are not sufficiently separated. SCL encourages sketches of the same category to cluster around a fixed, representative "center" while pushing different categories apart.

Comparison of loss functions: (a) standard cross-entropy, (b) common center loss, and (c) the proposed sketch center loss, which achieves superior class separation.

In million-scale learning, updating class centers dynamically is computationally expensive. SketchMate uses fixed centers derived from a "clean" subset of data. To handle the inherent noise in crowd-sourced data like Google QuickDraw, we employ an entropy-based filter. Sketches with very low or very high Shannon entropy are excluded when calculating class centers, ensuring a more reliable training signal.

Large-Scale Evaluation

We introduce QuickDraw-3.8M, a dataset of 3,829,500 sketches across 345 categories—an order of magnitude larger than previous benchmarks like TU-Berlin or Sketchy.

SketchMate sets a new state-of-the-art:

  • Retrieval Performance: On QuickDraw-3.8M, SketchMate achieved a Mean Average Precision (MAP) of 0.6791 (64-bit), outperforming competitors by 6-8%.
  • Zero-Shot Generalization: The model maintained high performance (0.7547 MAP) on 20 unseen categories, proving it learns generalizable features.
  • Efficiency: Retrieval is near real-time, taking approximately 0.28 seconds to search a gallery of 345,000 sketches.

Conclusion and Future Work

SketchMate demonstrates that combining temporal stroke information with visual features and specialized loss functions is key to large-scale sketch retrieval. While highly effective for category-level retrieval, future work will address fine-grained, instance-level retrieval and more sophisticated noise-filtering techniques beyond simple image entropy.

Summary updated

BibTeX
@inproceedings{xu2018sketchmate,
  author = {Peng Xu and Yongye Huang and Tongtong Yuan and Kaiyue Pang and Yi-Zhe Song and Tao Xiang and Timothy M. Hospedales and Zhanyu Ma and Jun Guo},
  title = {{SketchMate: Deep Hashing for Million-Scale Human Sketch Retrieval}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2018},
  doi = {10.1109/cvpr.2018.00844},
}
Figure