ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • StarGAN: Unified Generative Adversarial Networks for Multi-Domain Image-to-Image Translation
    paper 2019. 8. 22. 13:10

    https://arxiv.org/pdf/1711.09020.pdf

    0. Abstract

    지금까지는 두 도메인 사이의 image-to-image translation이 성공적으로 이루어 졌고, 이미지 도메인의 각각의 pair에는 독립적으로 다른 model이 존재해야 했다. 하지만, StarGAN은 하나의 모델로 다양한 도메인 사이의 image-to-image translation이 가능하게 한다. 이러한 StarGAN의 통합된 모델 구조는 하나의 네트워크에서 다른 도메인인 여러개의 데이터 셋이 동시에 학습하겠끔 해준다.

     

    - facial attribute transfer

    - facial expression synthesis task


    1.Introduction

    두 개의 다른 도메인으로부터의 학습 데이터로 부터, StarGAN은 한 도메인의 이미지로부터 다른 도메인의 이미지로 translate한다. 

     

    attribute : 이미지 안에 내제된 의미있는 특징(feature) ex) hair color, gender, age

    attribute valuer : attribute의 특정한 값 ex) hair color(attribute)의 attribute value는 black/brown/blond, gender의 attribute value는 male/female.

    domain : 같은 attribute value를 공유하고 있는 이미지 set. ex) images of women 

     

    이미지의 데이터셋은 많은 labeled attributes와 함께 온다.

    예를 들어, CelebA 데이터 셋은 facial attribute와 관련된 40개의 레이블이 포함되어 있다. 레이블은 hair color, gender, age등과 관련되어 있다. RaFD 데이ㅓ 셋은 facial expression에 대한 8개의 레이블을 포함하고 있다. 레이틀은 happy, angry, sad와 같은 것들이다. 이러한 레이블이 multi-domain image-to-image translation을 가능하게 만든다.

     

    Figure 1. Multi-domain image-to-image translation results on the CelebA dataset via transferring knowledge learned from the RaFD dataset. The first and sixth columns show input images while the remaining columns are images generated by StarGAN. Note that the images are generated by a single generator network, and facial expression labels such as angry, happy, and fearful are from RaFD, not CelebA.

    위의 그림에서 볼 수 있듯이, CelebA 이미지는 네 개의 도메인 중 어느 것으로도 translation할 수 있다.

     

     

    Figure 2. Comparison between cross-domain models and our proposed model, StarGAN. (a) To handle multiple domains, crossdomain models should be built for every pair of image domains. (b) StarGAN is capable of learning mappings among multiple domains using a single generator. The figure represents a star topology connecting multi-domains.

     

    기존의 모델들은 k개의 도메인을 학습하려면, k(k-1)개의 Generator가 필요했다. 이러한 모델은 얼굴 모양과같은 모든 영역의 이미지에서 학습할 수 있는 글로벌한 특징이 있음에도 불구하고 각 Generator는 전체 training data를 완전히 활용할 수 없으며, k중 두 도메인으로부터만 학습이 가능하다. 이러한 점은 generated image의 질을 떨어뜨린다. 또한, 각각의 데이터 셋은 부분적으로 라벨링되어 있기 때문에 다른 데이터 셋으로부터 동시에 도메인을 학습하는 것은 불가능했다.

     

    이러한 문제점을 해결하기 위해 StarGAN은 그림에서와 같이, 여러 도메인에서의 학습 데이터를 취하고, 오직 하나의 generator로 모든 가능한 도메인 사이의 mapping을 학습한다. 

     

    이것은 fixed translation(black-to-blond hair)을 학습하는 대신에, StarGAN의 generator는 인풋으로 두 개의 이미지와 domain information을 받는다. 그리고, 이미지를 corresponding domain으로의 유동적인 변환을 학습한다. domain information을 나타내기 위해 StarGAN은 label을 사용한다. 학습 동안에, target domain label을 무작위로(randomly) 만들어 내고, 모델이 유동적으로 input image를 target domain으로 변환하게 하였다. 이렇게 함으로써, 우리는 domain label을 조정할 수 있고, 이미지를 원하는 도메인으로 변환할 수 있다. (test phase)

     

    StarGAN은 또한 mask vector를 domain label에 추가함으로써 다른 데이터 셋의 도메인 사이에서 학습할 수 있게 하였다. 제안된 방법은 모델이 unknown label은 무시하고, 특정 데이터 셋에서 제공된 레이블에만 집중할 수 있게 하였다. 이러한 방법으로 우리의 모델은 RaFD로부터 학스ㅂ한 특징을 사용하여 CelebA이미지의 facial expression을 학습할 수 있게 되었다. 


    2. Star Generative Adversarial Networks

    2.1 Multi-Domain Image-to-Image Translation

     

    Figure 3. Overview of StarGAN, consisting of two modules, a discriminator D and a generator G. (a) D learns to distinguish between real and fake images and classify the real images to its corresponding domain. (b) G takes in as input both the image and target domain label and generates an fake image. The target domain label is spatially replicated and concatenated with the input image. (c) G tries to reconstruct the original image from the fake image given the original domain label. (d) G tries to generate images indistinguishable from real images and classifiable as target domain by D.

    G는 input image x이 target domain label c를 가진 변환을 하여 output image y를 만들어 내도록 학습한다: G(x,c)->y

    D는 multiple domain을 control하는 하나의 discriminator이다. 즉, 우리의 discriminator는 source와 domain 두 개에 대한 probability distribution을 만들어 낸다. : D: x->{Dsrc(x), Dcls(x)}

     

    Adversarial Loss

    합성된(generated) 이미지를 real image로부터 구분이 안되게 하기 위해 이 loss를 사용한다. 

    Dsrc는 discriminator가 이미지를 진짜인지 가짜인지 판별하는 것에 대한 것이다. generator G는 이 목적 함수를 minimize시키려고 할 것이며, discriminator D는 이것을 maximize시키려고 할 것 이다. 

     

    Domain Classification Loss

    G(x,c)->y : 이러한 변환을 할 때, target domain c로 올바르게 분류(classification)할 수 있어야 한다. 이러한 조건을 충족시키기 위해서, Discriminator의 top에 auxiliary classifier을 추가하였고, 이것은 D와 G 둘다를 최적화하는 데 사용되었다. 

     

    즉, 목적 함수를 두개의 term으로 분류 하였다. 

    1) D를 최적화하는데 사용한 real image의 domain classification loss

    2) G를 최적화하는데 사용한 fake image의 domain classification loss

     

    이 목적함수를 최소화하기 위해, D는 real image x를 그에 대앙하는 original domain c'로 분류하겠금 학습한다. 

     

    G는 이 목적함수를 최소화하기위해 합성된 이미지가 그에 대응 하는 target domain c로 분류하겠금 학습한다. 

     

    Reconstruction Loss

    adversarial loss와 domain classification loss를 최소화함으로써 G는 합성된 이미지를 realistic하게 학습할 수 있고, 합성된 이미지가 target domain을 만들어 내도록(즉, target domain이 male이면 합성된 이미지는 남성 이미지인데 realistic한 이미지를 만들어 낼 수 있게) 학습된다. 하지만, 이러한 loss들만으로는 입력의 도메인 부분만 변환하면서, 변환된 이미지가 입력 이미지의 내용을 보존하는 것은 보장되지 않는다. 우리는 이러한 문제점을 해결하기 위해, cycle consistency loss를 generator에 적용하였다. 

     

    G는 변환된 이미지 G(x,c)와 original domain label c'를 인풋으로 받고, original image x를 만들어 내도록 노력한다. StarGAN에서는 reconstruction loss를 위해 L1 norm을 적용하였다. StarGAN은 이것을 위해 single generator를 두 번 사용하였다. 처음에는 original image를 target domain을 가진 이미지로 변환하였고, 그 다음에 변환된 이미지를 original image로 재구성하였다. 

    Full Objective

     

    λcls 와 λrec는 hyper-parameter이다. 이것은 adversarial loss와 비교하여 domain classification과 reconstruction loss의 상대적인 중요도이다. StarGAN에서는 λcls =1, λrec=10을 사용하였다.

     

    2.2 Training with Multiple Datasets

    StarGAN에서는 다른 종류의 레이블을 가진 여러 데이터 셋들을 동시에 학습시키기 위해 Mask Vector를 소개하고 있다.

    이것은 내가 하고 있는 과제에는 필요하지 않기 때문에 설명을 적지 않으나, 논문을 읽어보기를 권유한다.

     

     

Designed by Tistory.