쏴아리의 딥러닝 스터디

Unpaired Image-To-Image Translation Using Cycle-Consistent Adversarial Networks(2017) 본문

Image Generation

Unpaired Image-To-Image Translation Using Cycle-Consistent Adversarial Networks(2017)

말해보시개 2021. 5. 8. 17:56

Unpaired Image-To-Image Translation Using Cycle-Consistent Adversarial Networks(2017)

 

 

 Abstract

▷ Paired Image-to-image translation 훈련 데이터 획득의 어려움  

  • Image-to-image translation은 input-target 이미지 pairs를 활용하여, 입력 이미지를 출력 이미지로 맵핑하는 함수를 학습하는 것이 목적입니다.
  • 하지만 paired training data를 얻는 활동이 불가능할 수 있습니다.

 

▷ Paired Input-target 이미지가 없어도 학습 가능한 "Unpaired Image to image tranlslation" 학습방법 제안

  • 본 연구에서는 paired examples가 없어도 sourece domain X에서 target domain Y로 이미지를 translate하기 위한 학습방법을 제안합니다. 

 

▷ CycleGAN 

  • mapping $ G: X\rightarrow Y $를 학습하는것이 목적입니다.
    • $ G(X)$로 부터 생성된 Fake 이미지와 Real Y이미지는 구별이 불가능해야 합니다.
  • $G$를 학습하는 내용이 under-constrained 상황이기 때문에, Inverse mapping $F: Y \rightarrow X $를 학습합니다.
    • cycle consistency loss와 관련됩니다.($F(G(X))\approx X $ (and vice versa))

 

 

 

 Introduction

Unpaired Image-to-image translation 훈련데이터 획득의 어려움

  • Figure 1의 왼쪽 상단에 있는 것과 같이,  Monet의 그림을 Photo로 변경하기 위한 Paired Images(Input-Target) 훈련데이터를 획득하는 것이 가능한가요?
  • Figure 1의 왼쪽 하단과 같이, photo를 Monet, Van Gogh, Cezanne, Ukio-e의 그림으로 변경하기 위한 Paired Images 훈련데이터 획득이 가능할까요? 
  • 위와 같은 Paired 훈련데이터는 현실에  존재하지 않기 때문에, Paired Image to image translation 알고리즘 기반 방법(Figure 2의 좌측 그림)으로는 훈련데이터 획득이 쉽지 않아 Figure 1의 결과를 얻기 어려울 것입니다.

 

▷ Unpaired Image-to-image Translation Algorithm Motivation 

  • 본 연구에서는 Figure 1의 결과를 얻기 위한 Unpaired Image-to-image translation 접근 방법을 제시합니다.
  • Paired training examples 없이 하나의 image collection으로 부터 다른 image collection으로 translate하기 위한 특징들을 capture 합니다. 

 

▷ Figure 2: Paired & Unpaired trainiang data 

  • Paired training data(Figure 2 left)
    • training example 내 각 $y_i $데이터는 $x_i $와 대응됩니다.
  • Unpaited training data(Figure 2 right)
    • source set$X $과 target set $Y $이 존재하고, 각 $x_i $ 데이터와 $y_i $데이터의 대응 정보가 없습니다. 

 

 

 

 

 Formulation

▷ CycleGAN의 목적은 2개의 도메인 $X $, $Y $간의 mapping function 을 학습하는 것입니다. 

  • $\left \{ x_i \right \}^{_{i=1}^{N}} \in X $ and $\left \{ y_j \right \}^{_{j=1}^{M}} \in Y $
  • Figure 3 (a)에서와 같이 CycleGAN에는 2개의 Mapping이 존재합니다.
    • $ G : X \rightarrow Y $
    • $ F : Y \rightarrow X $
  • adversarial discriminators $D_X $와 $D_Y $가 존재합니다. 
    • $D_X $:  $\left \{ x \right \} $ 이미지와 translated images $\left \{ F(y) \right \} $를 구별하는 역할을 합니다.
    • $D_Y $:  $\left \{ y \right \} $ 이미지와 translated images $\left \{ G(x) \right \} $를 구별하는 역할을 합니다. 
  • CycleGAN의 목적함수에는 Adversarial loss와 Cycle consistency loss 2가지가 존재합니다
    • adversarial loss: gererated images를 target domain의 data distribution으로 matching
    • cycle consistency loss: learned mappings $G $와 $F $가 contradicting each other되는 현상을 방지 합니다.

 

Adversarial Loss

▷ 2개 mapping function에 Adversarial Loss를 적용. 

  • $ G : X \rightarrow Y $와 그에 대한 Discriminator $ D_Y$에 대해서, 다음과 같이 목적함수가 표현됩니다. 
    • $G $는 gererated images $ G(x)$를 domain $Y $와 유사하도록 try합니다. 
    • $D_Y는 translated samples $G(x)$와 reql samples $y$를 구별하는것이 목적입니다.
    • $ F : Y \rightarrow X $와 discriminator $D_X $에 대한 adversatial loss는 유사하게 $L_GAN(F,D_X,Y,X)$로 표현됩니다.

 

Cycle Consistency Loss

▷ Adversarial Loss의 한계점 

  • Adversarial training은 이론적으로 mapping $G$와 $F$가 각각 target domain $y$ $X$의 분포를 생성할 수 있습니다.
  • 하지만 뉴럴 네트워크는 같은 input images를 활용하여 다양한 target domain의 random permutation images로 연결하기 때문에, 가능한 mapping function들의 경우의 수를 줄여줄 필요가 있습니다. 

▷ Cycle-consistent 

  • 본 연구에서는 이와 같이 가능한 mapping function들의 space를 한정하기 위하여 learned mapping functions은 cycle-consistent해야 한다고 주장합니다.
  • Figure 3의 (b)에서와 같이, domain $X$로 부터 각 $x$ image들은 image tranaslation cycle을 통해 다시  original $x$이미지로 되돌아와야 합니다.
    • $ x  \rightarrow G(x) \rightarrow F(G(x)) \approx x $
    • 이를 forward cycle consistency라고 부릅니다.
  • 유사하게 Figure 3(c)에 묘사된것 처럼, domain $Y$로부터의 각 $y$ image들에 대하여 $G$와 $F$는 또한 backward cycle consistency를 만족시켜야 합니다. 
    • $ y \rightarrow F(y) \rightarrow G(F(y)) \approx y $
  • cycle consistency를 만족시키기 위하여, 다음과 같이 cycle consistence loss를 설계하였습니다.

 

Full Objective

▷ Full objective function

  • CycleGAN의 full objective는 다음과 같습니다.
  • \lambda\는 adversarial loss와 cycle conistency loss의 상대적인 중요도를 control합비다.

 

 

 Implementation

Network Architecture

▷ Generative networks

  • two strided-2 convolutions, several residual blocks, two 1/2-strided convolutions
  • instance normalization을 사용하였습니다. 

▷ Discriminator Networks

  • 70*70 Patch-GANs를 사용하였습니다.

 

Training details

▷ $L_GAN$

  • $L_GAN$(Equation1)에서, negative log likelihood objective를 least square loss로 변경하였습니다. 
  • training 동안 더 안정적이고 higher quality results를 생성하기 때문입니다. 
  • 변경된 Equation 1은 다음과 같습니다.  

▷ Image Buffer

  • model oscillation을 줄이기 위하여 Discriminator $D_X$, $$D_Y$update를 할 때, latest generative networks로 부터 생성된 결과를 사용하지 않고 history of generated imafes를 사용하였습니다.
  • 즉, 50개의 previsoud generated images를 저장하는 image buffer를 사용하였습니다. 

 

 

 

 Results

  ▷ Paired dataset performance

  • Ground Truth input-ourput pair가 존재하는 Paired dataset에 Cycle GAN(unpaired image-to-image translation)을 적용하여, 최근의 연구들와 성능을 비교하였습니다.
  • adversarial loss와 cycle consistency loss의 중요성을 연구하기 위하여 several variants에 적용하고 비교하였습니다.

▷ Unpaired dataset performance

  • CycleGAN의 generality를 입증하기 위하여 paired data가 존재하지 않는 광범위한 application에 적용하였습니다.

 

Evaluation

▷ pix2pix에서와 동일한 evalution datasets와 metric을 활용하였습니다 .

 

 

 

 

Applications

 

 

 

 

 

 

 Limitations and Discussion

▷ Failure Case

CycleGAN이 다양한 케이스에서 compelling한 results를 보여주었으나, Figure 12와 같이 여러가지 실패 케이스 들도 있습니다.

 

 

 

같이 보시면 좋아요.

 

포스팅 내용이 도움이 되었나요? 공감과 댓글은 큰 힘이 됩니다!

 

Comments