[Paper Review] Unsupervised Representation Learning with Deep Convolutional Gnenerative Adversarial Networks

본 논문은 unsueprvised learning을 위해 DCGANs에 대해 소개합니다.

0. Background


1. Introduction


Learning reusable feature representations from large unlabeled datasets has been an area of active research. We propose that one way to build good image representations is by training Generative Adversarial Networks (GANs), and later reusing parts of the generator and discriminator networks as feature extractors for supervised tasks. GAN’s learning process and the lack of a heuristic cost function (such as pixel-wise independent mean-square error) are attractive to representation learning.

GAN 기반 unsupervised learning을 통해 학습한 generator 및 discriminator를 superpervised tasks에서 feature extractors로 사용함

Contributions:

  • 안정적으로 학습이 가능한 Convolutional GAN 구조를 제안하였습니다.
  • Discriminator가 이미지 분류에서 다른 unsupervised algorithms과 비교하였을 때 비슷한 성능을 보여주었습니다.
  • DCGAN이 학습한 filter들을 visualize하고, 특정 filter가 특정 object를 생성하는 역할을 한다는 것을 알아냈습니다.
  • DCGAN이 벡터 산술 연산이 가능하였습니다.

2. Realted Work


2-1. Representation learning from unlabeled data

  • Clustering on the data (for example using K-means) and leverage the clusters for improved classification scores

    K-means와 같은 clustering 기법을 활용

  • Auto-encoders (convolutionally, stacked (Vincent et al., 2010), separating the what and where components of the code (Zhao et al., 2015), ladder structures (Rasmus et al., 2015)) that encode an image into a compact code, and decode the code to reconstruct the image as accurately as possible.
  • Deep belief networks

2-2.Generating natural images

  • Non-parametric models
    데이터가 특정 분포를 따른다는 가정 없기에 파라미터의 개수를 정확히 셀 수 없는 모델

Super resolution Super resolution, 이미지 출처: Image Super-Resolution via Iterative Refinement

저해상도 이미지를 고해상도 이미지로 변환

In-painting In-painting, 이미지 출처: Free-Form Image Inpainting with Gated Convolution

이미지의 손상 또는 누락된 부분을 재구성

  • Parametric models
    데이터가 특정 분포를 따른다고 가정하여 파라미터의 수가 명확하게 정해져 있는 모델

한계: 현실세계의 자연스러운 이미지를 생성하는 것은 그다지 성공하지 못하였습니다. - Varational sampling apporach: 어느 정도 성공했지만 생성된 이미지가 흐릿해지는 문제가 종종 발생하였습니다. - (시간남으면 추가)

2-3. Visualizing the internals of CNNs

3. Apporoach and model architecture


Core to our approach is adopting and modifying three recently demonstrated changes to CNN architectures.

우리 접근 방식의 핵심은 CNN 아키텍처에 대해 최근에 증명된된 세 가지 변경 사항을 채택하고 수정하는 것입니다.

  1. All convolutional net Maxpooling과 같이 deterministic spatial pooling 기능을 strided convolutions으로 대체하였습니다. 이를 통해 network가 스스로 spatial downsampling을 학습할 수 있다고 합니다. 본 논문은 이런 접근 방법을 generator에도 적용하여 스스로 sapatial upsampling을 학습하도록 하였으며, discrimiator에도 적용하였습니다.

Maxpooling, Strided Conv2D Maxpooling vs Strided Conv2D

  1. Eliminating fully connected layers Convolutional features 마지막에 fullly connected layers를 제거하는 추세입니다. 그 예로, 최신 이미지 분류 모델에서 활용된 Global average pooling이 있습니다. Global average pooling이 model의 안정성은 향상시키지만, 수렴 속도를 저하시킨다는 것을 발견하였다고 합니다.

가장 마지막에 있는 convolutional features를 generator와 discriminator의 input과 ouput에 직접 연결하는 middle ground가 잘 작동하였다고 합니다. GAN의 첫 번째 layer는 input으로 uniform noise distribution Z를 받음으로써 행렬 곱셈이므로 fully connected라고 할 수 있습니다. 그러나 결과값은 4차원의 tensor로 재구성되어 첫 번째 convolution에 사용됩니다. Discriminator의 경우 마지막 convolution layer는 flatten 되어 단일의 sigmoid output으로 연결되었습니다.

  1. Batch Normalization Batch Normalization은 각 배치별로 평균과 분산을 이용해 정규화하여 안정적으로 학습하도록 합니다. 그러나 모든 layers에 직접 batchnorm을 적용하는 것은 이미지 붕괴(sample collapse) 및 모델 불안정성(model instability)을 초래한다고 합니다. 따라서 본 논문은 generator ouput layer와 discriminator input layer에 batchnorm을 적용하지 않았습니다.

Generator의 경우 ReLU activation이 사용되지만, output layer에는 Tanh function이 사용됩니다. 그 이유로는 Bounded activation을 사용하면 모델이 학습 분포의 color sapce를 포화시키고 커버함으로써 더 빨리 학습한다는 것을 발견했기 때문입니다. 또한, disriminator 내에서 특히 higher resolution modeling에 대해 특히 leakyReLU가 잘 작동한다는 것을 발견하였습니다.

Architecture guidelines for stable Deep Convolutional GANs

  • 모든 max pooling을 convolutional stride로 변환하였습니다.
  • Generator의 outputlayer와 Discriminator의 input layer를 제외하고는 Batchnorm을 사용하였습니다.
  • Fully conected layer를 제거하였습니다.
  • Generator의 output layer에는 Tanh를 사용하였으며, 이외의 모든 layer에는 ReLU를 사용하였습니다.
  • Discriminator의 모든 layer에는 LeakyReLU를 사용하였습니다.

4. Details of adversarial trainig


  • Datasets
    • Large-scale Scene Understanding (LSUN)
    • Imagenet-1k
    • A newly assembled Faces dataset
  • Default setting
    • Pre-processing: scaling to the range of the tanh activation function [-1, 1]
    • Batch size: 128
    • Weight initialization: zero-centerd Normal distribution with standard deviation 0.02
    • LeakyReLU: a slope of 0.2
    • Optimizer: Adam
      • Learning rate: 0.0002
      • Momentum term β1: 0.5
  • 생성 모델 연구에서의 중요한 핵심
    • Genrator가 이미지를 외우는 것이 아니라 특징을 학습해서 생성한다는 것을 보여줘야 합니다.
    • Generator의 input 공간인 latent space(z)의 변화에 대해 결과의 급작스러운 변화가 아닌 부드러운 변화를 보여야 합니다.

4-1. LSUN

이미지 모델들을 통해 생성된 샘플들의 품질은 좋았지만 Overfitting 및 memorization으로 인한 좋은 성능에 대해서는 문제가 제기되었습니다. 따라서 본 논문은 1 epochs 동안 학습한 sample과 수렴한 이후의 sampling을 비교하였습니다.

[이미지]

이를 통해 DCGAN이 단순히 overfitting/memorizing training을 통해 고품질 샘플을 생성하지 않는다는 것을 입증하였습니다.

4-1-1. Deduplication

We fit a 3072-128-3072 de-noising dropout regularized RELU autoencoder on 32x32 downsampled center-crops of training examples. The resulting code layer activations are then binarized via thresholding the ReLU activation which has been shown to be an effective information preserving technique (Srivastava et al., 2014) and provides a convenient form of semantic-hashing, allowing for linear time de-duplication . Visual inspection of hash collisions showed high precision with an estimated false positive rate of less than 1 in 100. Additionally, the technique detected and removed approximately 275,000 near duplicates, suggesting a high recall.

더 나아가 단순 암기로 인한 생성의 가능성을 낮추기 위해 간단한 image de-duplication 실험하였습니다. Memorization 문제를 피하기 위해, 이미지들을 autoencoder를 통해 코드로 변환하도록 하고 이 코드와 가까운 값들을 제거한다. 이러한 과정의 결과로 precision은 높아지고 FP(false positive) 비율은 0.01 이하로 나타났다. 추가적으로 275,000 개의 중복된 이미지들을 제거했다. (recall 상승)

너레이터가 훈련이미지를 기억해버릴 가능성을 낮추기 위해 서로 매우 비슷한 near duplicates인 이미지들을 제거 (3백만장 중 27만 5천장 제거했다고 함).

유사중복이미지 제거과정에서 de-noising autoencoder를 사용하였는데, 원본 이미지들을 오토인코더의 인코더에 input하여 coding 벡터로 인코딩하고 이 코딩값들이 서로 비슷한 관측들을 설정한 비율에 맞는 선까지 제거되도록 했다고 함. 흥미로운 아이디어인듯. 메모

5. Empirical validation of DCGANs capabilities


5-1. Classifying CIFAR-10 using GANs as a feature extractor

Unsupervised representation learning의 성능을 평가하기 위해 algorithms을 supervised datasets의 feature extractor로 적용하고 말단에 linear model를 붙였습니다.

<1 Layer K-means> On the CIFAR-10 dataset, a very strong baseline performance has been demonstrated from a well tuned single layer feature extraction pipeline utilizing K-means as a feature learning algorithm. When using a very large amount of feature maps (4800) this technique achieves 80.6% accuracy.

<3 Layer K-means Learned RF> An unsupervised multi-layered extension of the base algorithm reaches 82.0% accuracy (Coates & Ng, 2011).

<DCAN + L2-SVN> To evaluate the quality of the representations learned by DCGANs for supervised tasks, we train on Imagenet-1k and then use the discriminator’s convolutional features from all layers, maxpooling each layers representation to produce a 4  4 spatial grid.

DCGANs에서 학습된 representation을 평가하기 위해 Imagenet-1k를 학습한 후 discriminator의 convolutional features를 사용하여 4X4 spatial grid를 생산

These features are then flattened and concatenated to form a 28672 dimensional vector and a regularized linear L2-SVM classifier is trained on top of them. This achieves 82.8% accuracy, out performing all K-means based approaches.

Notably, the discriminator has many less feature maps (512 in the highest layer) compared to K-means based techniques, but does result in a larger total feature vector size due to the many layers of 4  4 spatial locations. The performance of DCGANs is still less than that of Exemplar CNNs, a technique which trains normal discriminative CNNs in an unsupervised fashion to differentiate between specifically chosen, aggressively augmented, exemplar samples from the source dataset. Further improvements could be made by finetuning the discriminator’s representations, but we leave this for future work. > DCGANs vs Exemplar CNNs : Discriminator의 representations을 미세조정하여 성능을 개선시킬 수 있지만, 논문에서는 향후 작업으로 남겨두었습니다. Additionally, since our DCGAN was never trained on CIFAR-10 this experiment also demonstrates the domain robustness of the learned features. ## Reference [1] (Parametric & Non-parametric model) https://process-mining.tistory.com/131 [2] (Convoltuion stride & Max pooling) https://nittaku.tistory.com/266