AnoGAN

AnoGAN

Schlegl, T., Seebรถck, P., Waldstein, S. M., Schmidt-Erfurth, U., & Langs, G. (2017, June). Unsupervised anomaly detection with generative adversarial networks to guide marker discovery. In International conference on information processing in medical imaging (pp. 146-157). Springer, Cham.

In Short

Semi-supervised Anomaly Detection, ๊ทผ๋ฐ GAN์„ ๊ณ๋“ค์ธ. (์†”์งํžˆ unsupervised๋Š” ์•„๋‹ˆ๋‹ค.)

1. Introduction

AnoGAN2


AnoGAN1g

์ •์ƒ๋ฐ์ดํ„ฐ๋งŒ์œผ๋กœ DCGAN์„ ํ•™์Šต์‹œํ‚จ ํ›„, image space์—์„œ latent space๋กœ์˜ mapping์„ base๋กœ ํ•˜๋Š” ์ƒˆ๋กœ์šด anoamly score๋ฅผ ์ œ์•ˆํ•œ ๋ฐฉ๋ฒ•๋ก 

2-1. DCGAN

DCGAN

DCGAN: Deep Convolutional Generative Adversarial Networks

  • ํŠน์ง•. Walking in the latent space
    • latent vector์„ ์กฐ๊ธˆ์”ฉ ๋ณ€๊ฒฝํ•˜๋ฉด ์ด๋ฏธ์ง€(๊ทธ๋ฆผ)๋„ ๋ถ€๋“œ๋Ÿฝ๊ฒŒ ๋ณ€๊ฒฝ๋œ๋‹ค.
    • Generator์—์„œ Memorization์ด ์ผ์–ด๋‚˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋‹ค. (์ด๋ฏธ์ง€๋ฅผ ์™ธ์›Œ์„œ ๋ณด์—ฌ์ฃผ๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋‹ค.)
    • ์ฆ‰, ์ด๋ฏธ์ง€์™€ overfitting๋˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋‹ค.

2-2. t-SNE embedding

tsne

t-distributed stochastic neighbor embedding

3. Methods

3-1. DCGAN

DCGAN2

$$\min_G\max_D V(D,G) = E_{x\sim p_{data}(x)}[\log D(x)] + E_{z\sim p_z(z)}[\log(1-D(G(z)))] \\ z : \text{latent vetor} \\ x: \text{data sample} \\ G(z): \text{generated sample using z} \\ D(x): \text{probability that x is a real sample}$$

์ •์ƒ๋ฐ์ดํ„ฐ๋กœ DCGAN์„ ํ•™์Šต์‹œํ‚จ๋‹ค. ์ฆ‰, ์ •์ƒ๋ฐ์ดํ„ฐ์˜ Manifold(ํŠน์ง•๊ณต๊ฐ„)๋ฅผ ํ•™์Šตํ•œ๋‹ค.

3-2. Anomaly Score

$$\begin{align} &\text{Loss Function } &L(z_\gamma) &= (1-\gamma) \cdot L_R(z_\gamma) + \gamma \cdot L_D(z_\gamma) \\ &\text{Residual Loss } &L_R(z_\gamma) &= \sum|x-G(z_\gamma)| \\ &\text{Discrimination Loss } &L_D(z_\gamma) &= \sum|D(x) - D(G(z_\gamma))| \end{align}$$

๊ฐ€์ค‘์น˜ \(\gamma\)๋Š” ์ฃผ๋กœ 0.9์œผ๋กœ ์ค€๋‹ค๊ณ  ํ•œ๋‹ค.

Residual Loss๋Š” ๊ฐ„๋‹จํ•˜๊ฒŒ Generator Anomaly score๋ผ๊ณ  ์ƒ๊ฐํ•˜๋ฉด ๋œ๋‹ค. ์ฆ‰, ์‹ค์ œ ๋ฐ์ดํ„ฐ์™€ ์žฌ๊ตฌ์ถ•๋œ ๋ฐ์ดํ„ฐ์˜ ์ฐจ์ด๋ฅผ ๋น„๊ตํ•˜๋Š” ๊ฐ’์ด๋‹ค.

Discrimination Loss๋Š” Discriminator Anomaly Score๋ผ๊ณ  ์ƒ๊ฐํ•˜๋ฉด ๋œ๋‹ค. ์ฆ‰, ์‹ค์ œ ๋ฐ์ดํ„ฐ์˜ ๊ฐ€๋Šฅ๋„์™€ ์žฌ๊ตฌ์ถ•๋œ ๋ฐ์ดํ„ฐ์˜ ๊ฐ€๋Šฅ๋„๋ฅผ ๋น„๊ตํ•˜๋Š” ๊ฐ’์ด๋‹ค.

3-3. Invert Mapping

๋ฌธ์ œ ์ œ๊ธฐ

GAN์˜ generator๋ฅผ ํ†ตํ•ด์„œ Latent Vector z์— ์ƒ์‘ํ•˜๋Š” ์ด๋ฏธ์ง€๋ฅผ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์ง€๋งŒ, ๋ฐ˜๋Œ€๋กœ ์ด๋ฏธ์ง€์— ๋งž๋Š” latent space๋ฅผ ์ƒ์„ฑํ•˜๋Š” ๊ฒƒ์€ ๊ธฐ์กด์˜ ๋ฐฉ๋ฒ•๋ก ์„ ํ†ตํ•ด์„œ๋Š” ๋ถˆ๊ฐ€๋Šฅํ•˜๋‹ค.

๋ฐฉ๋ฒ• ์ œ์‹œ

  1. Latent Space ์ƒ์—์„œ ์ž„์˜์˜ latent vector \(z_0\)๋ฅผ ์žก๋Š”๋‹ค.
  2. \(z_0\)์— ์ƒ์‘ํ•˜๋Š” \(x'_0\)๋ฅผ ๊ตฌ์„ฑํ•œ๋‹ค.
  3. test data x์— ์ข€ ๋” ๊ฐ€๊นŒ์šด latent vector \(z_1\)๋กœ ์—…๋ฐ์ดํŠธํ•œ๋‹ค.
  4. n๋ฒˆ์˜ ์—…๋ฐ์ดํŠธ๋ฅผ ์‹œํ–‰ํ•˜์—ฌ test data x์— ๊ฐ€์žฅ ์ž˜ ์ƒ์‘ํ•˜๋Š” latent vector๋ฅผ ์ฐพ๋Š”๋‹ค.

4. Performance Comparison

4-1. Dataset

clinical high resolution SD-OCT volumes of the retina with 49 B-scans

4-2. Baseline

  1. aCAE: adversarial convolutional autoencoder, runtime ๋ฉด์—์„œ๋Š” ํšจ์œจ์ . Anomaly score๋Š” residual loss์™€ discrimination loss ๋ชจ๋‘ ์‚ฌ์šฉํ•˜๋‚˜, ์ด๋•Œ generator๋Š” encoder-decoder ๊ตฌ์กฐ
  2. GAN_R: AnoGAN ํ˜•ํƒœ์ด๋‚˜, anomaly scoring ํ•  ๋•Œ๋‚˜, invert mapping ํ•  ๋•Œ reference anomaly score๋กœ discrimination score๋งŒ ์‚ฌ์šฉ๋จ.
  3. P_D: DCGAN

4-3. Main Results

result1

result2

result3

result4

5. Conclusion

  1. ์ •์ƒ๋ฐ์ดํ„ฐ๋งŒ์œผ๋กœ ํ•™์Šต ๊ฐ€๋Šฅ
  2. ๋ฐ์ดํ„ฐ ๋ถˆ๊ท ํ˜• ๋ฌธ์ œ ํ•ด๊ฒฐ
  3. F-AnoGAN, GANomaly ๋“ฑ์œผ๋กœ ๋ฐœ์ „

Critical Point (MY OWN OPINION)

  1. ์†”์งํ•˜๊ฒŒ ์ด ๋ฐฉ๋ฒ•๋ก ์€ DCGAN์—์„œ ์ •์ƒ๋ฐ์ดํ„ฐ๋งŒ์œผ๋กœ ํ•™์Šตํ•˜๊ธฐ ๋•Œ๋ฌธ์—, unsupervised๋ผ๊ณ  ํ•˜๊ธฐ์—๋Š” ์–ด๋ ต์ง€ ์•Š๋‚˜ ์‹ถ๋‹ค. ๊ตณ์ด ๋”ฐ์ง€์ž๋ฉด semi-supervised๊ฐ€ ๋งž์ง€ ์•Š๋‚˜ ์‹ถ๋‹ค.

Reference

[1] https://sensibilityit.tistory.com/506
[2] Youtube ์˜์ƒ