Abstract
Recently, contrastive learning-based image translation methods have been proposed, which contrast different spatial locations to enhance spatial correspondence. However, these methods often ignore the diverse semantic relations within images. To address this, we propose a novel Semantic Relation Consistency (SRC) regularization along with Decoupled Contrastive Learning (DCE). These methods utilize diverse semantics by focusing on heterogeneous semantics between image patches of a single image. Furthermore, we present a hard negative mining strategy by exploiting these semantic relations. Experimental results across single-modal, multi-modal, and GAN compression tasks confirm the state-of-the-art performance of our method.
Introduction: The Challenge of Heterogeneous Semantics
Image-to-Image (I2I) translation (e.g., turning a photo of a horse into a zebra) traditionally relied on cycle-consistency constraints. Recent shifts toward contrastive learning, such as the CUT model, have simplified this by maximizing mutual information between corresponding locations in input and output images.
However, existing contrastive methods often treat all "negative" patches (patches from different locations) as equally distinct. In reality, images possess heterogeneous semantics. For a query patch of a horse's head, another patch of the horse's leg is semantically related, while a patch of the background grass is not.
Ignoring these internal relationships leads to artifacts and poor spatial correspondence in translated images.
Proposed Methodology
1. Semantic Relation Consistency (SRC)
Instead of simple point-to-point matching, SRC calculates a "similarity distribution" for a query patch against all other patches in the input image. It then enforces that this distribution remains consistent in the output image using Jensen-Shannon Divergence (JSD).
By preserving this similarity map, the model maintains the structural "logic" of the scene—for example, ensuring that different parts of an animal change in a coordinated manner.
2. Decoupled Contrastive Learning (DCE)
Standard contrastive losses (InfoNCE) suffer from "negative-positive coupling" (NPC). When "easy" negatives (like background patches) dominate, the gradient vanishes, preventing the model from learning from more informative samples. DCE removes the positive pair from the denominator of the loss function, ensuring steady gradients even with diverse patch semantics.
3. Hard Negative Mining via Curriculum Learning
The model explicitly seeks out "hard" negatives—patches that are semantically similar to the query but are not the query itself. Because semantic relations are unstable at the start of training, we use a curriculum approach, gradually increasing the "hardness" of negatives as the model matures.
Experimental Results
Our method was evaluated across several diverse benchmarks, consistently outperforming state-of-the-art baselines:
- Single-modal Translation: On the Horse -> Zebra task, we achieved an FID of 34.4, significantly better than CUT (45.5) and NEGCUT (39.6). On Cityscapes, our mean Average Precision (mAP) reached 29.0, compared to CUT's 24.7.
- Multi-modal Translation: On the Seasons and Weather datasets, the method consistently produced lower FID (better quality) and higher LPIPS (better diversity) than StarGANv2.
- GAN Compression: We demonstrated that relational knowledge transfer can help train smaller networks. Our compressed model for Horse -> Zebra achieved a 64.64 FID with only 0.412M parameters, vastly outperforming the baseline's 74.39 FID.
Conclusion
By explicitly modeling and preserving patch-wise semantic relations, our method overcomes the limitations of standard contrastive learning in I2I tasks. The combination of SRC, DCE, and hard negative mining allows for more accurate and structurally consistent translations, proving effective even in challenging multi-modal and model compression scenarios.
Summary updated