Skip to main content
QUICK REVIEW

[Paper Review] CCPL: Contrastive Coherence Preserving Loss for Versatile Style Transfer

Zijie Wu, Zhu Zhen|arXiv (Cornell University)|Jul 11, 2022
Image Enhancement TechniquesComputer Science11 citations
TL;DR

This paper proposes Contrastive Coherence Preserving Loss (CCPL), a novel contrastive learning-based loss that enhances temporal consistency in video style transfer by preserving local patch-level feature differences across frames, without requiring video training data. CCPL improves visual quality and coherence in artistic, photo-realistic, and video style transfer while being compatible with existing networks and applicable to image-to-image translation.

ABSTRACT

In this paper, we aim to devise a universally versatile style transfer method capable of performing artistic, photo-realistic, and video style transfer jointly, without seeing videos during training. Previous single-frame methods assume a strong constraint on the whole image to maintain temporal consistency, which could be violated in many cases. Instead, we make a mild and reasonable assumption that global inconsistency is dominated by local inconsistencies and devise a generic Contrastive Coherence Preserving Loss (CCPL) applied to local patches. CCPL can preserve the coherence of the content source during style transfer without degrading stylization. Moreover, it owns a neighbor-regulating mechanism, resulting in a vast reduction of local distortions and considerable visual quality improvement. Aside from its superior performance on versatile style transfer, it can be easily extended to other tasks, such as image-to-image translation. Besides, to better fuse content and style features, we propose Simple Covariance Transformation (SCT) to effectively align second-order statistics of the content feature with the style feature. Experiments demonstrate the effectiveness of the resulting model for versatile style transfer, when armed with CCPL.

Motivation & Objective

  • Address the challenge of temporal inconsistency in video style transfer when training only on single-frame images.
  • Reduce flicker and local distortions in stylized video outputs without relying on optical flow or explicit video supervision.
  • Develop a lightweight, architecture-agnostic loss that improves both visual quality and temporal coherence in diverse style transfer tasks.
  • Enable effective application of the loss to existing image-to-image translation and style transfer models with minimal modification.
  • Balance stylization quality and temporal consistency through a learnable loss weighting mechanism.

Proposed method

  • Define local patch differences between content and stylized images as feature-level representations to capture local motion consistency.
  • Apply contrastive learning using InfoNCE loss to maximize mutual information between positive pairs (same spatial location across frames) and minimize it for negative pairs.
  • Introduce a neighbor-regulating mechanism that constrains each patch based on its spatial neighbors, reducing local distortions.
  • Sample multiple negative patch differences per layer to stabilize contrastive learning and improve generalization.
  • Integrate CCPL as a plug-in loss with existing style transfer networks, enabling training on single images while generalizing to video.
  • Propose Simple Covariance Transformation (SCT) to align second-order statistics of content and style features for better feature fusion.

Experimental results

Research questions

  • RQ1Can a contrastive loss on local patch differences effectively preserve temporal coherence in video style transfer without video data during training?
  • RQ2How does the neighbor-regulating mechanism in CCPL reduce local distortions and improve visual quality?
  • RQ3What is the optimal configuration of CCPL in terms of number of layers, sampled vectors, and loss weighting for balancing consistency and stylization?
  • RQ4Can CCPL be effectively transferred to other image-to-image translation and style transfer models beyond the base architecture?
  • RQ5Does CCPL improve performance on diverse style transfer tasks, including artistic, photo-realistic, and video style transfer, without compromising stylization quality?

Key findings

  • CCPL significantly improves temporal consistency in video style transfer, reducing flicker and incoherence even when trained only on single images.
  • The method achieves a 77.0 FPS inference speed at 256×256 resolution on a single 12GB Titan XP GPU, outperforming prior methods in speed and quality.
  • Ablation studies show that applying CCPL to 3 layers with 64 sampled vectors per layer and a loss weight ratio of 0.5 yields the best trade-off between consistency and stylization.
  • When applied to AdaIN, SANet, and Linear networks, CCPL improves temporal consistency with only a minor drop in SIFID score, demonstrating its generalization capability.
  • CCPL enhances image-to-image translation performance on CUT, improving both visual quality and consistency, confirming its broad applicability.
  • The neighbor-regulating mechanism of CCPL reduces local distortions, leading to sharper and more coherent outputs compared to baseline methods.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.