You are on page 1of 8

인공지능기술의이해와적용 Auto-encoder

 기본적인 오토인코더 형태 : x (입력), z (잠재변수, 코드), x’ (출력)


 손실의 정의? 입력값 자체가 목표값임. x와 x’의 차이.
https://medium.com/@sorenlind/a-deep-convolutional-denoising-
autoencoder-for-image-classification-26c777d3b88e

강의 Review:
Auto-encoder, GAN앞부분

x x’
z

중앙대학교 소프트웨어학부 신재진

기본적인 오토인코더 결과
(손실발생)

-1- -2- 최건호, “파이토치 첫걸음” 9장, 한빛미디어, 2018

논문: Ian Goodfellow et al, "Generative


Auto-encoder Semantic
segmenation
GAN Adversarial Networks", NIPS 2014

 오토인코더의 활용 Standford, CS231N Lectures


 GAN (대립쌍 생성망, Generative adversarial network)
 노이즈 제거 모델  Goodfellow et al(2014)이 발표
 시맨틱 세그멘테이션 (Semantic  주어진 학습 데이터의 특성을 잘 만족하는 데이터 자체를 생성하는 모델
segmenation) 등 : U-Net
 그림2: 해당 픽셀이 세포의 경계선
 생성 모듈(generator)과 판별 모듈(discriminator)로 구성
인지 세포 내부인지를 결과  화폐 위조범과 경찰관의 관계와 학습
Fig. 1. U-net architecture (example for 32x32 pixels in the
 경찰관 : 위폐 판별을 위한 학습
lowest resolution). Each blue box corresponds to a multi-
channel feature map. The number of channels is denoted
 위조범 : 경찰을 속일 만큼 정교한 위폐를 만들기 위해 학습
on top of the box. The x-y-size is provided at the lower left
edge of the box. White boxes represent copied feature
maps. The arrows denote the different operations.

Fig. 2. Overlap-tile strategy for seamless


segmentation of arbitrary large images (here
segmentation of neuronal structures in EM
stacks). Prediction of the segmentation in the
yellow area, requires image data within the blue
area as input. Missing input data is extrapolated
by mirroring
Semantic segmenation
Ronneberger et al, “U-Net: Convolutional Networks for 이건명, "인공지능 - 튜링 테스트에서
-3- Biomedical Image Segmentation”, arXiv1505.04597 -4- 딥러닝까지“, 생능출판사, 2018
GAN 학습 GAN 목적함수
 생성 모듈과 판별 모듈의 동시 학습  판별 모듈이 최대화(Max)시킬 목적 함수 => 경사상승법
 𝐷(𝑥)는 커지고, 𝐷(𝐺 𝑧 )는 작아지도록 학습하므로,,,,
 생성 모듈 𝐺
 "학습데이터를 진짜로 판정 비율"의 로그의 평균 + "생성데이터를 가짜로 판정 비율"의 로그의 평균
 판별 모듈을 속이도록 학습
 생성 모듈이 생성한 데이터 𝐺 𝑧 에 대해 판별 모듈이 큰 값을 주도록 학습
즉, 잡음 𝑧 ~𝑃 으로 부터 생성한 데이터 𝐺 𝑧 에 대해 𝐷(𝐺 𝑧 )이 커지도록 학습 D=1일때 로그값은 최대치 0 D(G)=0 일 때 로그값은 최대값 0
 판별 모듈 𝐷
 생성된 데이터(가짜 데이터)를 잘 식별하도록 학습  생성 모듈이 최소화(Min)시킬 목적 함수 => 경사하강법
 학습 데이터 𝑥 ~ 𝑃 에 대한 판별 모듈의 출력값 𝐷(𝑥)는 커지고,  𝐷(𝐺 𝑧 )이 커지도록 학습하므로,,,, 즉, 1 − 𝐷(𝐺 𝑧 ) 이 작아지도록 학습하므로,,,,
생성된 데이터 𝐺(𝑧)에 대한 판별 모듈의 출력값 𝐷(𝐺 𝑧 )는 작아지도록 학습  "생성데이터가 가짜로 판정될 비율"의 로그의 평균
 두 명이 하는 게임(two-player game)과 유사

D(G)=1 일 때 로그값은 최소인 -∞


 𝑥~𝑃 란 : 학습 데이터를 의미함. 학습 데이터의 분포로 부터의 데이터란 뜻.
※ D(G)=1의 의미: 생성데이터(가짜)가 판별모듈에 의해 진짜로 판정됨
 𝑧 ~𝑃 란 : 잡음을 의미함. 잡음 z의 분포로 부터 생성된 잡음이란 뜻.

이건명, "인공지능 - 튜링 테스트에서


-5- 딥러닝까지“, 생능출판사, 2018 -6-

DCGAN: GAN학습시 팁 DCGAN


 안정적인 Deep Convolutional GAN을 위한 아키텍처 지침  DCGAN(딥 컨볼루션 대립쌍 생성망)
 풀링 연산를 합성곱 연산 (판별자 망) 및 전치 합성곱 연산(생성자 망)으로 대  생성 모듈
체한다.
 생성자 망와 판별자 망 모두에서 배치 정규화을 사용한다.
 완전연결(FC) 층을 제거한다.
 생성자 망에는 마지막에 사용되는 tanh함수외에는 모든 층에 대해 ReLU 활
성화 함수를 사용한다.
 판별자 망에서 모든 층에 대해 LeakyReLU 활성화 함수를 사용한다.

Radford, “Unsupervised representation learning with deep


Radford, “Unsupervised representation learning with deep convolutional generative adversarial networks”, arXiv 1511.06434 이건명, "인공지능 - 튜링 테스트에서
-7- convolutional generative adversarial networks”, arXiv 1511.06434 -8- 딥러닝까지“, 생능출판사, 2018
DCGAN DCGAN
 디컨볼루션 (deconvolution) https://github.com/vdumoulin/conv_arithmetic  판별 모듈
 입력보다 확장된 출력 생성
컨볼루션 디컨볼루션

필터크기
3 3

Radford, “Unsupervised representation learning with deep


convolutional generative adversarial networks”, arXiv 1511.06434 이건명, "인공지능 - 튜링 테스트에서
-9- Image: Shyam Krishna Khadka - 10 - 딥러닝까지“, 생능출판사, 2018

DCGAN
 잡음 벡터의 연산
 잡음(noise)을 이미지를 코딩하는 은닉변수(latent variable)로 해석 가능
 유사한 이미지를 생성하는 잡음 벡터들을 선택
 잡음 벡터들의 연산을 통해, 특정 특징의 추가 및 삭제 가능
(계속)  ‘미소짓는 여성'들의 잡음 벡터 𝒛 – ‘무표정한 여성'들의 잡음 벡터 𝒛
표정한 남성'의 잡음 벡터 𝒛  ‘미소짓는 남성‘의 잡음 벡터 𝒛
+ ‘무

GAN (대립쌍 생성망) 𝒛 ←𝒛 − 𝒛 + 𝒛

중앙대학교 소프트웨어학부 신재진

Radford, “Unsupervised representation learning with deep convolutional generative 이건명, "인공지능 - 튜링 테스트에
- 11 - adversarial networks”, arXiv 1511.06434 - 12 - 서 딥러닝까지“, 생능출판사, 2018
DCGAN DCGAN
 잡음 벡터의 연산
 잡음(noise)을 이미지를 코딩하는 은닉변수(latent variable)로 해석 가능
 유사한 이미지를 생성하는 잡음 벡터들을 선택
 잡음 벡터들의 연산을 통해, 특정 특징의 추가 및 삭제 가능

Radford, “Unsupervised representation learning with deep convolutional generative 이건명, "인공지능 - 튜링 테스트에 Radford, “Unsupervised representation learning with deep
adversarial networks”, arXiv 1511.06434 - 13 - 서 딥러닝까지“, 생능출판사, 2018 - 14 - convolutional generative adversarial networks”, arXiv 1511.06434

BiGAN BiGAN
 양방향 대립쌍 생성망 (Bidirectional GAN, BiGAN)  BiGAN의 학습에서 사용하는 목적함수 Jeff Donahue et al, "Adversarial Feature
Learning", arxiv-1605.09782

 데이터의 역 사상(inverse mapping)을 함께 고려한 대립쌍 생성  인코더


 판별 모듈에서 데이터 공간의 벡터와 은닉공간의 벡터를 함께 사용  데이터 𝒙를 은닉 공간의 𝐸(𝒙)로 사상(mapping)
 판별 모듈
 은닉공간 벡터와 데이터를 함께 입력으로 받음
 진위(眞僞)를 판정

 목적함수
Jeff Donahue et al, "Adversarial Feature
- 15 - Learning", arxiv-1605.09782 - 16 -
BiGAN BiGAN
 BiGAN의 학습 Jeff Donahue et al, "Adversarial Feature
Learning", arxiv-1605.09782  BiGAN을 이용한 인코딩과 데이터 생성의 예
 목적 함수의 최대화를 위해 판별 모듈 학습
 목적 함수의 최대화를 위해 인코더 학습
 목적 함수의 최소화를 위해 생성 모듈 학습

x와 G(E(x))가 비슷. 인코더


E가 데이터에 대한 은닉공
간의 값을 효과적으로 찾
아냄을 의미. 이 학습된 인
코더는 데이터로부터 특징
을 찾아내는 특징추출기로
활용가능.

Jeff Donahue et al, "Adversarial Feature


- 17 - - 18 - Learning", arxiv-1605.09782

SRGAN (Super-resolution GAN) 텍스트-이미지 합성위한 GAN


(MSE에 최적화) (시각 인식 품질에 최적화)

Christian Ledig, et al, "Photo-Realistic Single Image Super- Scott Reed, et al, "Generative Adversarial Text to Image
- 19 - Resolution Using a GAN", arxiv-1609.04802 - 20 - Synthesis", arxiv-1605.05396
Pix2Pix (GAN) Pix2Pix (GAN)

(DCGAN구조 +
U-Net의 skip connections)
http://cs231n.stanford.edu/reports/2017/pdfs/403.pdf Phillip Isola, et al, "Image-to-Image Translation with Conditional Phillip Isola, et al, "Image-to-Image Translation with Conditional
- 21 - Adversarial Networks", arxiv-1611.07004 - 22 - Adversarial Networks", arxiv-1611.07004

Masood, et al, "Deepfakes Generation and Detection: State-of-the-art,

CycleGAN Deepfake
open challenges, countermeasures, and way forward", arXiv2103.00484

Tensorflow/Keras 같은 최신 도구의 가용성, GAN의 급속한 발전, 소셜 미디어


AV 콘텐츠에 쉬운 접근 때문에, 허위 정보 전파, 리벤지 포르노, 금융 사기, 정
 특징  카테고리 부 기능 방해위해, deepfake생성이 가능하게 됨.
 Unpaired 훈련데이터 사용

 응용들
 Collection style transfer (컬렉션 스
타일 전이)
 Object transfiguration (개체 변형)
 Season transfer (계절 전이)
 Photo generation from paintings
(그림에서 사진 생성)  역사

Jun-Yan Zhu, et al, "Unpaired Image-to-Image Translation


- 23 - using Cycle-Consistent Adversarial Networks", arxiv-1703.10593 - 24 -
Masood, et al, "Deepfakes Generation and Detection: State-of-the-art, Masood, et al, "Deepfakes Generation and Detection: State-of-the-art,

Deepfake Deepfake
open challenges, countermeasures, and way forward", arXiv2103.00484 open challenges, countermeasures, and way forward", arXiv2103.00484

 Face-swap  Puppet-master (꼭두각시-장인)


Creation of a Deepfake
원래 배우의 얼굴 표정, 눈, 머리 움직임 등을 다른 사람에게 전이하는 얼굴 재
using an auto-encoder 연 기반의 deepfake
and decoder. The same
encoder-decoder pair is
used to learn the latent
features of the faces
during training, while
during generation
decoders are swapped,
such that latent face A is
subjected to decoder B to
generate face A with the
features of face B

- 25 - - 26 -

Masood, et al, "Deepfakes Generation and Detection: State-of-the-art, Masood, et al, "Deepfakes Generation and Detection: State-of-the-art,

Deepfake Deepfake
open challenges, countermeasures, and way forward", arXiv2103.00484 open challenges, countermeasures, and way forward", arXiv2103.00484

 Lip-syncing  합성얼굴의 해상도


A visual representation of lip-
syncing of an existing video to
an arbitrary audio clip

Increasingly improving improvements in the quality of synthetic faces, as


generated by variations on GANs.

- 27 - - 28 -
Masood, et al, "Deepfakes Generation and Detection: State-of-the-art, Masood, et al, "Deepfakes Generation and Detection: State-of-the-art,

Deepfake Deepfake
open challenges, countermeasures, and way forward", arXiv2103.00484 open challenges, countermeasures, and way forward", arXiv2103.00484

 조작된 얼굴들  Deepfake 검출법 카테고리


Examples of different face
manipulations: original sample (Input)
and manipulated samples

The red color shows Face-Swap detection approaches, purple for Face-Reenactment,
Orange for lip-syncing, Blue for facial image synthesis, and pink for facial attribute
manipulation detection techniques, where * shows deep-learning based approaches
- 29 - - 30 -

You might also like