Progressive Growing of GANs for Improved Quality, Stability, And Variation - Deepest-Project/Greedy-Survey GitHub Wiki

Resources

Abstract

  • GAN 모델을 학습하는 새로운 방법론을 제시하였다.

    • Generator와 Discriminator를 점진적으로 성장시키는 것이다:
      low resolution으로 시작하여서, 새로운 레이어를 더하는데 이 레이어는 학습이 진행됨에 따라서 매우 세세한 부분까지 모델한다.
  • 이 방법은 학습 속도를 높이고 그것을 엄청하나게 안정화하였다. 그러면서도 전례없는 quality의 이미지를 생성해냈다.

  • 생성된 이미지의 variation을 높이는 간단한 방법을 제안하였고, unsupervised CIFAR 10에서 8.80의 inception score를 달성하였다.

  • 불건전한 generator와 discriminator 간의 경쟁을 막기 위한 몇가지의 implementation details을 describe했다.

  • GAN results를 quality와 variation 측면에서 evaluating 하기 위한 새로운 metric을 제안하였다.

1. Introduction

  • 최근 high-dimensional data distributions에서 novel samples을 생성하는 접근법에는 Variational autoencoders(VAE)와 Generative adversarial networks(GAN)이 두드러진다.

strengths and weeknesses

  • Autoregressive models:

    • S: sharp images
    • W: slow to evaluate and do not have latent representations.
  • VAEs:

    • S: easy to train
    • W: blurry
  • VAEs:

    • S: sharp images
    • W: only in fairly small resolutions, somewhat limited variation and unstable training.
  • training distribution과 generated distribution의 거리를 측정하면, 상당한 겹침이 있지 않는 이상 random한 방향으로 gradients가 향할 것이다.

distance metric에 대한 discussion이 상당하다.

  • Jensen-Shannon divergence, least squares, absolute deviation with margin, Wasserstein distance.
  • 우리의 contributions은 이런 discussion에 대체로 일치한다. 주로 개선된 Wasserstein loss를 사용하지만 least-squares loss도로 실험한다.

고해상도 이미지 생성의 어려움

  • Discriminator가 판별하기 쉽다.
  • memory 문제 때문에 smaller minibatches를 사용할 수밖에 없다.(training stability를 compromise한다.)
    • 우리의 핵심 insight는 저해상도 이미지부터 시작해서 고해상도의 디테일을 만들어내는 새로운 레이어를 추가하는 것이다.
    • 이는 training 속도를 높이고, 고해상도에서 stability를 증가시킨다.

Quality? Variation?

  • 통념은 Quality와 Variation은 tradeoff 관계에 있다는 것이다. 하지만 이는 도전 받고 있다.
  • 우리는 Variation을 높이기 위한 방법을 뒤에서 설명할 것이다.
  • 그리고 quality와 variation을 평가하기 위한 metric을 제안할 것이다.

initialization

  • 네트워크 initialization에서의 미묘한 수정에 대해서 논할 것이다.
  • mode collapses가 매우 빨리 나타나는 것을 관찰했다. 이는 Discriminator가 overshoots 하여서 gradients가 exaggerate될 때 일어난다. 그리고 이는 양 네트워크에서 signal magnitudes가 상승된 곳에서 unhealthy competition을 일으킨다.
  • 우리는 그래서 이를 막기 위한 mechanism을 제안한다.

2. Progressive Growing of GANs

  • 우리의 주요 공현은 저해상도 이미지부터 점진적으로 학습을 한다는 것이다.
  • 이는 처음에 이미지의 large-scale structure를 찾고 increasingly finer scale detail로 attention을 옮긴다는 것이다. (동시에 배우는 것 대신에)
  • 우리는 서로의 미러 이미지이고 동시에 성장하는 Generator와 Discriminator networks를 사용한다.
  • 모든 레이어는 trainable하다.
  • 새로운 layers가 추가되면 우리는 그것이 smoothly fade in 되도록 한다.
    • 이미 잘 훈련된 저해상도 layers에 갑작스러운 충격을 주지 않도록 하기 위함이다.

Progressive training의 이점

  • 안정적이다. (적은 class information과 modes가 있기 때문이다)

  • latent vectors에서 1024 x 1024로 가는 것보다 훨씬 간단한 질문을 계속 하는 것이다.

    • Chen & Koltun (2017)
  • 실제로 이것은 training을 우리가 WGAN-GP loss와 심지어 LSGAN loss를 이용해서 믿음직한 megapixel-scale 이미지를 합성할 수 있을 정도로 충분히 안정화시켰다.

  • 훈련 시간이 줄어들었다.

    • 대부분의 iterations이 저해상도에서 이루어지기 때문에 같은 quality가 2-6배 정도 빠르게 얻어졌다.
  • 연관된 연구들에 대한 것은 논문으로 대체하겠습니다. 읽어보실 분은 읽어보세요.

    The idea of growing GANs progressively is related to the work of Wang et al. (2017), who use multiple discriminators that operate on different spatial resolutions. That work in turn is motivated by Durugkar et al. (2016) who use one generator and multiple discriminators concurrently, and Ghosh et al. (2017) who do the opposite with multiple generators and one discriminator. Hierarchical GANs (Denton et al., 2015; Huang et al., 2016; Zhang et al., 2017) define a generator and discriminator for each level of an image pyramid. These methods build on the same observation as our work – that the complex mapping from latents to high-resolution images is easier to learn in steps – but the crucial difference is that we have only a single GAN instead of a hierarchy of them. In contrast to early work on adaptively growing networks, e.g., growing neural gas (Fritzke, 1995) and neuro evolution of augmenting topologies (Stanley & Miikkulainen, 2002) that grow networks greedily, we simply defer the introduction of pre-configured layers. In that sense our approach resembles layer-wise training of autoencoders (Bengio et al., 2007).

3. Increasing variation using minibatch standard deviation

  • GAN들은 트레이닝 데이터에서 발견되는 variation of subset 만을 포착하는 경향을 가지고 있다.

    • 이에 대한 해결책으로 "minibatch discrimination"이 제안되었다.
    • 그들은 feature의 statistics를 계산하는데 individual images들뿐만 아니라 minibatch들로부터도 계산을 한다.
    • 이는 생성된 이미지들와 훈련 이미지들의 미니배치들이 비슷한 statistics를 따르게 한다.
    • 이것은 minibatch layer를 Discriminator의 끝부분에 추가함으로써 구현된다. minibatch layer는 input activationd을 array of statistics로 투사하는 large tensor를 배운다.
    • 각각의 미니배치 속의 example들을 위한 a separate set of statistics는 생성되고 이것은 layer의 output에 concatenate 된다. 그럼으로써 Discriminator는 statistics를 내부적으로 사용할 수 있게 된다.
  • 우리는 이 과정을 variation을 높이면서도 엄청나게 단순화시켰다.

  • neither learnable params nor new hyperparams.

  1. minibatch에서 각 spatial location 안의 각 features의 standard deviation을 계산했다.
  2. 모든 features와 spatial locations에서의 estimates들을 average해서 single value로 만들었다.
  3. 이 값을 복제하여서 모든 spatial locations와 minibatch에 concatenate한다. 하나의 (constant) feature map을 만들어내는 것이다.
  4. 이 layer는 discriminator의 어느 곳이든 삽입될 수 있지만 끝 쪽에 넣는 것이 최선이라는 것을 발견했다.
  • 아래와 같은 방법들이 또 있는데 우리보다 더 variation을 높일 수도 있다는 것을 인정한다. 뒤에서 다루겠다.

Alternative solutions to the variation problem include unrolling the discriminator (Metz et al., 2016) to regularize its updates, and a “repelling regularizer” (Zhao et al., 2017) that adds a new loss term to the generator, trying to encourage it to orthogonalize the feature vectors in a minibatch. The multiple generators of Ghosh et al. (2017) also serve a similar goal. We acknowledge that these solutions may increase the variation even more than our solution – or possibly be orthogonal to it – but leave a detailed comparison to a later time.

4. Normalization in Generator and Discriminator

  • GAN들은 unhealthy competition으로 인한 escalation of signal magnitudes 하기 쉽다.
  • 이때까지는 다 Batch normalization을 사용해왔다.
  • BN은 covariate shift를 제거하기 위한 것이다.
  • 그러나 우리는 그것이 GANs에서 issue가 된다는 것을 관찰하지 못했다.
  • 우리는 GANs에서 필요한 것은 signal magnitudes and competition을 제한하는 것이라고 믿는다.
  • 우리는 그 무엇도 learnable parameters가 아닌 두 가지 재료로 이루어진 다른 방법을 사용한다.

4.1 Equalized Learning Rate

  • 우리는 weight initialization을 조심스럽게 하는 최근의 경향에서 일탈했다.

  • '시시한' N(0, 1) initialization을 하였고 명시적으로 runtime에서 weights를 scale하였다.

  • - Wi: weights - c: per-layer normalization constant from He's initialize(He al., 2015).
    • 동적으로 이것을 하는 것의 이점은 다소 미묘하지만 RMSProp이나 Adam에서 주로 쓰이는 scale-invariance 와 관련이 있다.
      • update를 parameter의 scale에 독립적으로 만든다.
      • 어떤 parameters가 다른 것들에 비해 larger dynamic range를 가지고 있다면 조정하는데 더 많은 시간이 걸릴 것이다.
      • 이것은 현대의 initializers가 야기하는 시나리오이며 따라서 learning rate가 동시에 너무 크거나 너무 작을 수도 있다.
      • 우리의 접근법은 dynamic range를 보장하기 때문에 모든 weights에 대해서 learning speed가 같다.

4.2 Pixelwise Feature Vector normalization in Generator

  • competition의 결과로 Generator와 Discriminator 안의 magnitudes가 통제권을 벗어나는 시나리오를 허용하지 않기 위해서, 우리는 각 pixel의 feature vector를 Generator 안에서 각 conv-layer 후에 unit length로 normalize를 하였다.

  • 우리는 이것을 "local response normalization"(Krizhevsky et al., 2012)의 variant를 사용해서 하였다.

  • N: feature map의 수

  • ax,y, bx,y: pixel (x, y)에서의 기존 feature 벡터와 normalized 벡터.

  • 우리는 이런 heavy-handed constraint가 generator를 어떻게도 해치지 않는다는 것이 놀랍다는 것을 발견했고, 실제로도 대두분의 데이터셋에서 결과를 크게 바꾸지 않으면서도 escalation of signal magnitudes를 필요할 때 매우 효과적으로 막았다.

5. Multi-Scale Statistical Similarity for Assessing GAN Results

  • GAN 끼리 results를 비교하기 위해서 엄청한 숫자의 이미지들을 조사해야한다. 이것은 매우 지루하고, 어렵고, 주관적이다.

  • 여러가지를 찾아봤다. MS_SSIM(Odena et al., 2017) 같은 경우들은 large-scale mode collapses를 잘 찾아냈지만 작은 effects들, 예를 들어 textures나 colors에 있어서의 variation의 손실에는 반응하는데 실패했다. 그리고 이들은 직접적으로 이미지 quality를 training set과의 유사성의 관점에서 평가하지 않는다.

  • 우리는 모든 scales에서 성공적인 제너레이터는 local image의 structure가 training data set과 비슷한 samples을 생산할 것이라는 intuition을 기반으로 했다.

  • 우리는 이것을 연구하기를 제안한다. 어떻게 연구하냐면, 생성된 이미지들과 target 이미지들의 Laplacian pyramid((Burt & Adelson, 1987) representations으로부터 도출된 local image patches의 분포들 사이에서 multi-scale statistical similarity를 고려하면서, 16 x 16의 low-pass resolution에서 시작하여서.

  • 표준 관행대로, pyramid는 full resolution에 도달할 때까지 점진적으로 두배가 된다. 각각의 성공적인 level은 기존 level의 up-sampled version의 차이를 인코딩한다.

A single Laplacian pyramid level은 특정한 공간의 frequency band와 대응된다. 우리는 무작위로 16384개의 이미지들을 sample하고 128개의 descriptors를 Laplacian pyramid의 각 level로부터 추출하였다. 이는 우리에게 2의 21승 (2.1M)개의 레벨당 descriptors를 주었다. 각 descriptor는 3 color 채널을 가진 7 x 7 pixel neighborhood 이다. 이는 이렇게 표시된다. 우리는 트레이닝 셋과 생성된 셋의 각 level l로부터 나온 patch를 각각 이라고 표시한다. 우리는 먼저 mean과 standard deviation of each color channel에 대한 를 normalize한다. 그리고 그것들의 sliced Wasserstein distance 을 계산함으로써 statistical similarity를 예측한다. (sliced Wasserstein distance, an efficiently computable randomized approximation to earthmovers distance, using 512 projections (Rabin et al., 2011).)

  • 직관적으로 작은 Wasserstein distance는 patches의 distribution이 유사하다는 것을 가르킨다. 트레이닝 이미지와 생선된 샘플이 그 spatial resolution에서 appearance와 variation이 유사하다는 것을 보여준다.
    • 가장 낮은 해상도인 16 x 16 이미지들로부터 추출된 패치들 간의 거리는 large-scale image structures의 유사성을 의미한다. 반면, finest-level patches는 edges의 sharpness와 noise와 같은 pixel-level의 attributes가 관한 정보를 encode 한다.

6. Experiments

Appendix A 참조 + latent space interpolations. vidoe   first model- conditional DCGAN, second model- unconditional Wasserstein GAN with gradient penalty.

  • network structure(e.g., conv layers, resizing, training configuration(various normalization layers, minibatch-related operations), and training loss (WGAN-GP, LSGAN) 에 대해서 다룰 예정이다.

6.1 IMPORTANCE OF INDIVIDUAL CONTRIBUTIONS IN TERMS OF STATISTICAL SIMILARITY

  • SWD와 MS-SSIM을 사용해봤다. 디테일은 논문에서 확인.
  • 일단 top을 먹었다.
  • 좋은 evaluation metric은 colors, textures and viewpoints 에서 풍부한 variation을 보여주는 그럴듯한 이미지를 보상해야한다. 그런데 MS-SSIM에서는 보이지 않았다. 딱봐도 h보다 a가 별로다. 그리고 거의 값이 변하지 않는 것을 볼 수 있는데 왜냐하면 MS-SSIM는 outputs 간의 variation만 측정하고 training set과의 유사성은 측정하지 않기 때문이다.
  • SWD는 반면에 확실한 개선을 보여준다.

6.2 CONVERGENCE AND TRAINING SPEED

6.3 HIGH-RESOLUTION IMAGE GENERATION USING CELEBA-HQ DATASET

6.4 LSUN RESULTS

6.5 CIFAR10 INCEPTION SCORES

  • 8.80 in unsupervised setting. See Appendix D.

7. Discussion

  • 기존의 GANs에 비해서 quality가 좋고, 훈련도 고해상도에서 안정적이긴 하지만 아직 true photorealism과는 거리가 멀다.
  • Semantic sensibility and understanding dataset-dependent constraints, 예를 들어 특정 물체가 curved기보다 straight, 과제가 많이 남아 있다.
  • micro-structure of the images에 개선의 여지가 있다.
  • realism이 거의 손에 닿을 듯하다. 특히 CELEBA_HQ에서.

8. Acknowledgements

  • 고마운 사람들 말하고 있네요.
⚠️ **GitHub.com Fallback** ⚠️