평범한 필기장

[평범한 학부생이 하는 논문 리뷰] Flowing from Words to Pixels:A Noise-Free Framework for Cross-Modality Evolution (CVPR 2025 Highlight) 본문

AI/Generative Models

[평범한 학부생이 하는 논문 리뷰] Flowing from Words to Pixels:A Noise-Free Framework for Cross-Modality Evolution (CVPR 2025 Highlight)

junseok-rh 2025. 6. 20. 00:46

Paper : https://arxiv.org/abs/2412.15213

 

Flowing from Words to Pixels: A Noise-Free Framework for Cross-Modality Evolution

Diffusion models, and their generalization, flow matching, have had a remarkable impact on the field of media generation. Here, the conventional approach is to learn the complex mapping from a simple source distribution of Gaussian noise to the target medi

arxiv.org

Abstract

 기존 FlowMatching은 source distribution을 Gaussian으로 뒀다. 본 논문에서는 두 modality에 대한 분포를 통해서 flow matching을 학습시키는 CrossFlow를 제안한다. 이를 통해 noise distribution과 conditioning mechanism에 대한 필요를 없앤다.

1. CrossFlow

1.1 Variational Encoder for Encoding Inputs

 Flow matching model은 target distribution $p_1$과 동일한 shape을 가지는 source distribution $p_0$를 필요로 한다. Input $x$가 주어지면, 이를 target latent $z_1$과 동일한 형태인 $z_0$으로 변환한다. 단순하게 $\mathcal{E}(x) = z_0$를 사용하는 것은 문제가 있다. 본 논문에서는 flow matching이 잘 작동하기 위해서는 $z_0$를 source를 위해 regularized distribution으로 변환하는 것이 필요하다는 것을 발견했다. 이를 해결하기 위해서는 본 논문은 직접 $z_0$를 예측하는 대신, variational encoder (VE)를 이용해서 평균 $\bar{\mu}_{z_0}$와 표준편차 $\bar{\sigma}_{z_0}$를 예측하고 $z_0 \sim \mathcal{N}(\bar{\mu}_{z_0}, \bar{\sigma}_{z_0})$에서 샘플링한다. 이를 통해 주어진 input $x$에서 regularized distribution에서 latent $z_0$로 변환할 수 있게 한다. VE는 standard VAE로 학습될 수 있다.

1.2 Training CrossFlow

 본 논문은 VE와 flow matching model을 joint하게 학습시킨다.

$L_{Enc}$는 task에 따라 다르가.

1.3 Classifier-Free Guidance with an Indicator

 기존의 CFG는 condition과 uncondition을 통해 계산하는데, CrossFlow는 condition을 따로 받지 않기 때문에 기존 CFG를 그대로 사용할 수 없다. 또한, Autoguidance(AG)는 'bad model'을 이용한 대체 방법론이 있지만, 이는 'bad model'을 따로 학습해야 한다는 점에서 비효율적이고 성능 또한 CFG에 비해 떨어진다고 한다.

 본 논문은 conditioning input 없이 CFG를 가능하게 하기 위해서, CFG with indicator를 제안한다. 구체적으로, 본 논문은 $v_\theta(z_t, 1_c)$ 형태를 띈다. 여기서 $1_c \in \{ 0,1 \}$는 conditional인지 unconditional을 나타내는 indicator이다. $1_c = 1$인 경우에는 model은 $z_0$에서 $z_1$로 나아간다. $1_c = 0$인 경우에는 model은 $z_0$에서 $z_1^{uc}$로 나아가는데, 여기서 $z_1^{uc}$은 target 분포에서 $z_1$을 제외한 샘플을 나타낸다. 학습 동안, 본 논문은 $g^c, g^{uc}$라는 learnable 파라미터를 사용한다. $1_c$에 따라, 적절한 learnable parameter가 sequence dimension에 따라 transformer input tokens에 concat된다.

1.4 Flowing from Text to Image

 Input text embedding $x \in \mathbb{R}^{n \times d}$가 주어지면, Text VE를 통해 text latent $z_0 \sim \mathcal{N}(\bar{\mu}_{z_0}, \bar{\sigma}_{z_0})$를 뽑는다. Pre-trained VAE를 통해 input 이미지로 $z_1$를 얻고, $z_0, z_1$를 가지고 flow matching model을 통해 $v(z_t,t)$를 예측한다.

1.4.1 Text Variational Encoder

 Text embedding을 작은 latent space로 압축하는 것을 포함하기 때문에, Text VE를 학습시키는 것은 어렵다. 간단한 방법으로는 MSE reconstruction loss를 통해 VAE를 학습시키는 것이다. 이 방식은 작은 reconstruction error를 달성하지만, semantic concepts를 capture하지 못하고 이는 sub-optimal image generation을 야기한다.

Contrastive loss

 Target이 주어졌을 때, 본 논문은 simple encoder를 통해 이를 $z_0$와 동일한 shape으로 feature space로 projection시켜 $\hat{z}$를 얻는다. 배치의 모든 페어의 $z_0, \hat{z}$에 대해서 cosine similarity를 계산해 similarity matrix $S$를 얻는다. $\text{logit}s_{ij} = s_{ij}/\tau$이고, $\tau$는 temperature parameter인 learnable parameter이다. $s_{ij}$는 $S$의 각 원소이고 이는 $i^{th}z_0$와 $j^{th}\hat{z}$사이의 cosine similarity를 나타낸다.

2. Experiments

2.1 Text-to-Image Generation

Architecture

 본 논문은 DiMR을 backbone으로 사용했고, Text VE에 대해서는 stacked Transformer blocks를 사용했다.

2.1.1 CrossFlow vs. Standard Flow Matching

2.1.2 State-of-the-art Comparison

2.1.3 Arithmetic Operations in Latent Space

 

2.2 Ablation Study

2.3 CrossFlow for Various Tasks