Cross-Modal Fusion Distillation for Fine-Grained Sketch-Based Image Retrieval

Abhra Chaudhuri, Massimiliano Mancini, Yanbei Chen, Zeynep Akata, Anjan Dutta

TL;DR

XModalViT rethinks fine-grained sketch-based image retrieval (FG-SBIR) by moving away from the traditional search for "modality-invariant" features. Instead of discarding the differences between sketches and photos, it uses a Vision Transformer-based teacher to fuse complementary information from both modalities and then distills that rich, fused knowledge into independent encoders for lightning-fast retrieval.

What Problem Does This Paper Address?

Fine-grained sketch-based image retrieval (FG-SBIR) is the "needle in a haystack" problem of computer vision: given a hand-drawn sketch, can an algorithm find the exact corresponding photo in a massive gallery?

Traditionally, researchers have treated the "modality gap" between sketches (lines, abstract) and photos (pixels, texture) as a nuisance to be filtered out. They aim for a shared embedding space where only the features common to both remain. However, the authors of this paper argue that this "modality-invariant" approach throws the baby out with the bathwater. A sketcher might use scribbles to represent a dark texture; that scribble is "modality-specific," but it's highly discriminative. By ignoring these nuances, models lose the fine-grained details necessary to distinguish between two very similar objects.

Methods

The authors propose a two-stage framework called XModalViT (Cross-Modal Vision Transformer):

  1. The Teacher (Modality Fusion): They train a "Teacher" network that takes a photo-sketch pair as input. Using a novel Cross-Modal Attention (XMA) mechanism, the model allows the photo and sketch to "talk" to each other. It learns a fused representation that captures shared semantics plus complementary modality-specific details. To train this, they use XAQC (Cross-Attention Queue Contrast), a contrastive loss that uses a dynamic queue of negative samples to ensure the fused embeddings are highly distinct for every instance.
  2. The Students (Cross-Modal Distillation): You can't use a fusion network during actual retrieval because you don't have the target photo yet! To solve this, the authors decouple the teacher. They train two independent "Student" encoders (one for sketches, one for photos) to mimic the teacher’s fused output.
Figure 2: Our XModalViT framework: The modality fusion network (teacher) takes as input, a positive photo-sketch pair and computes XMA embeddings for the individual modalities. During the cross- modal knowledge distillation phase, the weights of the teacher are frozen and the independent student networks are tasked with mapping the same pair of datapoints to the corresponding XMA branch of the teacher, thereby decoupling the domain of the XMA operator.

Beyond just matching individual points, they use Cross-Modal Relational Distillation (XMRD). This ensures the students don't just learn where to map a point, but also learn the geometry of the teacher's space—preserving the distances and angular relationships between different objects.

Datasets

The model was evaluated on three standard FG-SBIR benchmarks:

  • QMUL-Shoe-V2: 2,000 photos and 6,648 sketches of shoes.
  • QMUL-Chair-V2: 400 photos and 1,275 sketches of chairs.
  • Sketchy: A large-scale multi-class dataset featuring 125 categories with over 12,000 photos and 75,000 sketches.

Key Insights and Ideas

  • Fusion > Invariance: The core "aha" moment is that modality-specific features are not noise; they are signals. Fusing them creates a more expressive representation than trying to find a common denominator.
  • The "Oracle" Teacher: By letting the teacher see both modalities at once during training, it acts as an oracle. The students, even though they only see one modality at a time, learn to "hallucinate" the missing information from the other modality because they are trained to match the teacher's fused output.
  • Attention to Detail: Qualitative results show that XModalViT attends to discriminative features like scribbles for texture or specific geometric partitions that conventional models ignore.
Comparison of attention maps: XModalViT (left) captures discriminative scribbles and textures that modality-shared approaches (right) miss.

Key Results

XModalViT achieved state-of-the-art (SOTA) results across the board:

  • Shoe-V2: Reached 45.05% acc@1, beating the previous SOTA by 1.35%.
  • Chair-V2: Achieved 63.48% acc@1.
  • Sketchy: Reached 56.15% acc@1, a massive 6.01% improvement over the previous best. Notably, this performance surpasses the average human-level accuracy (54.27%) reported for this dataset.
  • Efficiency: The distillation process allows the model to use smaller, faster "Student" backbones (like ViT-Small) at runtime while still benefiting from the knowledge of a "Base" or "Large" teacher.

Limitations and Future Work

The authors note a potential side-effect of modality fusion: the model can sometimes become too sensitive to texture. For example, in the Shoe-V2 dataset, the model occasionally returned a false positive because a shoe in the gallery had a similar "shiny" texture to the ground truth, even if the shape was slightly off.

Future work could explore more robust ways to balance texture and geometry or apply this "fusion-then-distillation" strategy to other cross-modal tasks like text-to-video retrieval.

Summary updated

BibTeX
@inproceedings{chaudhuri2022cross,
  author = {Abhra Chaudhuri and Massimiliano Mancini and Yanbei Chen and Zeynep Akata and Anjan Dutta},
  title = {{Cross-Modal Fusion Distillation for Fine-Grained Sketch-Based Image Retrieval}},
  booktitle = {BMVC},
  year = {2022},
  url = {https://openreview.net/forum?id=Y2G-DwRvcX6},
}
Figure