SimGAN
목차
- 1 Learning from Simulated and Unsupervised Images through Adversarial Training
- 2 Abstract
- 3 1. Introduction
- 4 2. S+U Learning with SimGAN
- 5 3. Experiments
- 6 4. Conclusions and Future Work
- 7 References
Learning from Simulated and Unsupervised Images through Adversarial Training
arXiv:1612.07828
Ashish Shrivastava, Tomas Pfister, Oncel Tuzel, Josh Susskind, Wenda Wang, Russ Webb
CVPR2017 best paper중 하나.
애플의 very first paper 첫타석 홈런. (다른 하나는 DenseNet by Facebook)
데이터를 사람이 일일이 모으기가 힘들거나 불가능하므로, 데이터를 생성(synthetic data)해서 학습시키기도 함. (당연하게도) 생성시에 annotation(gaze detection이면 시선의 방향정보)도 같이 생성된다.
이 생성된 데이터를 좀 더 ‘실제와 같이 refine’(=‘add realism’)한 다음 학습데이터로 쓰면 더 좋은 결과를 얻을 수 있고, 이 Refiner를 만드는 방법에 대한 논문이다. 인공적으로 만들어낸 이미지를 더 실제와 같이 보이게 하는 것도 어렵지만, refine 과정 중 annotation을 유지해야 하는 점도 어렵다.
Abstract
이미지를 합성해서 학습할 수 있으면 좋은데 gap between synthetic and real image distributions때문에 잘 안된다. 그래서 Simulated+Unsupervised(S+U) learning을 제안한다. unlabeled real data로부터 ‘realism’을 배워서, simulator가 만들어내는 데이터를 annotation을 유지한 채 가공하겠다. GAN을 이용해 만들것이다. 다만 random vector가 input이 아니고, 합성된 이미지가 input이다.
annotation을 유지하고, artifact를 피하고, 학습과정을 안정화시키기 위해 (i) ‘self-regularization’ term을 넣고 (ii) local adversarial loss를 쓰고 (iii) discriminator를 학습시킬 때 refined image의 history를 이용할 것이다.
1. Introduction
데이터 모으기가 힘드니까 합성된 데이터를 학습에 이용하려는 시도가 주목받고 있다. 그런데 보통 잘 안된다. Simulator를 잘 만들어서 실제같이 만드는 방법은 computationally 비싸고, 비싸게 한다고 해도 unrealistic detail을 증가시키기도 한다(overfit).
S+U learning(=SimGAN=refiner net + discriminative net)은 annotation을 유지한 채(예를들어 MPIIGaze dataset같은 경우 ‘시선의 방향’을 유지한 채) realism을 학습한다. Refiner의 경우, annotation을 유지하기 위해 너무 많은 변형(refine)을 허용하지 않으려고 self-regularization loss를 넣었다. 그리고 (이것도 annotation을 유지하기 위해) 이미지 전체의 변형이 아니라 pixel level에서 변형하도록 한다. discriminator도 drifting과 spurious artifacts를 막기 위해 receptive field를 제한한다. 구체적으로, 이미지 전체가 아니라 패치단위로 loss를 보겠다.(local adversarial losses)
discriminator를 학습시킬 때, refiner가 그때그때 생성해내는 이미지 뿐 아니라, 이전에 생성했던 이미지들도 쓰겠다.
1.1. Related Work
이런간 저런간 여기도 간 저기도 간 간때문이야 간때문이야
다 볼 수는 없고 그냥 눈에 띄는 것만.
- InfoGAN[1]
- super-resolution face[2]
- SeqGAN[3] : GAN에 RL적용했다고 한다
- pixel-level style transfer[4]
: 안볼거지만 그냥 한국사람들꺼니까 적어본다. 루닛작품
이런것들은 다 annotation을 이용하지 않는다.
학습에 synthetic data이용하려는 시도들도 이것저것(중에 글꼴관련된 것[5]도 있고. font recognition이라니. 재미있겠다)많이 있었다.
transfer learning에서 realism학습과 일맥상통하는 시도들이 약간 있었다.
2. S+U Learning with SimGAN
Refiner’s loss
$$\begin{equation}
\mathcal{L}_R(θ) = \sum\limits_{i} \ell_\text{real} (θ; \mathbf{x}_i, \mathcal{Y}) + λ\ell_\text{reg}(θ; \mathbf{x}_i)
\end{equation}$$
where \(\mathbf{x}_i\) is the \(i^\text{th}\) synthetic training image.
자세한 설명은 바로 아래에.
2.1. Adversarial Loss with Self-Regularization
Discriminator network’s loss
$$\begin{equation}
\mathcal{L}_D(\phi) = - \sum\limits_{i} \log ( D_\phi(\tilde{\mathbf{x}}_i))
-\sum\limits_{j} \log(1-D_\phi(\mathbf{y}_j))\end{equation}$$
\(D_\phi(\cdot)\)이 synthetic image에서 1을 내놓는 probability일 때, 위는 cross-entropy error와 같다.
(\(\tilde{\mathbf{x}}_i\)가 synthetic image, \(\mathbf{y}_j\)가 real image.)
\(D_\phi(\cdot)\)는 ConvNet으로 만든다.
\((1)\)의 \(\ell_\text{real} \)은 다음을 쓴다. $$ \ell_\text{real} (θ; \mathbf{x}_i, \mathcal{Y}) = -\log(1 - D_\phi ( R_\theta(\mathbf{x}_i))) $$ 그냥 \(R\)이 가짜를 real로 만들어주어서 \(D_\phi\)가 \(0\)이 나오면 좋다는 그런 당여어어언한 이야기
\((1)\)의 \(\ell_\text{reg}\)은 pixel difference를 쓴다. \(\ell_\text{reg} = \lVert ψ(\hat{\mathbf{x}}) - \mathbf{x} \rVert_1\) where \(ψ\) is the mapping from image space to a feature space, and \(\lVert \cdot\rVert_1\) is the L1 norm.
\(R_θ\)는 fully convolutional neural net이지만, striding이나 pooling을 쓰지 않았고 pixel level로만 동작한다.
2.2. Local Adversarial Loss
Discriminator가 좋아질수록 refiner는 이상한 것들(drifting, artifacts)을 집어넣으려고 하는데 그것을 막기 위해 ‘refined image의 어떤 patch라도 real image patch와 비슷한 statistics를 가져야 한다’는 아이디어를 이용한다. 그래서 discriminator network이 이미지 전체를 하나로 두고 classify하는 것이 아니라, 이미지를 조각조각 나누어 각 patch에 대해 classify하게 했다. 부수적으로 하나의 이미지에서 많은 샘플을 얻는 효과도 있다. 아래 그림은 이것을 나타낸 것이다.
Figure 3. Illustration of local adversarial loss. The discriminator network outputs a \(w \times h\) probability map. The adversarial loss function is the sum of the cross-entropy losses over the local patches.
2.3. Updating Discriminator using a of Refined Images
보통 discriminator들은 가장 최근 생성된 refiner image만 대상으로 학습한다. 이로 인해 adversarial training이 발산하기도 하고, discriminator가 잊어버린 artifact를 다시 들고 나오기도 한다. Refiner가 언제 만들었든 ‘fake’임에는 변함이 없으므로 과거에 만들어 두었던 것도 쓰기로 한다. 구체적으로,
- size B의 buffer
- mini-batch size = b < B
- Discriminator가 학습할 때 b/2는 현재 refiner가 만들어 낸 것을 쓰고 b/2는 buffer에서 꺼내 쓴다.
- B에서 b/2만큼 임의로 제거하고 새로 만들어진 이미지에서 같은 장수를 골라 넣는다.
running average를 쓴 선례[6]가 있다.
3. Experiments
- MPIIGaze dataset
- NYU hand pose dataset of depth images
- fully convolutional refiner network with ResNet blocks
3.1. Appearance-based Gaze Estimation
Qualitative Results :
결과보면 그냥 무지 좋다. skin texture를 잘 잡아낸다.(hand pose estimation에서는 depth boundary artifacts를 잘 만들어낸다.)
Self-regularization in Feature Space:
pixelwise L1 difference가 너무 restrictive할 수 있는데, 그럴 때는 L1 norm을 feature space에서 적용하는 방법이 있다.
‘Visual Turing Test’:
사람한테 직접 실험해 보았는데 정말 못찾더라. = refiner가 손봐주면 완전 진짜 같더라
Selected as real | Selected as synt | |
Ground truth real | 224 | 276 |
Ground truth synt | 207 | 293 |
Table 1. Results of the ‘Visual Turing test’ user study for classifying real vs refined images. The average human classification accuracy was 51.7% (chance = 50%). |
10 subjects chose the correct label 517 times out of 1000 trials (\(p = 0.148\)) 왜 \(p\)가 \(0.148\)인가???
refiner를 거치지 않은 synthetic image는 162 times out of 200 trials 맞춘다. (\(p \le 10^{-8}\))
아 \(p\)계산 어떻게 하는지 모르겠다..
Quantitative Results:
Method | Real/Synthetic | Error(degree) |
---|---|---|
Support Vector Regression (SVR) | R | 16.5 |
Adaptive Linear Regression ALR) | R | 16.4 |
Random Forest (RF) | R | 15.4 |
kNN with UT Multiview | R | 16.2 |
CNN with UT Multiview | R | 13.9 |
k-NN with UnityEyes | S | 9.9 |
CNN with UnityEyes Synthetic Images | S | 11.2 |
CNN with UnityEyes Refined Images | S | 7.8 |
Table 3. Comparison of SimGAN to the state-of-the-art on the MPIIGaze dataset of real eyes. Training on refined images results in a 2.1 degree improvement, a relative 21% improvement compared to the state-of-the-art.
Preserving Ground Truth:
pupil center를 찍고 refine한 뒤에 pixel difference를 보았는데 \(1.1 ± 0.8\)px 이었다. eye width가 \(55\)px.
Implementation Details:
\(R_\theta, D_\phi\)의 자세한 구조는 논문 참조.
먼저 \(R_\theta\)를 \(\ell_\text{reg}\)만 가지고 1000 step 훈련했고 그 다음 \(D_\phi\)를 200 step. 그 다음, \(D_\phi\)를 update할때마다 \(R_\theta\)를 두번씩 했다. 이건 무슨말이냐? 코드나 공개해다오
모든 network의 learning rate = \(0.001\), batch size = \(512\)
validation error가 수렴하면 멈췄다.
3.2. Hand Pose Estimation from Depth Images
We pre-process the data by cropping the pixels from real images using the synthetic images. 뭔말이야..
Qualitative Results, Quantitative Results다 좋고 Implementation Details는 논문 참고.
(refined) synthetic training examples의 숫자를 늘리는 것이 학습에 좋다.
3.3. Ablation Study
refined images의 history가 severe artifacts를 막는다.
4. Conclusions and Future Work
그냥 조오타
앞으로는, (i) 하나의 synthetic에서 여러개의 refined를 얻는 것, (ii) video를 refine하는 것이 과제다.
References
- ↑ X. Chen, Y. Duan, R. Houthooft, J. Schulman, I. Sutskever, and P. Abbeel. InfoGAN: Inter- pretable representation learning by information maximizing generative adversarial nets. arXiv preprint arXiv:1606.03657, 2016.
- ↑ O. Tuzel, Y. Taguchi, and J. Hershey. Global- local face upsampling network. arXiv preprint arXiv:1603.07235, 2016.
- ↑ L. Yu, W. Zhang, J. Wang, and Y. Yu. Seqgan: Sequence generative adversarial nets with policy gradient. arXiv preprint arXiv:1609.05473, 2016.
- ↑ D. Yoo, N. Kim, S. Park, A. Paek, and I. Kweon. Pixel-level domain transfer. In Proc. ECCV, 2016.
- ↑ Z. Wang, J. Yang, H. Jin, E. Shechtman, A. Agar- wala, J. Brandt, and T. Huang. Deepfont: Identify your font from an image. In Proc. ACMM, 2015.
- ↑ T. Salimans, I. Goodfellow, W. Zaremba, V. Che- ung, A. Radford, and X. Chen. Improved techniques for training gans. arXiv preprint arXiv:1606.03498, 2016.