Towards Unsupervised Sketch-based Image Retrieval

Conghui Hu, Yongxin Yang, Yunpeng Li, Timothy M. Hospedales, Yi-Zhe SongBMVC 2021

Abstract: The practical value of existing supervised sketch-based image retrieval (SBIR) algorithms is largely limited by the requirement for intensive data collection and labeling. In this paper, we present the first attempt at unsupervised SBIR to remove the labeling cost (both category annotations and sketch-photo pairings) that is conventionally needed for training. Existing single-domain unsupervised representation learning methods perform poorly in this application, due to the unique cross-domain (sketch and photo) nature of the problem. We therefore introduce a novel framework that simultaneously performs sketch-photo domain alignment and semantic-aware representation learning. Technically this is underpinned by introducing joint distribution optimal transport (JDOT) to align data from different domains, which we extend with trainable cluster prototypes and feature memory banks to further improve scalability and efficacy. Extensive experiments show that our framework achieves excellent performance in the new unsupervised setting, and performs comparably or better than state-of-the-art in the zero-shot setting.

TL;DR

This paper presents the first framework for completely unsupervised category-level Sketch-Based Image Retrieval (SBIR), eliminating the need for expensive sketch-photo pairings and category labels. By combining a novel prototype-and-memory-enhanced Optimal Transport method (PM-JDOT) with self-supervised learning, the model successfully bridges the massive visual domain gap between abstract sketches and realistic photos without relying on human annotations.

What Problem Does This Paper Address?

Sketch-Based Image Retrieval (SBIR) allows users to search for photos using hand-drawn sketches. While highly useful, training effective SBIR models traditionally requires massive datasets of paired sketches and photos, along with category labels. Even "zero-shot" SBIR methods—which can retrieve unseen categories—still require heavily annotated data for their training classes.

Unsupervised SBIR removes the need for category labels and explicit sketch-photo pairings.

Collecting this paired, labeled data is a severe bottleneck. While unsupervised representation learning (like contrastive learning) has made huge strides recently, these methods are designed for single domains (e.g., just photos). If you apply them directly to a mix of sketches and photos, they fail because the visual gap between a line drawing and a full-color texture-rich photo is simply too wide. The authors tackle the challenge of learning a shared, semantically meaningful feature space for both domains using only raw, unpaired, and unannotated images.

Methods

The authors propose an alternating optimization framework that tackles two goals simultaneously: cross-domain alignment and semantic-aware feature learning.

The proposed framework uses prototypes and memory banks to align sketch and photo domains through alternating optimization.
  1. Cross-Domain Alignment via PM-JDOT: To align the sketch and photo domains, the authors use Joint Distribution Optimal Transport (JDOT). However, standard JDOT is computationally intractable across a whole dataset, and applying it batch-by-batch fails because a random batch of sketches and a random batch of photos likely contain completely different categories, leading to forced, incorrect alignments. To fix this, the authors introduce PM-JDOT (Prototype and Memory-enhanced JDOT). Instead of matching batches directly, they compute Optimal Transport between learnable cluster prototypes (which compactly represent the entire dataset's distribution) and feature memory banks (which store representations from recent batches). This allows for accurate, global soft-matching without the $O(N^2)$ computational cost.

  2. Unsupervised Representation Learning: To ensure the features actually represent semantic categories (e.g., "dog" vs. "car"), the authors adapt SwAV, a self-supervised clustering method. By applying random augmentations (cropping, flipping) to an image and forcing the network to predict consistent cluster assignments for all versions of that image, the model learns domain-agnostic, class-discriminative features.

Datasets

The framework is trained and evaluated on two standard SBIR benchmarks, but crucially, it ignores all provided labels and pairings during training:

  • Sketchy-Extended: Contains ~75k sketches and ~73k photos spanning 125 categories.
  • TUBerlin-Extended: Contains 20k sketches and corresponding photos spanning 250 categories.

Key Insights and Ideas

  • Batch-wise Optimal Transport is fundamentally flawed for multi-domain retrieval: If you try to align a batch of 128 sketches with 128 photos, the chance that they contain matching semantic concepts is incredibly low. Forcing an alignment here actively harms the model.
  • Prototypes act as a global bridge: By using a small set of learnable cluster prototypes to represent the entire dataset, the network can figure out how the global distribution of sketches maps to the global distribution of photos, bypassing the limitations of small batch sizes.
  • Self-supervision needs cross-domain help: State-of-the-art self-supervised methods (like SwAV) are great at clustering within a domain, but they cannot inherently bridge the sketch-photo gap. Explicit cross-domain alignment (via PM-JDOT) must be synergistically combined with in-domain self-supervision to make unsupervised SBIR work.

Key Results

  • Unsupervised SBIR: The proposed method drastically outperforms existing unsupervised baselines. On the Sketchy-Extended dataset, it achieves 28.17% mAP and 33.64% Prec@200. For context, applying standard SwAV yields only 10.15% mAP, and combining SwAV with a GAN for image translation yields 18.82% mAP.
  • Zero-Shot SBIR: Even though the model uses zero labels or pairings during training, it performs competitively with older supervised zero-shot SBIR methods. On TUBerlin-Extended, it achieves 22.91% mAP, beating supervised zero-shot baselines like CVAE (0.50% mAP) and Doodle (10.94% mAP).
  • Ablation: The addition of prototypes and memory banks is highly effective. Standard batch-wise JDOT achieved only 18.53% mAP on Sketchy-Extended; adding prototypes bumped it to 20.98%, and adding the memory bank brought it to the final 28.17%.

Limitations and Future Work

While the paper establishes a strong baseline for a brand-new task, unsupervised SBIR performance naturally still lags behind fully supervised state-of-the-art models. Additionally, the method relies on K-means clustering to initialize the prototypes, which requires setting a hyperparameter ($K$) for the expected number of clusters/categories in the dataset—something that might not always be perfectly known in a truly unsupervised wild-data scenario. Future work will likely focus on closing the performance gap with supervised methods and refining the clustering mechanisms to be entirely dynamic.

Summary updated

BibTeX
@inproceedings{hu2021towards,
  author = {Conghui Hu and Yongxin Yang and Yunpeng Li and Timothy M. Hospedales and Yi-Zhe Song},
  title = {{Towards Unsupervised Sketch-based Image Retrieval}},
  booktitle = {BMVC},
  year = {2021},
  url = {https://openreview.net/forum?id=MiE33mtVgR},
}
Figure