Learning Dense Correspondences between Photos and Sketches

Xuanchen Lu, Xiaolong Wang, Judith E. Fan

Abstract

Humans possess a remarkable ability to understand the relationship between abstract sketches and the physical objects they represent. This understanding extends beyond simple categorization to include dense correspondence—the ability to map specific elements of a sketch to their counterparts in the real world. To advance computational capabilities in this domain, we introduce PSC6k, a large-scale benchmark containing 150,000 human-annotated keypoints across 6,250 photo-sketch pairs. Alongside this dataset, we propose a self-supervised framework that utilizes contrastive learning and spatial transformer networks to estimate warp flows between modalities. Our approach significantly outperforms existing baselines and demonstrates a notable shift toward human-like shape bias, though a performance gap between artificial models and human consistency remains.

Introduction

When viewing a sparse line drawing of a cat, a human observer does more than identify the animal; they instinctively understand how a specific curved line corresponds to an ear or how a dot represents an eye. This ability to find dense correspondences across varying levels of abstraction is a cornerstone of visual intelligence. For artificial intelligence, however, this task is fraught with difficulty. Standard computer vision models are heavily reliant on textures, colors, and dense gradients—features that are largely absent in sketches. Furthermore, sketches often involve significant spatial distortions and stylistic abstractions that break the geometric consistency typically found in natural images.

To bridge this gap, we address two primary needs: a robust benchmark for evaluating cross-modal alignment and a modeling framework capable of learning these correspondences without dense supervision.

The PSC6k Benchmark

A major hurdle in sketch-photo research has been the lack of fine-grained, part-level data. We introduce the PSC6k dataset, which augments the existing Sketchy dataset with 150,000 human-annotated keypoints. Covering 125 object categories, PSC6k provides the first large-scale ground truth for dense correspondence between photos and sketches. This benchmark allows for a rigorous evaluation of how well models understand the internal structure and alignment of objects across different visual domains.

Methodology

Our proposed framework approaches the correspondence problem through a self-supervised, two-stage process designed to handle the stylistic gap between photos and line drawings.

1. Multimodal Feature Encoding

We employ a shared feature encoder ($\phi$) trained with a contrastive learning objective (InfoNCE). The goal is to project both photos and sketches into a shared latent space where corresponding pairs are pulled together while unrelated pairs are pushed apart. To account for the distinct visual signatures of each modality, we utilize conditional batch normalization, allowing the encoder to adapt its internal statistics based on whether the input is a photo or a sketch.

2. Pyramidal Warp Estimation

Building on the latent representations, a warp estimator ($T$)—inspired by Spatial Transformer Networks (STN)—predicts a displacement field, or "warp flow." This flow mathematically deforms the photo to align with the sketch. The estimator operates in a coarse-to-fine pyramidal fashion across three scales (4x4, 8x8, and 16x16), allowing the model to capture both global structure and finer local details.

3. Weighted Perceptual Similarity

Because sketches are primarily composed of empty space, standard similarity losses can be noisy. We implement a weighted similarity function that prioritizes alignment at the locations of the sketch strokes. This ensures the model focuses on the structural information provided by the artist rather than the background.

Key Insights and Results

State-of-the-Art Performance

On the PSC6k benchmark, our ResNet-101-based model achieved a PCK-10 (Percentage of Correct Keypoints) of 84.93%. This represents a significant improvement over previous state-of-the-art methods, such as WarpC-SemanticGLUNet, which it outperformed by over 5 percentage points. Notably, the model demonstrated robust generalization, maintaining high accuracy even on object categories not seen during training.

The Shape Bias Shift

One of the most significant findings of this work is the impact of sketch-photo alignment on a model's "shape bias." Standard models trained on ImageNet are notoriously biased toward texture (e.g., identifying a cat by its fur pattern). By training to align photos with abstract sketches, our model's shape bias increased from approximately 20% to over 46%. While this is still below the human level of ~95%, it represents a substantial move toward more human-like visual processing.

The Human-Model Consistency Gap

Despite the performance gains, our analysis revealed a persistent gap in consistency. While humans are highly consistent with one another when identifying keypoints on a sketch, current models exhibit systematic biases that differ from human intuition. This suggests that while we have improved alignment, models do not yet fully capture the "logic" of human abstraction.

Limitations and Future Work

Our current approach faces three primary challenges:

  1. Contextual Confusion: The model occasionally struggles to distinguish between primary objects and commonly co-occurring items (e.g., a cup versus a saucer).
  2. Resolution Limits: The 16x16 resolution of the flow regression makes it difficult to align very fine structures, such as whiskers or thin appendages.
  3. Topology Breaks: The warping mechanism assumes a continuous transformation. It struggles with sketches that use extreme perspectives or disconnected parts that break the object's expected topology.

Future research will explore the integration of stroke-based keypoints and higher-resolution flow fields to better capture the nuances of artistic line drawings.

Conclusion

By introducing the PSC6k benchmark and a self-supervised warping framework, we provide both the data and the methodology necessary to advance cross-modal visual understanding. Our results demonstrate that learning to relate sketches to photos not only improves correspondence tasks but also fundamentally shifts how models perceive shape and structure, bringing artificial systems one step closer to human-like visual abstraction.

Summary updated

Abstract

Humans effortlessly grasp the connection between sketches and real-world objects, even when these sketches are far from realistic. Moreover, human sketch understanding goes beyond categorization -- critically, it also entails understanding how individual elements within a sketch correspond to parts of the physical world it represents. What are the computational ingredients needed to support this ability? Towards answering this question, we make two contributions: first, we introduce a new sketch-photo correspondence benchmark, $\textit{PSC6k}$, containing 150K annotations of 6250 sketch-photo pairs across 125 object categories, augmenting the existing Sketchy dataset with fine-grained correspondence metadata. Second, we propose a self-supervised method for learning dense correspondences between sketch-photo pairs, building upon recent advances in correspondence learning for pairs of photos. Our model uses a spatial transformer network to estimate the warp flow between latent representations of a sketch and photo extracted by a contrastive learning-based ConvNet backbone. We found that this approach outperformed several strong baselines and produced predictions that were quantitatively consistent with other warp-based methods. However, our benchmark also revealed systematic differences between predictions of the suite of models we tested and those of humans. Taken together, our work suggests a promising path towards developing artificial systems that achieve more human-like understanding of visual images at different levels of abstraction. Project page: https://photo-sketch-correspondence.github.io
BibTeX
@inproceedings{lu2023learning,
  author = {Xuanchen Lu and Xiaolong Wang and Judith E. Fan},
  title = {{Learning Dense Correspondences between Photos and Sketches}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=B622xXCViz},
}
Figure