ABOUT ME

notou10@yonsei.ac.kr

Today
Yesterday
Total
  • GANSpace: Discovering Interpretable GAN Controls 리뷰
    논문리뷰 2021. 11. 18. 16:15

    GANSpace: Discovering Interpretable GAN Controls (Dec 2020, NeurIPS)



    1. Intro


    본 논문은 Latent direction을 supervised learning 방식으로 찾는 방식이 아닌, latent space 상에서 PCA를 통해 attribute를 향한 direction을 찾는 방법을 제안했다.

    또한 BigGAN StyleGAN처럼 layerwise한 input을 통해 style mixing을 비롯한 control이 가능토록 별도의 training 없이modify하는 아이디어를 제안한다.

    본 논문은 별도의 학습을 필요로 하지 않고, 기존 학습된 GAN의 내용물을 PCA를 통해 direction을 찾는다.

    2. Discovering GAN Controls


    2.1 Background

    StyleGAN의 장점인 layer별로 다른 w가 들어가는 것을 style mixing이라고 함.

    2.1 Principal Components and Principal Feature Directions

    StyleGAN
    (주축을 구하는 방법은 추후 서술)
    저자들은, GAN의 early layer의 feature tensor들의 principal component(주축)은, 이미지 variation에 있어 중요한 factor임을 관찰했다고 한다.

    주축은 데이터를 저차원으로 투영시켰을 때 투영되어진 데이터의 분포(데이터간의 거리)가 가장 큰 축이다.

    주축


    이는 PCA를 통해 얻을수 있고 StyleGAN의 경우 w 공간상에서 PCA를 진행한다.

    Isotripic한 공간, 즉 [-1~1]사이에서 random sampling하는 z 상에서 PCA를 진행해봐야 의미 있는 주축의 방향을 찾을수 없으므로, z가 mapping network를 거친 512차원 w상에서 PCA를 진행한다.


    N = 10^6개의 sample을 통해 W의 주축들을 나타내는 matrix V를 구한다.

    그리고 주축별로 control 할 수 있는 parameter x를 통해 w'를 조절한다.

    Stylegan의 경우 isotropic한 공간상 z를 non isotropic한 공간 w로 매핑한다.

    그 non isotropic한 공간에서 pca를 수행하여 주축을 찾는다.

    하지만 biggan의 경우 non isotropic 공간인 layer에서 pca를 하여 pca coordinate를 구한 후 이를 z로 transfer시켜 z의 주축을 구한다.


    색깔은 pca coordinate를 나타낸다.

    즉 linear layer를 거쳤을때 activation 값? 수치?를 나타낸다.

    Stylegan이든 bigGAN이든 Z는 100개의 변수가 평균 0, 분산 1인 isotropic 공간일 것이다.

    StyleGAN의 경우 mapping network를 거쳐 non isotropic공간으로 매핑된 후 PCA를 진행하면 되는데, bigGAN은 mapping network랄게 없다.

    따라서 첫번째 activation layer에서 pca coordinate를 구하고, 첫번째 activation layer의 principal component matrix V와 coressponding하는 Z의 principle component matrix U를 구한다.(by linear regression)



    각 V에 해당하는 U를 linear regression을 통해 coressponding 시켜주면, 한 U 의 조정만으로도 한 attribute 수정이 가능할 것이다.

    z + 1*u1로 z를 변형시킨건, y+1*v1을 한 것과 동일한 효과를 낼 것이다.

    임의의 한 점 z에 대해 Z의 주성분 z’ =1*u1만큼 빼주었다고 하면 z’의 pca coordinate는 z의 pca coordinate -1*u1이 되었을 것이다.(0.3 분홍색)

    즉 Y공간에서도 0.3분홍색의 pca coordinate를 나타낼 것이고 이는 non isotropic 공간상에서 주축 1만큼 뺀 것과 같은 의미다.

    z위 각 좌표를 해당하는 y의 pca coordinate로 표현하면 z의 (y의 principal component V에 대응하는)pirincipal component를 구할 수 있고 z의 principal component를 따라 z를 조작하면 y 의 principal component를 따라 y를 조작하는 것과 같은 역할을 할 것이다

    BigGAN
    BigGAN은 styleGAN과 달리 w로 가는 매핑네트워크가 없으므로, 조금 더 복잡하다.

    BigGAN에서는, intermediate layer i (이해를 위해 입력값이 가장 처음 들어가는 layer라고 하겠음)에서 PCA를 수행한다.

    STEP에 따른 설명

    Step 1) Insert N samples of z and get N samples of output y.

    Step 2) Compute V which is matrix with principal components of y.

    step 3) Get PCA coordinate x which indicates how similar y is to each principal axis.

    step 4) Find u(z’s principal component matrix) using x.

    V = 10개의 주축으로 표현된 (1024, 10) matrix

     

    x의 (1, 1)성분은 y1이 주축 v1에 projected 되었을때의 수치를 나타냄
    x, V를 아는 상태에서 y를 아는 것은 쉽다. 근데 x, z를 아는데 u를 구하려면 어떡함? 주축 u1, u2.. 를 optimize하는 문제를 풀면 된다.  eg) x1을 아는 상태에서, z와 최대한 가까워 지도록 하는 u1이 존재할것이고 이를 u 10개까지 확장해서 least square 방법으로 풀면 된다.

    2.3 Layerwise edit

    StyleGAN

    빨간 박스는 오리지날 이미지가 각 주축에서 어떤 위치에 있는지를 알려준다.
    기존 이미지 w = -1.33σ * v0 + 0σ * v1 + -1.33σ * v2 + .... + manipulate

    4, 5행 : 특정 layer를 fix했더니(0~2 layer만 조작), pure하게 rotation만 변형되는 걸 볼수있다. (fix 안하면 gender도 entangled하게 변형됨)

    Layer fix시키는 방법은 기재 안한걸로 보아, empirical 하게 찾은걸로 사료됨

    BigGAN

    BigGAN의 skip -z connection에서 각 block별로 다른 z를 줬더니 다른 output이 나왔다.

    StyleGAN과 비슷하게 layerwise edit이 가능함을 볼 수 있었다.

    PCA 내용은 없음..

     

    3. Finding and Results


    3.1 GAN and PCA properity

    Large-scale changes to geometric configuration and viewpoint are limited to the first 20 principal components (v0-v20)

    1. Successive components leave layout unchanged, and instead control object details
    2. No ranslations are discovered -> due to carefully aligned dataset (undesirable biases)

    StyleGANv2’s latent distribution p(w) has a relatively simple structure

    Disallowed combination

      1. Wrinkle component : has no effect in child’s face.

    supervise 방식과 비교



    Without supervision, obtained comparable results.

    아쉬웠던 점

    1. 어떤 layer를 fix 시켜야 pure한 attribute 조절이 되는지 설명 x
    2. 몇 번째 component가 어떤 attribute 조절인지는 직접 찾아야 함

     

Designed by Tistory.