Deep Shape Matching: Learning Modality-Invariant Representations
Abstract
We cast shape matching as metric learning with convolutional networks. We break the end-to-end process of image representation into two parts. Firstly, well established efficient methods are chosen to turn the images into edge maps. Secondly, the network is trained with edge maps of landmark images, which are automatically obtained by a structure-from-motion pipeline. The learned representation is evaluated on a range of different tasks, providing improvements on challenging cases of domain generalization, generic sketch-based image retrieval or its fine-grained counterpart. In contrast to other methods that learn a different model per task, object category, or domain, we use the same network throughout all our experiments, achieving state-of-the-art results in multiple benchmarks.
Introduction
Standard convolutional neural networks (CNNs) excel at capturing color and texture, but these features can be misleading or absent in many computer vision tasks. In sketch-based image retrieval (SBIR), artwork, or extreme illumination conditions, textures are often distorted or non-existent. The challenge lies in creating a descriptor that captures the underlying shape of an object—the most stable information across different visual modalities.
This paper presents a method for shape matching that uses a single CNN trained on edge maps rather than raw RGB images. By leveraging automatically generated 3D reconstructions to create training pairs, the authors develop a "modality-invariant" representation that achieves state-of-the-art results without requiring human-annotated sketches.
Methodology
Edge-Based Representation
To force the network to focus exclusively on geometry, the image representation process is decoupled into two parts. First, images are converted into edge maps using a standard edge detector (specifically, the Dollar and Zitnick detector).
Second, a novel, differentiable edge filtering layer is prepended to the CNN. This layer uses a sigmoid and power transformation to suppress background noise and rank edge strengths, effectively turning a noisy edge map into a clean, sketch-like representation.
Training via Structure-from-Motion
The network is trained using metric learning with a Siamese architecture and contrastive loss. Crucially, the authors avoid manual labeling by using a Structure-from-Motion (SfM) pipeline. By automatically building 3D models of landmarks, they can identify different photos of the same physical structure to serve as positive training pairs.
The final descriptor, called EdgeMAC, is produced by applying Global Max Pooling (MAC) to the last convolutional layer of a VGG16 backbone, followed by $\ell_2$ normalization.
Experimental Results
Domain Generalization
On the PACS dataset (Photos, Art, Cartoon, Sketches), the EdgeMAC descriptor achieved a mean accuracy of 76.2%, significantly higher than the previous best reported score of 69.2%. This demonstrates the model's ability to generalize to unseen styles by focusing on shape.
Sketch-Based Image Retrieval (SBIR)
In the Flickr15k benchmark, the method achieved 46.1 mAP, outperforming both hand-crafted descriptors and other CNN-based methods trained on specific sketch datasets. This is a striking result given that the model was trained entirely without human-drawn sketches. When combined with a "diffusion" re-ranking technique, this performance jumped to 68.9 mAP.
Fine-Grained Retrieval
On category-specific datasets like Shoes and Handbags, the model achieved top-tier performance (e.g., 92.2% acc@10 on Shoes), proving that a generic network can compete with models trained specifically for those categories.
Conclusion
This work demonstrates that shape is a powerful universal bridge for cross-domain computer vision. By training on edge maps derived from automated 3D reconstructions, the authors develop a highly generalizable descriptor that achieves state-of-the-art results across domain generalization and sketch-based retrieval without human supervision for the sketch domain. Future work may explore end-to-end pipelines and broader training sets to further improve generalization for organic shapes.
Summary updated