Cross-domain Correspondence Learning for Exemplar-based Image Translation

Pan Zhang, Bo Zhang, Dong Chen, Lu Yuan, Fang Wen

Abstract

CoCosNet introduces a novel approach to exemplar-based image translation by establishing dense, cross-domain correspondences. Unlike previous methods that rely on global style vectors, CoCosNet learns to map local textures from a reference image to a target layout (e.g., segmentation masks or edge maps) through a shared latent space. This enables high-fidelity synthesis with fine-grained control over local style, significantly outperforming existing baselines in both quantitative metrics and human evaluations.

Introduction

Conditional image synthesis aims to translate an input, such as a segmentation mask or edge map, into a photorealistic image. A key challenge in this field is exemplar-based translation, where a user provides a reference image to guide the style (color, texture, and lighting) of the output.

Historically, state-of-the-art methods like SPADE or MUNIT have encoded the exemplar into a single, global latent style vector. However, this approach often "washes out" local spatial details. For instance, if an exemplar contains both a brick building and a grassy lawn, a global vector might fail to distinguish between these textures, resulting in a blended or inconsistent output. To achieve high-fidelity results, the model must establish dense, pixel-to-pixel correspondence between the input layout and the exemplar photo. Finding these matches across heterogeneous domains (e.g., matching a flat color mask to a highly textured photograph) is difficult because standard pre-trained feature extractors are typically optimized for natural images only.

The CoCosNet Framework

The authors propose CoCosNet (CrOss-domain COrreSpondence network), which tackles this challenge by jointly learning correspondence and translation end-to-end. The architecture consists of two primary sub-networks:

  1. Cross-domain Correspondence Network: Instead of matching a mask directly to a photo, the network employs domain adaptors to project both inputs into a shared intermediate feature domain. In this shared space, it computes a dense correlation matrix to identify semantic matches. This matrix is then used to warp the exemplar image so its layout aligns perfectly with the input mask.
  2. Translation Network: The final image is generated by progressively injecting style from the warped exemplar. The network utilizes Spatially-Adaptive Denormalization (SPADE) blocks, but replaces standard Batch Normalization with Positional Normalization (PN). PN computes statistics at each spatial position rather than across the batch, which significantly improves the preservation of structural information from the warped exemplar.
The CoCosNet architecture consists of a cross-domain correspondence network and a translation network.

Because ground-truth pixel correspondence between a mask and a random photo does not exist, the network is trained with weak supervision. The authors utilize "pseudo exemplar pairs" (geometrically distorted versions of the target image) and a cycle-consistency forward-backward warping loss to ensure the network learns meaningful semantic mappings.

Experimental Evaluation

CoCosNet was evaluated across several diverse datasets, including ADE20k (mask-to-image), CelebA-HQ (edge-to-face), and DeepFashion (pose-to-body).

Quantitative Results

CoCosNet significantly outperforms leading baselines such as Pix2pixHD, SPADE, and MUNIT. On the diverse ADE20k dataset, CoCosNet achieved a Fréchet Inception Distance (FID) of 26.4, compared to SPADE's 33.9. It also achieved a Sliced Wasserstein Distance (SWD) of 10.5, nearly doubling the performance of SPADE (19.7).

Qualitative Results and User Study

Qualitative comparisons demonstrate that CoCosNet successfully transfers instance-level textures—such as specific fabric patterns or exact architectural structures—where previous methods produce blurred or generic results. In human evaluations, CoCosNet was preferred in 84.2% of cases for image quality and 93.8% of cases for style relevance against competing methods.

Qualitative comparison showing CoCosNet's superior ability to transfer local textures compared to baselines.

Beyond standard translation, the learned dense semantic correspondence enables zero-shot applications such as makeup transfer (mapping makeup from one face to another based on semantic features) and intuitive semantic image editing.

Conclusion and Future Work

CoCosNet establishes a new benchmark for exemplar-based image translation by successfully bridging the gap between heterogeneous domains through shared latent spaces and positional normalization. While the current implementation faces a memory bottleneck due to the $HW \times HW$ dense correlation matrix—limiting its scalability to very high resolutions—it provides a robust foundation for future research in spatially-aware style transfer. Future work will focus on optimizing the correspondence computation to handle higher-resolution synthesis and addressing mapping ambiguities in complex scenes.

Summary updated

BibTeX
@inproceedings{zhang2020cross,
  author = {Pan Zhang and Bo Zhang and Dong Chen and Lu Yuan and Fang Wen},
  title = {{Cross-domain Correspondence Learning for Exemplar-based Image Translation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  doi = {10.1109/cvpr42600.2020.00519},
}
Figure