NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

The Spatially-Correlative Loss for Various Image Translation Tasks

Chuanxia Zheng, Tat-Jen Cham, Jianfei Cai

Abstract

We propose a novel spatially-correlative loss that is simple, efficient and yet effective for preserving scene structure consistency while supporting large appearance changes during unpaired image-to-image (I2I) translation. Previous methods attempt this by using pixel-level cycle-consistency or feature-level matching losses, but the domain-specific nature of these losses hinder translation across large domain gaps. To address this, we exploit the spatial patterns of self-similarity as a means of defining scene structure. Our spatially-correlative loss is geared towards only capturing spatial relationships within an image rather than domain appearance. We also introduce a new self-supervised learning method to explicitly learn spatially-correlative maps for each specific translation task. We show distinct improvement over baseline models in all three modes of unpaired I2I translation: single-modal, multi-modal, and even single-image translation.

Introduction

Image-to-Image (I2I) translation involves changing the visual style of an image (e.g., day to night) while maintaining its underlying content (e.g., the layout of a street). For years, the industry standard has been CycleGAN, which relies on "cycle-consistency": the requirement that an image translated to a target domain and back should match the original. However, this approach is computationally expensive and often fails when the appearance gap between domains is significant.

Other methods utilize "perceptual losses" based on pre-trained networks like VGG. Unfortunately, these networks often conflate shape and texture, leading to artifacts where the model confuses background structures with foreground textures. The fundamental challenge lies in defining "structure" in a way that is entirely independent of "appearance."

Methodology: Structure as Self-Similarity

The core innovation of this work is representing structure through self-similarity. Instead of evaluating what a pixel represents in isolation, the method analyzes how a pixel relates to its neighbors. By focusing on internal spatial correlations, the model can decouple scene structure from domain-specific attributes.

The proposed framework extracts features to generate similarity maps, which are then compared to enforce structural consistency.

The authors introduce two variants of this loss:

  1. FSeSim (Fixed Self-Similarity): Utilizes a standard pre-trained VGG16 network to extract features and calculate local self-similarity maps.
  2. LSeSim (Learned Self-Similarity): A task-specific version that uses contrastive learning (InfoNCE) to train a small network. This network learns to identify homologous structures across domains while ignoring lighting, color, or texture variations.

By minimizing the difference between the self-similarity maps of the input and output, the generator is forced to maintain the original layout even during massive style shifts. This "one-sided" approach eliminates the need for the expensive cycle-consistency requirement, reducing memory usage by 30-50% compared to CycleGAN.

Experimental Results

The researchers evaluated the Spatially-Correlative Loss across diverse benchmarks, including Cityscapes (label-to-photo), Horse-to-Zebra, and multi-modal tasks like Winter-to-Summer.

Visual comparison showing how the structure map remains consistent between the input horse and the output zebra.

Key Findings:

  • Superior Accuracy: On the Cityscapes task, the LSeSim model achieved 73.2% pixel accuracy, significantly higher than CycleGAN (57.2%) and the previous state-of-the-art, CUT (68.8%).
  • Enhanced Realism: In terms of Fréchet Inception Distance (FID), LSeSim scored 38.0 on the Horse-to-Zebra task, outperforming CycleGAN’s 77.2 and CUT’s 45.5.
  • Structural Fidelity: Qualitative analysis demonstrates that LSeSim avoids "ghosting" artifacts and preserves thin structures, such as tree branches, which are often lost in other one-sided translation methods.

Conclusion and Future Work

The Spatially-Correlative Loss provides a robust, memory-efficient solution for structure-preserving I2I translation. While highly effective for tasks where the layout remains static, it is not currently designed for tasks requiring significant shape deformation (e.g., dog-to-cat translation). Future research may explore adapting these self-similarity maps to handle flexible geometric transformations or integrating them into modern generative frameworks like Diffusion models.

Summary updated

BibTeX
@inproceedings{zheng2021spatially,
  author = {Chuanxia Zheng and Tat-Jen Cham and Jianfei Cai},
  title = {{The Spatially-Correlative Loss for Various Image Translation Tasks}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.01614},
}
Figure