TL;DR
Traditional patch-wise contrastive learning for image translation evaluates patches independently, ignoring their spatial and semantic relationships. This paper introduces a novel framework that uses Graph Neural Networks (GNNs) to capture the topological structure of image patches. By sharing an adjacency matrix between the input and output images and maximizing mutual information between graph nodes, the model achieves state-of-the-art image translation while preserving complex structural context.
What Problem Does This Paper Address?
Unpaired image-to-image (I2I) translation (such as converting a photo of a horse into a zebra) aims to alter the style or domain of an image while preserving its underlying content structure. Recent approaches, like Contrastive Unpaired Translation (CUT), leverage patch-wise contrastive learning to maximize the mutual information between corresponding patches in the input and output images.
However, these methods suffer from a critical limitation: they focus solely on point-wise matching for individual patch pairs in isolation. They fail to consider the topology—the semantic and spatial relationships between a patch and its neighbors (e.g., how a horse's leg relates to its torso). This lack of neighborhood awareness often leads to structural distortions or unrealistic artifacts in complex scenes.
Methods
To bridge this gap, the authors propose a patch-wise graph contrastive learning framework that models images as topological graphs rather than isolated sets of patches.
- Graph Construction: The model randomly samples $N$ patches from the intermediate layers of a pre-trained feature extractor (VGG16). It computes the cosine similarity between these patch features. If the similarity exceeds a predefined threshold $t$, an edge is formed, generating an adjacency matrix $A$ for the input image graph $g_i$.
- Shared Adjacency Matrix: Crucially, the output image graph $g_o$ inherits the exact same adjacency matrix $A$ from the input graph. This enforces a strict structural prior: if two patches are semantically connected in the source image, their corresponding translated patches must maintain that connection.
- Graph Aggregation: The framework employs a Topology Adaptive Graph Convolutional Network (TAGCN) to extract $l$-hop features, aggregating structural information from neighboring nodes.
- Node-wise Contrastive Loss: An infoNCE loss function ($\mathcal{L}_{GNN}$) is applied to maximize the mutual information between corresponding nodes of the input graph ($Z$) and the output graph ($V$).
- Graph Pooling for Focused Attention: To capture hierarchical semantic structures, the authors introduce a learnable top-$K$ graph pooling mechanism. This downsamples the graph nodes based on a learnable vector $p$, filtering out irrelevant background noise and forcing the network to focus on task-relevant, highly informative regions.
Datasets
The method was validated on five standard unpaired image-to-image translation benchmarks:
horse → zebraLabel → Cityscapemap → satellitesummer → winterapple → orange
Additionally, the authors evaluated their framework on a single-image translation task, converting a Claude Monet painting into a realistic natural landscape.
Key Insights and Ideas
- Images as Topologies: Instead of treating an image as a collection of independent pixels or patches, viewing it as a graph allows the network to preserve higher-order relational structures during domain transfer.
- The Power of Shared Adjacency: Using the input image's patch-similarity matrix as a fixed prior for the output graph effectively constrains the generator, preventing it from warping the original geometry of the scene.
- Graph Pooling as Node-Wise Attention: Visualizations reveal that the learnable pooling vector $p$ automatically assigns higher weights to prominent object parts rather than background elements. This acts as an implicit attention mechanism, providing a localized, task-relevant view of the graph.
Key Results
Quantitative Performance
The proposed model consistently outperformed established baselines (including CycleGAN, CUT, NEGCUT, and HnegSRC) across multiple datasets using Fréchet Inception Distance (FID) and Kernel Inception Distance (KID) metrics:
summer → winter: Achieved an FID of 75.8, significantly lower than CUT (84.3) and HnegSRC (81.8).apple → orange: Achieved an FID of 139.1, outperforming CUT (171.5) and NEGCUT (154.1).map → satellite: Achieved a top-performing FID of 45.9.
Qualitative Performance
Visual comparisons demonstrated that the graph-based approach excels at preserving fine structural details. For instance, in horse → zebra translation, it accurately rendered complex spatial patterns (like the dark coloring around a mouth) and maintained the coherent shapes of thin tree branches, which were frequently distorted by competing methods.
Limitations and Future Work
- Hyperparameter Sensitivity: The model's performance is highly sensitive to the similarity threshold $t$ and the number of GNN hops $n$. If the threshold is too high, the resulting sparse connectivity causes a sharp degradation in translation quality, meaning the graph must remain sufficiently dense to be useful.
- Computational Complexity: Constructing patch-wise graphs, computing adjacency matrices, and executing graph convolutions/pooling layers introduces additional computational overhead compared to standard point-wise contrastive learning.
The authors suggest that future work could explore optimizing this graph architecture or extending topology-aware representations to other generative vision tasks.
Summary updated