TL;DR
Searching for a visual concept when you don't know what it's called—such as an unfamiliar animal performing an action—is a common failure mode for standard search engines. This paper introduces Composite Sketch+Text Based Image Retrieval (CSTBIR), pairing rough, hand-drawn sketches of "hard-to-name" objects with complementary text describing "hard-to-sketch" actions or contexts. The authors release a large-scale dataset of ~2M queries and propose STNET, a multimodal transformer that uses sketch-guided attention, object detection, and sketch reconstruction to dramatically outperform existing text- and sketch-only baselines.
What Problem Does This Paper Address?
Imagine trying to search for a photo of an Australian numbat digging in the ground, but you don't know the word "numbat." - Text-based image retrieval (TBIR) struggles: substituting a lengthy description like "small mammal with striped back and long snout digging" often returns badgers, chipmunks, or mongooses. - Sketch-based image retrieval (SBIR) also falters: while a numbat is easy to sketch, abstract interactions like "digging in the ground" or detailed scene contexts are notoriously tedious and difficult to draw.
Existing composite retrieval benchmarks typically assume users sketch full scenes or provide complete, standalone sentences. In real life, users want a low-effort interface: a crude, 15-second sketch of the object combined with a partial phrase defining the interaction or attributes.
Methods
The authors propose STNET (Sketch+Text Network), a multimodal framework built on pretrained Vision Transformers (ViT) and CLIP encoders:
[Sketch S] ---> ViT Sketch Encoder ----> h_CLS^S
|
(Dot Product)
v
[Image I] ---> CLIP Image Encoder ---> Spatial Attention ---> h_AVG^I <---\
|-- Contrastive Loss
[Text T] ---> CLIP Text Encoder --------------------------> h_CLS^T <---/
- Sketch-Guided Image Conditioning: Rather than treating modalities symmetrically, the sketch specifically tells the model what to look for in a cluttered natural image. The pooled sketch representation ($h_{CLS}^S$) applies spatial dot-product attention over the image encoder's patch tokens, isolating the target object before pooling into a unified visual feature vector ($h_{AVG}^I$).
- Multi-Task Pretraining Objectives: Beside the standard InfoNCE contrastive retrieval loss ($\mathcal{L}_{CT}$) between text and the sketch-attended image, STNET is trained on three auxiliary objectives:
- Object Classification ($\mathcal{L}_{CLS}$): Classifies the target category independently from the incomplete text and image, forcing the encoders to extract semantics from context.
- Sketch-Guided Object Detection ($\mathcal{L}_{OD}$): A YOLO-style detection head predicts bounding boxes for the sketched object in the natural scene.
- Sketch Reconstruction ($\mathcal{L}_{SR}$): A deconvolutional decoder attempts to reconstruct the binary query sketch directly from the attended image features using Binary Cross-Entropy and Dice loss.
Datasets
- CSTBIR (New Benchmark): Combines natural images and dense region captions from Visual Genome with rough freehand drawings from Google's Quick, Draw! (where sketches were drawn in under 20 seconds).
- 258 overlapping categories, 108K scene images, 562K sketches, and ~2M composite queries.
- Unlike benchmarks like FS-COCO where sketches span the whole scene, CSTBIR sketches cover only ~36.7% of the image area on average.
- Evaluation Splits:
- Test-1K: 1,000 queries over 1,000 gallery scene images.
- Test-5K: 4,000 queries over 5,000 gallery images.
- Open-Category Test Set: 750 queries across 70 novel classes unseen during training (50 specifically curated rare/elusive objects like feijoa, mangosteen, and draw knife).
Key Insights and Ideas
- Naive Two-Stage Pipelines Create Semantic Bottlenecks: A natural baseline is a two-stage approach (predict class name from sketch $\to$ insert into text $\to$ run standard CLIP). However, this fails when sketches have ambiguous labels (e.g., bat, crane), collapses fine-grained visual attributes, and breaks down completely on rare/novel categories that classifiers haven't seen.
- Sketch as an Attention Mask: Natural scenes contain dozens of distractor objects. Using sketch features as an attention operator over image patch tokens acts as a soft visual searchlight, helping the image encoder filter out background noise before cross-modal matching.
- Auxiliary Detection and Reconstruction Prevent Feature Collapse: The ablation study revealed that removing the classification, detection, or sketch-reconstruction losses consistently degraded retrieval performance, with sketch reconstruction and detection explicitly grounding the visual alignment.
Key Results
- Test-1K Benchmark: STNET achieved 73.7% Recall@10 and a Median Rank (MdR) of 3.0, outperforming:
- Sketch-only baselines (ViT-Siamese: 20.4% R@10, MdR 48.0).
- Text-only baselines (CLIP: 50.6% R@10, MdR 10.0).
- Composite baselines (Two-Stage: 67.0% R@10, MdR 5.0; Taskformer: 22.4% R@10).
- Test-5K Benchmark: STNET maintained superior performance under larger gallery scaling with 38.7% R@10 and 20.5 MdR (vs. 34.8% R@10 and 24.0 MdR for the two-stage baseline).
- Zero-Shot / Open-Category Retrieval: On the 70 unseen classes, STNET maintained 37.2% R@10 (compared to 29.0% for Two-Stage and 21.6% for CLIP), demonstrating that the learned visual-sketch alignment generalizes beyond trained labels.
- Detailed Instance Sketches: When evaluated with synthetic instance-level contour sketches containing accurate pose and shape details, STNET improved to 70.3% R@10 on Test-1K, showing it benefits from higher sketch fidelity.
Limitations and Future Work
- Heuristic Dataset Assembly: CSTBIR forms composite queries by pairing Quick, Draw! doodles with cropped Visual Genome region annotations rather than collecting organic, simultaneous human-drawn sketch-and-text inputs.
- Supervision Requirements: Training requires bounding box annotations to optimize the object detection loss ($\mathcal{L}_{OD}$), which may limit straightforward scaling to unannotated web-crawled image sets.
- Future Directions: Expanding the setting to interactive visual search (e.g., iterative user refinements via follow-up doodles/text) and applying it to real-world tasks like surveillance search or fine-grained e-commerce catalog retrieval.
Summary updated