CoCosNet v2: Full-Resolution Correspondence Learning for Image Translation

Xingran Zhou, Bo Zhang, Ting Zhang, Pan Zhang, Jianmin Bao, Dong Chen, Zhongfei Zhang, Fang Wen

Abstract

Exemplar-based image-to-image translation aims to synthesize images that follow the semantic structure of a source while adopting the style and texture of a reference. Previous methods struggle with high resolutions due to the $O(N^2)$ complexity of dense correspondence matching. CoCosNet v2 addresses this "memory wall" by introducing a hierarchical strategy combined with a differentiable PatchMatch algorithm refined by Convolutional GRUs. This approach enables full-resolution matching (up to $1024 \times 1024$), allowing the model to faithfully reproduce meticulous textures and fine-grained details from the exemplar.

Introduction

The core challenge in exemplar-based image-to-image (I2I) translation is maintaining high-resolution fidelity. While global style transfer methods exist, they often "wash out" the fine-grained textures that define realism. The original CoCosNet (v1) attempted to solve this via dense semantic correspondences, but computational constraints limited matching to low resolutions (e.g., $64 \times 64$). CoCosNet v2 overcomes these limitations, enabling the "borrowing" of intricate textures—such as fabric weaves or brushstrokes—to produce photo-realistic results at $512 \times 512$ and $1024 \times 1024$ resolutions.

Methods

CoCosNet v2 achieves full-resolution matching through three primary innovations:

  1. Hierarchical Strategy: The model employs a coarse-to-fine approach. Initial matches are found at low resolution and serve as a starting point for subsequent, higher-resolution levels in a pyramid. This significantly narrows the search space at each step.
  2. GRU-assisted PatchMatch: The authors adapt the efficient PatchMatch algorithm into a differentiable deep learning framework. A Convolutional Gated Recurrent Unit (ConvGRU) is used to refine correspondences iteratively, leveraging spatial context and temporal memory to improve the "smart search" for matching patches.
  3. Differentiable Warping: To enable unsupervised training without ground-truth correspondence, the model uses a soft-warping function. By calculating a weighted average of the top-$K$ matches, gradients can flow through the matching process, allowing the network to learn optimal correspondences.

The final generation process uses these high-resolution warped features to modulate the translation via SPADE-like layers, ensuring the output respects both the source's semantic structure and the exemplar's meticulous details.

High-resolution translation across diverse domains (sculpture, painting, portrait) preserving fine details.

Results and Discussion

The model was evaluated on several high-resolution datasets, including DeepFashion ($512 \times 512$), MetFaces ($1024 \times 1024$), and ADE20K.

Key Insights

  • Efficiency through Locality: By leveraging the spatial coherence of images, PatchMatch avoids the prohibitive $O(N^2)$ cost of all-to-all pixel comparisons.
  • Learned Refinement: Replacing traditional random sampling with a learned ConvGRU allows the model to understand the underlying geometry and context of the images during the search process.

Performance Metrics

CoCosNet v2 significantly outperformed state-of-the-art models like SPADE and the original CoCosNet. On the DeepFashion dataset, it achieved a Fréchet Inception Distance (FID) of 22.5, a notable improvement over CoCosNet v1 (26.9) and SPADE (34.4). Qualitative results demonstrate a superior ability to transfer complex patterns, such as the specific weave of a garment or unique artistic brushwork, which previous methods typically blurred.

Full-resolution texture preservation in DeepFashion, maintaining intricate patterns like stripes.

Conclusion

CoCosNet v2 demonstrates that full-resolution correspondence is essential for high-quality, exemplar-based image translation. While the training process is complex and requires pseudo-exemplars for bootstrapping, the resulting inference is efficient and produces state-of-the-art results. Future work may extend these high-resolution matching techniques to video-to-video translation and interactive editing tools.

Summary updated

BibTeX
@inproceedings{zhou2021cocosnet,
  author = {Xingran Zhou and Bo Zhang and Ting Zhang and Pan Zhang and Jianmin Bao and Dong Chen and Zhongfei Zhang and Fang Wen},
  title = {{CoCosNet v2: Full-Resolution Correspondence Learning for Image Translation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.01130},
}
Figure