SlideShare uma empresa Scribd logo
1 de 27
Anomaly Detection with GANs
https://arxiv.org/abs/1703.05921
Postech 이도엽씨가 구현한 Tensorflow 코드
https://github.com/LeeDoYup/AnoGAN
처음 접하는 분들을 위하여 우선
Generative Adversarial Network부터
간단히 알아보자
판별모델(discriminative model)이 아닌 생성모델(generative model) !
판별모델 생성모델
• 많아 봐왔던 일반적인 기계학습은 판별모델(class별 확률계산)
- class를 나누기 위해 선(decision boundary)을 찾는다 !
• 생성모델은 판별하는 것이 아니라 class별 범위(distribution)를 찾는다 !
 GAN, VAE
Generative Adversarial Network 이란 ?
왜 이런 어려운 모델까지 ?
Curse of Dimensionality
• In many applications, we simply vectorize an image or image patch
• 256 x 256 image converts to a 65,536-dimensional vector.
• Images, therefore, are typically very high-dimensional data
• Affects the convergence of any learning algorithm.
• In some applications, we know that there are only a few variables, for e.g.,
face pose and illumination.
• Data lie on some low-dimensional subspace/manifold in the high-dimensional
space.
 주어진 data set의 축약된 모델(Manifold)을 찾아보자 !
특징이 서로 얽혀 있어 해석이 불가능한 Physical space에서
해석이 용이하도록 서로 독립적인 Eigen space로 변환하는 것 처럼
영향이 매우 작으므로
무시
Manifold Assumption
• Data lie approximately on a manifold of much lower
dimension than the input space
• Mapping between two space is unique & reversible
Manifold Assumption
Manifold Assumption
- The curse of dimensionality can be mitigated under the manifold assumption.
- Linear dimensionality reduction techniques like PCA have been widely used in
the vision community.
- Recent trend is towards non-linear techniques that recover the intrinsic
parameterization (pose, emotion, illumination, etc  mode).
GAN이란 ?
• GAN: Generative Adversarial Networks [Goodfellow+,2014]
– Generator (G)와 Discriminator (D)를 서로 경쟁시켜서
생성 정확도의 향상을 도모하는 모델
GAN이란?
GAN: Generative Adversarial Networks [Goodfellow+,2014]
• Generator (G)와 Discriminator (D)를 서로 경쟁시켜서
생성 정확도의 향상을 도모하는 모델
• G : 생성용 벡터 z로부터 데이터를 생성
• D : 대상 데이터가 진짜(데이터 세트)
인가 가짜(G에 의해 생성)를 식별
데이터셋의 데이터를
「진짜」로 식별
생성된 데이터를「위조」로 식별
D(Image) : Discriminator에 의해 계산된 “image가 real일 확률”
Discriminator가 「진짜」에 대해서는 “1”에 가깝도록
Generator가 생성한 「위조」에 대해서는 “0”에 가깝도록
 D(x)  1, D(G(z))  0 이 되도록
log(1-G(x))
G(x)
log(x)
x
2 개의 모델을 만들어 경쟁시킴으로써 데이터의 분포를 학습시키는
비지도학습 프레임 워크
: Generator에 의해 예측된 데이터 분포
Diagram of Standard GAN
이제 본격적으로
Unsupervised Anomaly Detection with
GANs to Guide Marker Discovery
Anomaly detection : 정상치에서 벗어난 관측치들을 detect 
One-class classification 혹은 one-class description
Anomaly detection 문제점 : 보통 현실에서는 비정상 관측치가 거의
없는 경우가 많기 때문
통상 제조 공정에서 관리되는 품질 수준이 ppm단위
이런 경우에는 정상 관측치를 모델링함으로서 그 모델에서 벗어나는
정도를 기반으로 fault detection
이 연구에서는 아래 그림처럼 정상 data만으로 학습시킨 GAN
모델를 이용하여 Query data에 대하여 정상여부는 물론
비정상 시 비정상 영역을 찾아내고자 함.
1. 정상 data를 이용하여 Generator & Discriminator의 훈련
- Deep convolutional generative adversarial network을 이용하여
latent space(z)로 부터 Generator를 이용하여 생성된 image와
Real image를 구별하도록 Discriminator를 훈련
 정상 data의 latent space(z) 분포를 학습
2. 비정상 data여부와 비정상 영역 파악
- 훈련된 Generator & Discriminator의 parameter를 고정한 채
Query image에 대한 latent space(z)로의 mapping 작업을 수행
훈련된 정상 data의 경우, 기학습된 정상 data의 latent space(z) 로
mapping이 되지만, 비정상 data의 경우 벗어남
 cost function의 오차가 발생
Anomaly Detection은 다음과 같이 2단계로 이루어짐
1. GAN을 이용하여 정상 data 모델링하기
: 정상 data의 generative model(distribution)을 GAN을 이용하여 학습
정상 𝑑𝑎𝑡𝑎 𝐼 𝑚, with m = 1,2,.....,M, where 𝐼 𝑚 ∈ 𝑅 𝑎𝑥𝑏
임의의 위치에서 랜덤하게 cxc크기의 K 2-D image
patches를 추출 x = 𝑥 𝑘,𝑚 ∈ ℵ with k = 1,2,……,K.
D and G are simultaneously optimized through the following two-
player minimax game with value function V (G,D)
The discriminator is trained to maximize the probability of assigning
real training examples the “real” and samples from 𝑝 𝑔the “fake” label
2. Query data의 latent space Mapping
Query image x가 주어질 경우, 이와 가장 유사한 가상 image인 G(z) 에
해당하는 latent space상의 점 z을 찾는다.
x 와 G(z)의 유사여부는 query image가 generator의 훈련시 사용된 정상
data의 분포 𝑝 𝑔를 어느 정도 따르느냐에 의해 결정
z을 찾기 위하여 , latent space distribution Z에서 랜덤하게 샘플된 z1 을
기훈련된 generator에 입력하여 얻은 출력 G(z1)와 x의 차(loss ft’n)를 최
소화하도록 backpropagation을 통하여 latent space의 점z2로 update
z
정상 image의 Latent space(z)가 1차원이라고 가정하고
Z은 다음과 같은 분포로 가정하면
𝜇 𝑧
z𝜇 𝑧
Query image에 대한 latent space(z) mapping은
i) 임의의 값 𝑧1에서 시작하여 loss ft’n을 최소화하도록 update
ii) 주어진 Γ번째 iteration 후 𝑧Γ이 allowable range안에 들어왔는지
여부에 때라 정상, 비정상을 구분
𝑧1 𝑧2 𝑧Γ
Allowable range
• Overall loss or Anomaly score:
• Anomaly score consists of two parts:
• Residual Loss - visual similarity
• Discrimination Loss - enforces the generated image to lie on the manifold
Query Image의 Mapping에 대한 Loss function 정의
Improved discrimination loss based on feature matching
• f(.) – output of intermediate layer of the discriminator
• It is some statistics of an input image
This approach utilizes the trained discriminator not as classifier
but as a feature extractor
3. Anomaly Detection
Anomaly score : query image x가 정상 image에 얼마나 부합하는지 여부
R(x) : Γ번의 backpropagation후 Residual loss
D(x) : Γ번의 backpropagation후 Discrimination Loss
비정상 image : A(x) is large
정상 image : A(x) is small
𝑥 𝑅 = 𝑥 − 𝐺 𝑧Γ
Residual error : image내의 비정상 영역을 나타냄
4. Experiments
실험대상은 망막층을 3차원적으로 관측하는 빛간섭단층촬영(OCT) 영상
• Data, Data Selection and Preprocessing
i) Training sets :
- 2D image patches extracted from 270 clinical OCT volumes of healthy subjects
- The gray values were normalized to range from -1 to 1.
- Extracted in total 1,000,000 2D training patches with an image resolution of
64x64 pixels at randomly sampled positions.
ii) Testing sets :
- patches were extracted from 10 additional healthy cases and 10
pathological cases, which contained retinal fluid
- Test set in total consisted of 8,192 image patches and comprised
normal and pathological samples
iii) Model description
- Adopt DCGAN architecture that resulted in stable GAN training on
images of sizes 64x64 pixels.
- Utilized intermediate representations with 512-256-128-64 channels
(instead of 1024-512-256-128)
- Discrimination loss : Feature representations of the last convolution
layer of the discriminator was used
- Training was performed for 20 epochs utilizing Adam optimizer.
- Ran 500 backpropagation steps for the mapping of new images to the
latent space.
- Used λ= 0.1 in loss function
i) Generative capability of the DCGAN
5. Experiments
Given image
Generated image
Residual overlay
Pixel-level annotations
of retinal fluid
Normal image Anomalous image
ii) Detection performance
ROC curves
Distribution of the residual score(c)
and of the discrimination score(d)
Latent space에서 정상 data(trained data 및 test data 중 정상)간의 분포는
유사하나 Test data 중 비정상과는 확실한 차이를 나타냄

Mais conteúdo relacionado

Mais procurados

InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...
InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...
InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...홍배 김
 
Introduction to Generative Adversarial Networks (GANs)
Introduction to Generative Adversarial Networks (GANs)Introduction to Generative Adversarial Networks (GANs)
Introduction to Generative Adversarial Networks (GANs)Appsilon Data Science
 
パンハウスゼミ 異常検知論文紹介 20191005
パンハウスゼミ 異常検知論文紹介  20191005パンハウスゼミ 異常検知論文紹介  20191005
パンハウスゼミ 異常検知論文紹介 20191005ぱんいち すみもと
 
1시간만에 GAN(Generative Adversarial Network) 완전 정복하기
1시간만에 GAN(Generative Adversarial Network) 완전 정복하기1시간만에 GAN(Generative Adversarial Network) 완전 정복하기
1시간만에 GAN(Generative Adversarial Network) 완전 정복하기NAVER Engineering
 
GAN in medical imaging
GAN in medical imagingGAN in medical imaging
GAN in medical imagingCheng-Bin Jin
 
Mask-RCNN for Instance Segmentation
Mask-RCNN for Instance SegmentationMask-RCNN for Instance Segmentation
Mask-RCNN for Instance SegmentationDat Nguyen
 
Generative Adversarial Networks (GANs) - Ian Goodfellow, OpenAI
Generative Adversarial Networks (GANs) - Ian Goodfellow, OpenAIGenerative Adversarial Networks (GANs) - Ian Goodfellow, OpenAI
Generative Adversarial Networks (GANs) - Ian Goodfellow, OpenAIWithTheBest
 
InfoGAN and Generative Adversarial Networks
InfoGAN and Generative Adversarial NetworksInfoGAN and Generative Adversarial Networks
InfoGAN and Generative Adversarial NetworksZak Jost
 
GANs and Applications
GANs and ApplicationsGANs and Applications
GANs and ApplicationsHoang Nguyen
 
[DL輪読会]StackGAN: Text to Photo-realistic Image Synthesis with Stacked Generat...
[DL輪読会]StackGAN: Text to Photo-realistic Image Synthesis with Stacked Generat...[DL輪読会]StackGAN: Text to Photo-realistic Image Synthesis with Stacked Generat...
[DL輪読会]StackGAN: Text to Photo-realistic Image Synthesis with Stacked Generat...Deep Learning JP
 
Super resolution in deep learning era - Jaejun Yoo
Super resolution in deep learning era - Jaejun YooSuper resolution in deep learning era - Jaejun Yoo
Super resolution in deep learning era - Jaejun YooJaeJun Yoo
 
Semantic segmentation with Convolutional Neural Network Approaches
Semantic segmentation with Convolutional Neural Network ApproachesSemantic segmentation with Convolutional Neural Network Approaches
Semantic segmentation with Convolutional Neural Network ApproachesFellowship at Vodafone FutureLab
 
【DL輪読会】StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery
【DL輪読会】StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery【DL輪読会】StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery
【DL輪読会】StyleCLIP: Text-Driven Manipulation of StyleGAN ImageryDeep Learning JP
 
Survey on Monocular Depth Estimation
Survey on Monocular Depth EstimationSurvey on Monocular Depth Estimation
Survey on Monocular Depth Estimation범준 김
 
Generative adversarial networks
Generative adversarial networksGenerative adversarial networks
Generative adversarial networks남주 김
 
[DL輪読会]Neural Radiance Flow for 4D View Synthesis and Video Processing (NeRF...
[DL輪読会]Neural Radiance Flow for 4D View Synthesis and Video  Processing (NeRF...[DL輪読会]Neural Radiance Flow for 4D View Synthesis and Video  Processing (NeRF...
[DL輪読会]Neural Radiance Flow for 4D View Synthesis and Video Processing (NeRF...Deep Learning JP
 
알기쉬운 Variational autoencoder
알기쉬운 Variational autoencoder알기쉬운 Variational autoencoder
알기쉬운 Variational autoencoder홍배 김
 
Image anomaly detection with generative adversarial networks
Image anomaly detection with generative adversarial networksImage anomaly detection with generative adversarial networks
Image anomaly detection with generative adversarial networksSakshiSingh480
 
Deformable Part Modelとその発展
Deformable Part Modelとその発展Deformable Part Modelとその発展
Deformable Part Modelとその発展Takao Yamanaka
 

Mais procurados (20)

InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...
InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...
InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...
 
Introduction to Generative Adversarial Networks (GANs)
Introduction to Generative Adversarial Networks (GANs)Introduction to Generative Adversarial Networks (GANs)
Introduction to Generative Adversarial Networks (GANs)
 
パンハウスゼミ 異常検知論文紹介 20191005
パンハウスゼミ 異常検知論文紹介  20191005パンハウスゼミ 異常検知論文紹介  20191005
パンハウスゼミ 異常検知論文紹介 20191005
 
1시간만에 GAN(Generative Adversarial Network) 완전 정복하기
1시간만에 GAN(Generative Adversarial Network) 완전 정복하기1시간만에 GAN(Generative Adversarial Network) 완전 정복하기
1시간만에 GAN(Generative Adversarial Network) 완전 정복하기
 
GAN in medical imaging
GAN in medical imagingGAN in medical imaging
GAN in medical imaging
 
Depth estimation using deep learning
Depth estimation using deep learningDepth estimation using deep learning
Depth estimation using deep learning
 
Mask-RCNN for Instance Segmentation
Mask-RCNN for Instance SegmentationMask-RCNN for Instance Segmentation
Mask-RCNN for Instance Segmentation
 
Generative Adversarial Networks (GANs) - Ian Goodfellow, OpenAI
Generative Adversarial Networks (GANs) - Ian Goodfellow, OpenAIGenerative Adversarial Networks (GANs) - Ian Goodfellow, OpenAI
Generative Adversarial Networks (GANs) - Ian Goodfellow, OpenAI
 
InfoGAN and Generative Adversarial Networks
InfoGAN and Generative Adversarial NetworksInfoGAN and Generative Adversarial Networks
InfoGAN and Generative Adversarial Networks
 
GANs and Applications
GANs and ApplicationsGANs and Applications
GANs and Applications
 
[DL輪読会]StackGAN: Text to Photo-realistic Image Synthesis with Stacked Generat...
[DL輪読会]StackGAN: Text to Photo-realistic Image Synthesis with Stacked Generat...[DL輪読会]StackGAN: Text to Photo-realistic Image Synthesis with Stacked Generat...
[DL輪読会]StackGAN: Text to Photo-realistic Image Synthesis with Stacked Generat...
 
Super resolution in deep learning era - Jaejun Yoo
Super resolution in deep learning era - Jaejun YooSuper resolution in deep learning era - Jaejun Yoo
Super resolution in deep learning era - Jaejun Yoo
 
Semantic segmentation with Convolutional Neural Network Approaches
Semantic segmentation with Convolutional Neural Network ApproachesSemantic segmentation with Convolutional Neural Network Approaches
Semantic segmentation with Convolutional Neural Network Approaches
 
【DL輪読会】StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery
【DL輪読会】StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery【DL輪読会】StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery
【DL輪読会】StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery
 
Survey on Monocular Depth Estimation
Survey on Monocular Depth EstimationSurvey on Monocular Depth Estimation
Survey on Monocular Depth Estimation
 
Generative adversarial networks
Generative adversarial networksGenerative adversarial networks
Generative adversarial networks
 
[DL輪読会]Neural Radiance Flow for 4D View Synthesis and Video Processing (NeRF...
[DL輪読会]Neural Radiance Flow for 4D View Synthesis and Video  Processing (NeRF...[DL輪読会]Neural Radiance Flow for 4D View Synthesis and Video  Processing (NeRF...
[DL輪読会]Neural Radiance Flow for 4D View Synthesis and Video Processing (NeRF...
 
알기쉬운 Variational autoencoder
알기쉬운 Variational autoencoder알기쉬운 Variational autoencoder
알기쉬운 Variational autoencoder
 
Image anomaly detection with generative adversarial networks
Image anomaly detection with generative adversarial networksImage anomaly detection with generative adversarial networks
Image anomaly detection with generative adversarial networks
 
Deformable Part Modelとその発展
Deformable Part Modelとその発展Deformable Part Modelとその発展
Deformable Part Modelとその発展
 

Semelhante a Anomaly Detection with GANs

Unsupervised anomaly detection with generative model
Unsupervised anomaly detection with generative modelUnsupervised anomaly detection with generative model
Unsupervised anomaly detection with generative modelTaeKang Woo
 
Anomaly Detection based on Diffusion
Anomaly Detection based on DiffusionAnomaly Detection based on Diffusion
Anomaly Detection based on Diffusionssuserbaebf8
 
지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016
지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016
지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016Taehoon Kim
 
Crash Course on Graphical models
Crash Course on Graphical modelsCrash Course on Graphical models
Crash Course on Graphical modelsJong Wook Kim
 
Anomaly detection practive_using_deep_learning
Anomaly detection practive_using_deep_learningAnomaly detection practive_using_deep_learning
Anomaly detection practive_using_deep_learning도형 임
 
십분딥러닝_7_GANs
십분딥러닝_7_GANs십분딥러닝_7_GANs
십분딥러닝_7_GANsHyunKyu Jeon
 
Flow based generative models
Flow based generative modelsFlow based generative models
Flow based generative models수철 박
 
Lecture 4: Neural Networks I
Lecture 4: Neural Networks ILecture 4: Neural Networks I
Lecture 4: Neural Networks ISang Jun Lee
 
인공신경망
인공신경망인공신경망
인공신경망종열 현
 
투명화 처리로 살펴 본 한층 고급화된 모바일 UX
투명화 처리로 살펴 본 한층 고급화된 모바일 UX투명화 처리로 살펴 본 한층 고급화된 모바일 UX
투명화 처리로 살펴 본 한층 고급화된 모바일 UXDae Yeon Jin
 
GAN - Generative Adversarial Nets
GAN - Generative Adversarial NetsGAN - Generative Adversarial Nets
GAN - Generative Adversarial NetsKyeongUkJang
 
Semantic Image Synthesis with Spatially-Adaptive Normalization(GAUGAN, SPADE)
Semantic Image Synthesis with Spatially-Adaptive Normalization(GAUGAN, SPADE)Semantic Image Synthesis with Spatially-Adaptive Normalization(GAUGAN, SPADE)
Semantic Image Synthesis with Spatially-Adaptive Normalization(GAUGAN, SPADE)jungminchung
 
"Dataset and metrics for predicting local visible differences" Paper Review
"Dataset and metrics for predicting local visible differences" Paper Review"Dataset and metrics for predicting local visible differences" Paper Review
"Dataset and metrics for predicting local visible differences" Paper ReviewLEE HOSEONG
 
[Tf2017] day4 jwkang_pub
[Tf2017] day4 jwkang_pub[Tf2017] day4 jwkang_pub
[Tf2017] day4 jwkang_pubJaewook. Kang
 
캐빈머피 머신러닝 Kevin Murphy Machine Learning Statistic
캐빈머피 머신러닝 Kevin Murphy Machine Learning Statistic캐빈머피 머신러닝 Kevin Murphy Machine Learning Statistic
캐빈머피 머신러닝 Kevin Murphy Machine Learning Statistic용진 조
 
Graph attention network - deep learning paper review
Graph attention network -  deep learning paper reviewGraph attention network -  deep learning paper review
Graph attention network - deep learning paper reviewtaeseon ryu
 
[NDC2016] 신경망은컨텐츠자동생성의꿈을꾸는가
[NDC2016] 신경망은컨텐츠자동생성의꿈을꾸는가[NDC2016] 신경망은컨텐츠자동생성의꿈을꾸는가
[NDC2016] 신경망은컨텐츠자동생성의꿈을꾸는가Hwanhee Kim
 
From maching learning to deep learning
From maching learning to deep learningFrom maching learning to deep learning
From maching learning to deep learningYongdae Kim
 

Semelhante a Anomaly Detection with GANs (20)

Unsupervised anomaly detection with generative model
Unsupervised anomaly detection with generative modelUnsupervised anomaly detection with generative model
Unsupervised anomaly detection with generative model
 
Detecting fake jpeg images
Detecting fake jpeg imagesDetecting fake jpeg images
Detecting fake jpeg images
 
Anomaly Detection based on Diffusion
Anomaly Detection based on DiffusionAnomaly Detection based on Diffusion
Anomaly Detection based on Diffusion
 
지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016
지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016
지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016
 
Crash Course on Graphical models
Crash Course on Graphical modelsCrash Course on Graphical models
Crash Course on Graphical models
 
Anomaly detection practive_using_deep_learning
Anomaly detection practive_using_deep_learningAnomaly detection practive_using_deep_learning
Anomaly detection practive_using_deep_learning
 
십분딥러닝_7_GANs
십분딥러닝_7_GANs십분딥러닝_7_GANs
십분딥러닝_7_GANs
 
Flow based generative models
Flow based generative modelsFlow based generative models
Flow based generative models
 
Lecture 4: Neural Networks I
Lecture 4: Neural Networks ILecture 4: Neural Networks I
Lecture 4: Neural Networks I
 
인공신경망
인공신경망인공신경망
인공신경망
 
투명화 처리로 살펴 본 한층 고급화된 모바일 UX
투명화 처리로 살펴 본 한층 고급화된 모바일 UX투명화 처리로 살펴 본 한층 고급화된 모바일 UX
투명화 처리로 살펴 본 한층 고급화된 모바일 UX
 
Naive ML Overview
Naive ML OverviewNaive ML Overview
Naive ML Overview
 
GAN - Generative Adversarial Nets
GAN - Generative Adversarial NetsGAN - Generative Adversarial Nets
GAN - Generative Adversarial Nets
 
Semantic Image Synthesis with Spatially-Adaptive Normalization(GAUGAN, SPADE)
Semantic Image Synthesis with Spatially-Adaptive Normalization(GAUGAN, SPADE)Semantic Image Synthesis with Spatially-Adaptive Normalization(GAUGAN, SPADE)
Semantic Image Synthesis with Spatially-Adaptive Normalization(GAUGAN, SPADE)
 
"Dataset and metrics for predicting local visible differences" Paper Review
"Dataset and metrics for predicting local visible differences" Paper Review"Dataset and metrics for predicting local visible differences" Paper Review
"Dataset and metrics for predicting local visible differences" Paper Review
 
[Tf2017] day4 jwkang_pub
[Tf2017] day4 jwkang_pub[Tf2017] day4 jwkang_pub
[Tf2017] day4 jwkang_pub
 
캐빈머피 머신러닝 Kevin Murphy Machine Learning Statistic
캐빈머피 머신러닝 Kevin Murphy Machine Learning Statistic캐빈머피 머신러닝 Kevin Murphy Machine Learning Statistic
캐빈머피 머신러닝 Kevin Murphy Machine Learning Statistic
 
Graph attention network - deep learning paper review
Graph attention network -  deep learning paper reviewGraph attention network -  deep learning paper review
Graph attention network - deep learning paper review
 
[NDC2016] 신경망은컨텐츠자동생성의꿈을꾸는가
[NDC2016] 신경망은컨텐츠자동생성의꿈을꾸는가[NDC2016] 신경망은컨텐츠자동생성의꿈을꾸는가
[NDC2016] 신경망은컨텐츠자동생성의꿈을꾸는가
 
From maching learning to deep learning
From maching learning to deep learningFrom maching learning to deep learning
From maching learning to deep learning
 

Mais de 홍배 김

Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...
Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...
Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...홍배 김
 
Gaussian processing
Gaussian processingGaussian processing
Gaussian processing홍배 김
 
Lecture Summary : Camera Projection
Lecture Summary : Camera Projection Lecture Summary : Camera Projection
Lecture Summary : Camera Projection 홍배 김
 
Learning agile and dynamic motor skills for legged robots
Learning agile and dynamic motor skills for legged robotsLearning agile and dynamic motor skills for legged robots
Learning agile and dynamic motor skills for legged robots홍배 김
 
Robotics of Quadruped Robot
Robotics of Quadruped RobotRobotics of Quadruped Robot
Robotics of Quadruped Robot홍배 김
 
Basics of Robotics
Basics of RoboticsBasics of Robotics
Basics of Robotics홍배 김
 
Recurrent Neural Net의 이론과 설명
Recurrent Neural Net의 이론과 설명Recurrent Neural Net의 이론과 설명
Recurrent Neural Net의 이론과 설명홍배 김
 
Convolutional neural networks 이론과 응용
Convolutional neural networks 이론과 응용Convolutional neural networks 이론과 응용
Convolutional neural networks 이론과 응용홍배 김
 
Anomaly detection using deep one class classifier
Anomaly detection using deep one class classifierAnomaly detection using deep one class classifier
Anomaly detection using deep one class classifier홍배 김
 
Optimal real-time landing using DNN
Optimal real-time landing using DNNOptimal real-time landing using DNN
Optimal real-time landing using DNN홍배 김
 
The world of loss function
The world of loss functionThe world of loss function
The world of loss function홍배 김
 
Machine learning applications in aerospace domain
Machine learning applications in aerospace domainMachine learning applications in aerospace domain
Machine learning applications in aerospace domain홍배 김
 
Anomaly Detection and Localization Using GAN and One-Class Classifier
Anomaly Detection and Localization  Using GAN and One-Class ClassifierAnomaly Detection and Localization  Using GAN and One-Class Classifier
Anomaly Detection and Localization Using GAN and One-Class Classifier홍배 김
 
ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...
ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...
ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...홍배 김
 
Brief intro : Invariance and Equivariance
Brief intro : Invariance and EquivarianceBrief intro : Invariance and Equivariance
Brief intro : Invariance and Equivariance홍배 김
 
Focal loss의 응용(Detection & Classification)
Focal loss의 응용(Detection & Classification)Focal loss의 응용(Detection & Classification)
Focal loss의 응용(Detection & Classification)홍배 김
 
Convolution 종류 설명
Convolution 종류 설명Convolution 종류 설명
Convolution 종류 설명홍배 김
 
Learning by association
Learning by associationLearning by association
Learning by association홍배 김
 
Binarized CNN on FPGA
Binarized CNN on FPGABinarized CNN on FPGA
Binarized CNN on FPGA홍배 김
 
Visualizing data using t-SNE
Visualizing data using t-SNEVisualizing data using t-SNE
Visualizing data using t-SNE홍배 김
 

Mais de 홍배 김 (20)

Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...
Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...
Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...
 
Gaussian processing
Gaussian processingGaussian processing
Gaussian processing
 
Lecture Summary : Camera Projection
Lecture Summary : Camera Projection Lecture Summary : Camera Projection
Lecture Summary : Camera Projection
 
Learning agile and dynamic motor skills for legged robots
Learning agile and dynamic motor skills for legged robotsLearning agile and dynamic motor skills for legged robots
Learning agile and dynamic motor skills for legged robots
 
Robotics of Quadruped Robot
Robotics of Quadruped RobotRobotics of Quadruped Robot
Robotics of Quadruped Robot
 
Basics of Robotics
Basics of RoboticsBasics of Robotics
Basics of Robotics
 
Recurrent Neural Net의 이론과 설명
Recurrent Neural Net의 이론과 설명Recurrent Neural Net의 이론과 설명
Recurrent Neural Net의 이론과 설명
 
Convolutional neural networks 이론과 응용
Convolutional neural networks 이론과 응용Convolutional neural networks 이론과 응용
Convolutional neural networks 이론과 응용
 
Anomaly detection using deep one class classifier
Anomaly detection using deep one class classifierAnomaly detection using deep one class classifier
Anomaly detection using deep one class classifier
 
Optimal real-time landing using DNN
Optimal real-time landing using DNNOptimal real-time landing using DNN
Optimal real-time landing using DNN
 
The world of loss function
The world of loss functionThe world of loss function
The world of loss function
 
Machine learning applications in aerospace domain
Machine learning applications in aerospace domainMachine learning applications in aerospace domain
Machine learning applications in aerospace domain
 
Anomaly Detection and Localization Using GAN and One-Class Classifier
Anomaly Detection and Localization  Using GAN and One-Class ClassifierAnomaly Detection and Localization  Using GAN and One-Class Classifier
Anomaly Detection and Localization Using GAN and One-Class Classifier
 
ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...
ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...
ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...
 
Brief intro : Invariance and Equivariance
Brief intro : Invariance and EquivarianceBrief intro : Invariance and Equivariance
Brief intro : Invariance and Equivariance
 
Focal loss의 응용(Detection & Classification)
Focal loss의 응용(Detection & Classification)Focal loss의 응용(Detection & Classification)
Focal loss의 응용(Detection & Classification)
 
Convolution 종류 설명
Convolution 종류 설명Convolution 종류 설명
Convolution 종류 설명
 
Learning by association
Learning by associationLearning by association
Learning by association
 
Binarized CNN on FPGA
Binarized CNN on FPGABinarized CNN on FPGA
Binarized CNN on FPGA
 
Visualizing data using t-SNE
Visualizing data using t-SNEVisualizing data using t-SNE
Visualizing data using t-SNE
 

Anomaly Detection with GANs

  • 1. Anomaly Detection with GANs https://arxiv.org/abs/1703.05921 Postech 이도엽씨가 구현한 Tensorflow 코드 https://github.com/LeeDoYup/AnoGAN
  • 2. 처음 접하는 분들을 위하여 우선 Generative Adversarial Network부터 간단히 알아보자
  • 3. 판별모델(discriminative model)이 아닌 생성모델(generative model) ! 판별모델 생성모델 • 많아 봐왔던 일반적인 기계학습은 판별모델(class별 확률계산) - class를 나누기 위해 선(decision boundary)을 찾는다 ! • 생성모델은 판별하는 것이 아니라 class별 범위(distribution)를 찾는다 !  GAN, VAE Generative Adversarial Network 이란 ?
  • 4. 왜 이런 어려운 모델까지 ? Curse of Dimensionality • In many applications, we simply vectorize an image or image patch • 256 x 256 image converts to a 65,536-dimensional vector. • Images, therefore, are typically very high-dimensional data • Affects the convergence of any learning algorithm. • In some applications, we know that there are only a few variables, for e.g., face pose and illumination. • Data lie on some low-dimensional subspace/manifold in the high-dimensional space.  주어진 data set의 축약된 모델(Manifold)을 찾아보자 !
  • 5. 특징이 서로 얽혀 있어 해석이 불가능한 Physical space에서 해석이 용이하도록 서로 독립적인 Eigen space로 변환하는 것 처럼 영향이 매우 작으므로 무시 Manifold Assumption
  • 6. • Data lie approximately on a manifold of much lower dimension than the input space • Mapping between two space is unique & reversible Manifold Assumption
  • 7. Manifold Assumption - The curse of dimensionality can be mitigated under the manifold assumption. - Linear dimensionality reduction techniques like PCA have been widely used in the vision community. - Recent trend is towards non-linear techniques that recover the intrinsic parameterization (pose, emotion, illumination, etc  mode).
  • 8. GAN이란 ? • GAN: Generative Adversarial Networks [Goodfellow+,2014] – Generator (G)와 Discriminator (D)를 서로 경쟁시켜서 생성 정확도의 향상을 도모하는 모델
  • 9. GAN이란? GAN: Generative Adversarial Networks [Goodfellow+,2014] • Generator (G)와 Discriminator (D)를 서로 경쟁시켜서 생성 정확도의 향상을 도모하는 모델 • G : 생성용 벡터 z로부터 데이터를 생성 • D : 대상 데이터가 진짜(데이터 세트) 인가 가짜(G에 의해 생성)를 식별 데이터셋의 데이터를 「진짜」로 식별 생성된 데이터를「위조」로 식별
  • 10. D(Image) : Discriminator에 의해 계산된 “image가 real일 확률” Discriminator가 「진짜」에 대해서는 “1”에 가깝도록 Generator가 생성한 「위조」에 대해서는 “0”에 가깝도록  D(x)  1, D(G(z))  0 이 되도록 log(1-G(x)) G(x) log(x) x
  • 11. 2 개의 모델을 만들어 경쟁시킴으로써 데이터의 분포를 학습시키는 비지도학습 프레임 워크 : Generator에 의해 예측된 데이터 분포
  • 13. 이제 본격적으로 Unsupervised Anomaly Detection with GANs to Guide Marker Discovery
  • 14. Anomaly detection : 정상치에서 벗어난 관측치들을 detect  One-class classification 혹은 one-class description Anomaly detection 문제점 : 보통 현실에서는 비정상 관측치가 거의 없는 경우가 많기 때문 통상 제조 공정에서 관리되는 품질 수준이 ppm단위 이런 경우에는 정상 관측치를 모델링함으로서 그 모델에서 벗어나는 정도를 기반으로 fault detection
  • 15. 이 연구에서는 아래 그림처럼 정상 data만으로 학습시킨 GAN 모델를 이용하여 Query data에 대하여 정상여부는 물론 비정상 시 비정상 영역을 찾아내고자 함.
  • 16. 1. 정상 data를 이용하여 Generator & Discriminator의 훈련 - Deep convolutional generative adversarial network을 이용하여 latent space(z)로 부터 Generator를 이용하여 생성된 image와 Real image를 구별하도록 Discriminator를 훈련  정상 data의 latent space(z) 분포를 학습 2. 비정상 data여부와 비정상 영역 파악 - 훈련된 Generator & Discriminator의 parameter를 고정한 채 Query image에 대한 latent space(z)로의 mapping 작업을 수행 훈련된 정상 data의 경우, 기학습된 정상 data의 latent space(z) 로 mapping이 되지만, 비정상 data의 경우 벗어남  cost function의 오차가 발생 Anomaly Detection은 다음과 같이 2단계로 이루어짐
  • 17. 1. GAN을 이용하여 정상 data 모델링하기 : 정상 data의 generative model(distribution)을 GAN을 이용하여 학습 정상 𝑑𝑎𝑡𝑎 𝐼 𝑚, with m = 1,2,.....,M, where 𝐼 𝑚 ∈ 𝑅 𝑎𝑥𝑏 임의의 위치에서 랜덤하게 cxc크기의 K 2-D image patches를 추출 x = 𝑥 𝑘,𝑚 ∈ ℵ with k = 1,2,……,K. D and G are simultaneously optimized through the following two- player minimax game with value function V (G,D) The discriminator is trained to maximize the probability of assigning real training examples the “real” and samples from 𝑝 𝑔the “fake” label
  • 18. 2. Query data의 latent space Mapping Query image x가 주어질 경우, 이와 가장 유사한 가상 image인 G(z) 에 해당하는 latent space상의 점 z을 찾는다. x 와 G(z)의 유사여부는 query image가 generator의 훈련시 사용된 정상 data의 분포 𝑝 𝑔를 어느 정도 따르느냐에 의해 결정 z을 찾기 위하여 , latent space distribution Z에서 랜덤하게 샘플된 z1 을 기훈련된 generator에 입력하여 얻은 출력 G(z1)와 x의 차(loss ft’n)를 최 소화하도록 backpropagation을 통하여 latent space의 점z2로 update
  • 19. z 정상 image의 Latent space(z)가 1차원이라고 가정하고 Z은 다음과 같은 분포로 가정하면 𝜇 𝑧 z𝜇 𝑧 Query image에 대한 latent space(z) mapping은 i) 임의의 값 𝑧1에서 시작하여 loss ft’n을 최소화하도록 update ii) 주어진 Γ번째 iteration 후 𝑧Γ이 allowable range안에 들어왔는지 여부에 때라 정상, 비정상을 구분 𝑧1 𝑧2 𝑧Γ Allowable range
  • 20. • Overall loss or Anomaly score: • Anomaly score consists of two parts: • Residual Loss - visual similarity • Discrimination Loss - enforces the generated image to lie on the manifold Query Image의 Mapping에 대한 Loss function 정의
  • 21. Improved discrimination loss based on feature matching • f(.) – output of intermediate layer of the discriminator • It is some statistics of an input image This approach utilizes the trained discriminator not as classifier but as a feature extractor
  • 22. 3. Anomaly Detection Anomaly score : query image x가 정상 image에 얼마나 부합하는지 여부 R(x) : Γ번의 backpropagation후 Residual loss D(x) : Γ번의 backpropagation후 Discrimination Loss 비정상 image : A(x) is large 정상 image : A(x) is small 𝑥 𝑅 = 𝑥 − 𝐺 𝑧Γ Residual error : image내의 비정상 영역을 나타냄
  • 23. 4. Experiments 실험대상은 망막층을 3차원적으로 관측하는 빛간섭단층촬영(OCT) 영상 • Data, Data Selection and Preprocessing i) Training sets : - 2D image patches extracted from 270 clinical OCT volumes of healthy subjects - The gray values were normalized to range from -1 to 1. - Extracted in total 1,000,000 2D training patches with an image resolution of 64x64 pixels at randomly sampled positions.
  • 24. ii) Testing sets : - patches were extracted from 10 additional healthy cases and 10 pathological cases, which contained retinal fluid - Test set in total consisted of 8,192 image patches and comprised normal and pathological samples
  • 25. iii) Model description - Adopt DCGAN architecture that resulted in stable GAN training on images of sizes 64x64 pixels. - Utilized intermediate representations with 512-256-128-64 channels (instead of 1024-512-256-128) - Discrimination loss : Feature representations of the last convolution layer of the discriminator was used - Training was performed for 20 epochs utilizing Adam optimizer. - Ran 500 backpropagation steps for the mapping of new images to the latent space. - Used λ= 0.1 in loss function
  • 26. i) Generative capability of the DCGAN 5. Experiments Given image Generated image Residual overlay Pixel-level annotations of retinal fluid Normal image Anomalous image
  • 27. ii) Detection performance ROC curves Distribution of the residual score(c) and of the discrimination score(d) Latent space에서 정상 data(trained data 및 test data 중 정상)간의 분포는 유사하나 Test data 중 비정상과는 확실한 차이를 나타냄