SlideShare una empresa de Scribd logo
1 de 38
Show and Tell :
A Neural Image Caption Generator
참고자료
1. “Show and Tell: A Neural Image Caption Generator”, O.Vinyals, A.Toshev,
S.Bengio, D.Erhan
2. CV勉強会@関東「CVPR2015読み会」発表資料, 皆川卓也
3. Lecture Note “Recurrent Neural Networks”, CS231n, Andrej Karpathy
2016. 7.
김홍배
한국항공우주연구원
개요
 1장의 스틸사진으로 부터 설명문(Caption)을 생성
 자동번역등에 사용되는 Recurrent Neural Networks (RNN)에 Deep
Convolutional Neural Networks에서 생성한 이미지의 특징벡터를
입력
 Neural Image Caption (NIC)
 종래방법을 크게 상회하는 정확도
Convolutional Neural Networks (CNN)
 CNN이 「학습데이터로부터 이미지 인식에 효과적인 특징들을
자동으로 학습하는 네트워크」 라는 것을 이해하고 있어야 함
 GoogLeNet을 개량한 아래 논문을 사용
 S.Ioffe and C.Szegedy, “Batch Normalization: Accelerating Deep
Network Training by Reducing Internal Covariate Shift”, arXiv
2015
Reccurent Neural Networks (RNN)
・・・・・・
 시계열 데이터등의 「연속적 데이터」를 취급하기 위한 뉴럴넷
 음성인식, 자동번역, 영상인식등에 활용
 예측대상의 dimension이 가변
 시간t의 은익층 출력이 시간t+1의 은익층 입력으로 됨
출력
은익층
입력
Reccurent Neural Networks (RNN)
 전개하면 정적인 네트워크로 표현됨.
・・・・・・
・・・・・・
・・・・・・
t-1 t t+1
출력
은익층
입력
훈련데이터 훈련데이터 훈련데이터
 일반적인 오차 역전파법으로 변수를 학습시킬 수 있다.
Long-Short Term Memory (LSTM)
 RNN은 계열이 길어지면 계층이 깊어지므로 전파된 오차구배가
발산 또는 소멸됨.
 Gradient Vanishing or Explosion
 각 데이터의 입출력 및 과거 데이터의 사용/미사용을 제어함으로써,
긴 계열을 취급가능.
Long-Short Term Memory (LSTM)
depth
time
RNN
LSTM
tt-1
l
l-1
ℎ 𝑡−1
𝑙
ℎ 𝑡
𝑙−1
ℎ 𝑡
𝑙
ℎ 𝑡
𝑙
Long-Short Term Memory (LSTM)
 RNN과 LSTM의 수식적 차이
f
x
i g
x
+
tanh
o
x
f
x
i g
x
+
tanh
o
x
@ time t
ht-1
xt xt+1
ht ht+1
ct-1
Cell state
ct ct+1
Long-Short Term Memory (LSTM)
@ time t+1
 LSTM의 각각의 Cell은 다음과 같으며, 여러 개의 gate로 구성
입력 또는 하부층 출력
전시점(t-1)
cell 데이터
전시점(t-1)
출력
출력
f
Forget Gate
 과거 계열 데이터의 사용/미사용을 제어
𝑓𝑡 = 𝜎(𝑊𝑓 𝑥 𝑥𝑡 + 𝑊 𝑓h ht-1
)
x
Long-Short Term Memory (LSTM)
ct-1
ht-1
xt
- Sigmoid ft’n의 출력값은 0 ~ 1 사이에 존재
- ft가 “1”이면 이전 State 값을 유지
- ft가 “0”이면 이전 State 값을 삭제
Cell state
학습하는 변수
입력 또는 하부층 출력
전시점(t-1)
cell 데이터
전시점(t-1)
출력
Input Gate
 입력데이터의 사용/미사용을 제어
Long-Short Term Memory (LSTM)
i g
x
f
gt= tanh(Wgx x𝑡 + 𝑊ghht-1)
xct-1
ht-1
xt - gt 는 Hyperbolic tangent ft’n의 출력값이므로 -1 ~ 1 사이에 존재
- it는 Sigmoid ft’n의 출력값이므로 0~1 사이에 존재
Cell state
+
it= σ(Wix x𝑡 + 𝑊ihht-1)
yt = gt⨀it
y
학습하는 변수
ht-1
xt
ct
현시점(t)
cell 데이터
Output Gate
 출력데이터의 사용/미사용을 제어
Long-Short Term Memory (LSTM)
x
f
ot = σ(Wox x𝑡 + 𝑊ohht-1)
xct-1
Cell state
+
ht = ot⨀tanh(ct)
y
학습하는 변수
tanh
o x
ht
ht-1
xt
ct
현시점(t)
출력
Long-Short Term Memory (LSTM)
i
f
o
g
sigmoid
sigmoid
tanh
sigmoid
4n x 2n 4n 4*n
nx1
nx1
Wix Wih
Wfx Wfh
Wox Woh
Wgx Wgh
xt
ℎ 𝑡−1
𝑙
2n
 Matrix와 Vector 형태로 간략화 시키면
LSTM weight matrix
to be identified
하층 출력 또는
입력벡터 (x)
전시점(t-1)
출력벡터
Neural Image Caption (NIC)
 사진(I)를 입력으로 주었을 때
 정답 “설명문“, S를 만들어 낼 가능성을 최대가 되도록
 학습데이터(I, S)를 이용하여
 넷의 변수(w)들을 찾아내는 과정
설명문
w∗ = argmin 𝐼,𝑆 log ‫(݌‬S|I;w)
w 사진, 변수
확률
손실함수
전체 학습데이터 셋에 대한 손실함수
손실함수를 최소화 시키는 변수, w*를 구하는 작업
Neural Image Caption (NIC)
 사진으로부터 설명문 생성
𝑝 𝑆 𝐼; 𝑤 =
𝑡=0
𝑁
𝑝 𝑆𝑡 𝐼, 𝑆0, 𝑆1,···, 𝑆𝑡−1; 𝑤
단어수
각 단어는 그전 단어열의 영향을 받는다.
𝑆 ={𝑆0, 𝑆1, ⋯}
단어, 따라서 설명문 S는 길이가 변하는 계열데이터
Neural Image Caption (NIC)
 사진으로부터 설명문 생성
𝑝 𝑆 𝐼; 𝑤 =
𝑡=0
𝑁
𝑝 𝑆𝑡 𝐼, 𝑆0, 𝑆1,···, 𝑆𝑡−1; 𝑤
학습 데이터 셋(I,S)로 부터 훈련을 통해 찾아내는 변수
ht-1
xt
단어 @ t
Neural Image Caption (NIC)
St
L
S
T
M
WeSt
입력 @ t
출력@t
Pt+1(St+1)=softmax(ℎ 𝑡 )
 LSTM based Sentence Generator의 기본 구조
ℎ 𝑡
: 단어별 확률적 분포를 계산
ht
log ‫(݌‬St+1) : 손실함수 계산
: word embedding 과정
출력@t-1
17
Neural Image Caption (NIC)
 Word Embedding
일반적으로 “one hot“ vector형태로 단어를 나타내는데,
단어들로 구성된 Dictionary의 크기가 바뀌기 쉬움
이경우 LSTM의 모델링등에 어려움이 있음
이에 따라 가변의 “one hot“ vector형태를 고정된 길이의
Vector형태로 변형시키는 과정이 필요
dog
0010000000
cat
one hot vector
representation
0000001000
Word embedding vector
representation
dog
0.10.30.20.10.20.3
cat
we
0.20.10.20.20.10.1
xtSt
18
Neural Image Caption (NIC)
 손실함수
For 𝑦_𝑖 = 1 𝑐𝑎𝑠𝑒 J(w)=-log𝑦𝑖
𝑦𝑖
1
J(w)
As 𝑦𝑖 approaches to 1,
J(w) becomes 0
J(w)=-∑𝑦_𝑖•log𝑦𝑖
y : 분류기에서 추정한 확률값
y_ : 정답
Cross entropy로 정의함
Neural Image Caption (NIC)
Neural Image Caption (NIC)
사진의 특징벡터를
Deep CNN에서
가져움
LSTM으로최초의
입력이됨(𝒙−𝟏)
Neural Image Caption (NIC)
단어𝑺 𝟎을입력
다음 단어가
𝑺 𝟏일확률
Neural Image Caption (NIC)
h 𝟎, c𝟎
NIC의 학습과정
ImageNet+ Drop out
으로 Pretraining
랜던하게변수를초기화
NIC의 학습과정
 학습용 사진과 설명문 셋
학습데이터
NIC의 학습과정
예측확률
손실함수
학습데이터
오차
역전파
NIC의 학습과정
손실함수
NIC로 예측 (Sampling)
DeepCNN에서특징
벡터를 가져옴
사진이 주어짐
SpecialStart Word
가장 확률이 높은
단어 𝑺 𝟏을선택
NIC로 예측 (Sampling)
선택된 단어
𝑺 𝟏을입력
end- of- sentence
token이 나타날때
까지 계속
NIC로 예측 (Sampling)
NIC로 예측 (BeamSearch)
확률이 높은 k개
의 단어를 유지
확률이 높은 k개
의 문장을 유지
K개의단어를입력
NIC로 예측 (BeamSearch)
NIC로 예측(BeamSearch)
확률이 높은 k개
의 문장을 유지
K개의단어를입력
이하에서는
BeamSearch를 이용
Dataset
 실험에 사용된 데이터 셋
실험결과
 3개의 지표로 MSCOCO 데이터 셋에 대한 정량평가
 사람이 평가한 성능에 근접한 결과를 내는 경우도 있음
다른 방법과의 비교
 기존 방법에 비해 대폭적인 정확도 개선
상위 N개의 문장열
4
 동일한 사진에 대하여 다른 표현을 얻어냄
 학습 데이터에는 없는 새로운 표현이 만들어짐
Ranking Results
결론
 Deep CNN과 RNN을 사용해서 사진으로부터
설명문을 만들어내는 방법을 제안
1개의 네트웍으로 오차 역전파로 변수를 학습
RNN에는 LSTM을 사용하여 긴 문장에서도 학습시
에 전파되는 오차가 발산하지 않음.
종래에 비하여 대폭적 정확도 개선

Más contenido relacionado

La actualidad más candente

Deep Learning Into Advance - 1. Image, ConvNet
Deep Learning Into Advance - 1. Image, ConvNetDeep Learning Into Advance - 1. Image, ConvNet
Deep Learning Into Advance - 1. Image, ConvNetHyojun Kim
 
인공신경망
인공신경망인공신경망
인공신경망종열 현
 
Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...
Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...
Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...Haezoom Inc.
 
텐서플로우로 배우는 딥러닝
텐서플로우로 배우는 딥러닝텐서플로우로 배우는 딥러닝
텐서플로우로 배우는 딥러닝찬웅 주
 
Denoising auto encoders(d a)
Denoising auto encoders(d a)Denoising auto encoders(d a)
Denoising auto encoders(d a)Tae Young Lee
 
밑바닥부터 시작하는딥러닝 8장
밑바닥부터 시작하는딥러닝 8장밑바닥부터 시작하는딥러닝 8장
밑바닥부터 시작하는딥러닝 8장Sunggon Song
 
A Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding AutoencoderA Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding AutoencoderLee Seungeun
 
Image Deep Learning 실무적용
Image Deep Learning 실무적용Image Deep Learning 실무적용
Image Deep Learning 실무적용Youngjae Kim
 
MNIST for ML beginners
MNIST for ML beginnersMNIST for ML beginners
MNIST for ML beginners홍배 김
 
Variational inference intro. (korean ver.)
Variational inference intro. (korean ver.)Variational inference intro. (korean ver.)
Variational inference intro. (korean ver.)Kiho Hong
 
Rnn개념정리
Rnn개념정리Rnn개념정리
Rnn개념정리종현 최
 
Attention is all you need 설명
Attention is all you need 설명Attention is all you need 설명
Attention is all you need 설명Junho Lee
 
03.12 cnn backpropagation
03.12 cnn backpropagation03.12 cnn backpropagation
03.12 cnn backpropagationDea-hwan Ki
 
keras 빨리 훑어보기(intro)
keras 빨리 훑어보기(intro)keras 빨리 훑어보기(intro)
keras 빨리 훑어보기(intro)beom kyun choi
 
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...홍배 김
 
Attention is all you need
Attention is all you needAttention is all you need
Attention is all you needHoon Heo
 
Learning by association
Learning by associationLearning by association
Learning by association홍배 김
 
Ai 그까이거
Ai 그까이거Ai 그까이거
Ai 그까이거도형 임
 
Normalization 방법
Normalization 방법 Normalization 방법
Normalization 방법 홍배 김
 
Visualizing data using t-SNE
Visualizing data using t-SNEVisualizing data using t-SNE
Visualizing data using t-SNE홍배 김
 

La actualidad más candente (20)

Deep Learning Into Advance - 1. Image, ConvNet
Deep Learning Into Advance - 1. Image, ConvNetDeep Learning Into Advance - 1. Image, ConvNet
Deep Learning Into Advance - 1. Image, ConvNet
 
인공신경망
인공신경망인공신경망
인공신경망
 
Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...
Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...
Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...
 
텐서플로우로 배우는 딥러닝
텐서플로우로 배우는 딥러닝텐서플로우로 배우는 딥러닝
텐서플로우로 배우는 딥러닝
 
Denoising auto encoders(d a)
Denoising auto encoders(d a)Denoising auto encoders(d a)
Denoising auto encoders(d a)
 
밑바닥부터 시작하는딥러닝 8장
밑바닥부터 시작하는딥러닝 8장밑바닥부터 시작하는딥러닝 8장
밑바닥부터 시작하는딥러닝 8장
 
A Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding AutoencoderA Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding Autoencoder
 
Image Deep Learning 실무적용
Image Deep Learning 실무적용Image Deep Learning 실무적용
Image Deep Learning 실무적용
 
MNIST for ML beginners
MNIST for ML beginnersMNIST for ML beginners
MNIST for ML beginners
 
Variational inference intro. (korean ver.)
Variational inference intro. (korean ver.)Variational inference intro. (korean ver.)
Variational inference intro. (korean ver.)
 
Rnn개념정리
Rnn개념정리Rnn개념정리
Rnn개념정리
 
Attention is all you need 설명
Attention is all you need 설명Attention is all you need 설명
Attention is all you need 설명
 
03.12 cnn backpropagation
03.12 cnn backpropagation03.12 cnn backpropagation
03.12 cnn backpropagation
 
keras 빨리 훑어보기(intro)
keras 빨리 훑어보기(intro)keras 빨리 훑어보기(intro)
keras 빨리 훑어보기(intro)
 
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...
 
Attention is all you need
Attention is all you needAttention is all you need
Attention is all you need
 
Learning by association
Learning by associationLearning by association
Learning by association
 
Ai 그까이거
Ai 그까이거Ai 그까이거
Ai 그까이거
 
Normalization 방법
Normalization 방법 Normalization 방법
Normalization 방법
 
Visualizing data using t-SNE
Visualizing data using t-SNEVisualizing data using t-SNE
Visualizing data using t-SNE
 

Destacado

Meta-Learning with Memory Augmented Neural Networks
Meta-Learning with Memory Augmented Neural NetworksMeta-Learning with Memory Augmented Neural Networks
Meta-Learning with Memory Augmented Neural Networks홍배 김
 
Learning to remember rare events
Learning to remember rare eventsLearning to remember rare events
Learning to remember rare events홍배 김
 
Binarized CNN on FPGA
Binarized CNN on FPGABinarized CNN on FPGA
Binarized CNN on FPGA홍배 김
 
Convolution 종류 설명
Convolution 종류 설명Convolution 종류 설명
Convolution 종류 설명홍배 김
 
Explanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expertExplanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expert홍배 김
 
Single Shot MultiBox Detector와 Recurrent Instance Segmentation
Single Shot MultiBox Detector와 Recurrent Instance SegmentationSingle Shot MultiBox Detector와 Recurrent Instance Segmentation
Single Shot MultiBox Detector와 Recurrent Instance Segmentation홍배 김
 
딥러닝을 이용한 자연어처리의 연구동향
딥러닝을 이용한 자연어처리의 연구동향딥러닝을 이용한 자연어처리의 연구동향
딥러닝을 이용한 자연어처리의 연구동향홍배 김
 
머신러닝의 자연어 처리기술(I)
머신러닝의 자연어 처리기술(I)머신러닝의 자연어 처리기술(I)
머신러닝의 자연어 처리기술(I)홍배 김
 
Q Learning과 CNN을 이용한 Object Localization
Q Learning과 CNN을 이용한 Object LocalizationQ Learning과 CNN을 이용한 Object Localization
Q Learning과 CNN을 이용한 Object Localization홍배 김
 

Destacado (9)

Meta-Learning with Memory Augmented Neural Networks
Meta-Learning with Memory Augmented Neural NetworksMeta-Learning with Memory Augmented Neural Networks
Meta-Learning with Memory Augmented Neural Networks
 
Learning to remember rare events
Learning to remember rare eventsLearning to remember rare events
Learning to remember rare events
 
Binarized CNN on FPGA
Binarized CNN on FPGABinarized CNN on FPGA
Binarized CNN on FPGA
 
Convolution 종류 설명
Convolution 종류 설명Convolution 종류 설명
Convolution 종류 설명
 
Explanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expertExplanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expert
 
Single Shot MultiBox Detector와 Recurrent Instance Segmentation
Single Shot MultiBox Detector와 Recurrent Instance SegmentationSingle Shot MultiBox Detector와 Recurrent Instance Segmentation
Single Shot MultiBox Detector와 Recurrent Instance Segmentation
 
딥러닝을 이용한 자연어처리의 연구동향
딥러닝을 이용한 자연어처리의 연구동향딥러닝을 이용한 자연어처리의 연구동향
딥러닝을 이용한 자연어처리의 연구동향
 
머신러닝의 자연어 처리기술(I)
머신러닝의 자연어 처리기술(I)머신러닝의 자연어 처리기술(I)
머신러닝의 자연어 처리기술(I)
 
Q Learning과 CNN을 이용한 Object Localization
Q Learning과 CNN을 이용한 Object LocalizationQ Learning과 CNN을 이용한 Object Localization
Q Learning과 CNN을 이용한 Object Localization
 

Similar a A neural image caption generator

[Tf2017] day4 jwkang_pub
[Tf2017] day4 jwkang_pub[Tf2017] day4 jwkang_pub
[Tf2017] day4 jwkang_pubJaewook. Kang
 
딥 러닝 자연어 처리 학습을 위한 PPT! (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리 학습을 위한 PPT! (Deep Learning for Natural Language Processing)딥 러닝 자연어 처리 학습을 위한 PPT! (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리 학습을 위한 PPT! (Deep Learning for Natural Language Processing)WON JOON YOO
 
딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)WON JOON YOO
 
LSTM 네트워크 이해하기
LSTM 네트워크 이해하기LSTM 네트워크 이해하기
LSTM 네트워크 이해하기Mad Scientists
 
EveryBody Tensorflow module2 GIST Jan 2018 Korean
EveryBody Tensorflow module2 GIST Jan 2018 KoreanEveryBody Tensorflow module2 GIST Jan 2018 Korean
EveryBody Tensorflow module2 GIST Jan 2018 KoreanJaewook. Kang
 
딥러닝 기반의 자연어처리 최근 연구 동향
딥러닝 기반의 자연어처리 최근 연구 동향딥러닝 기반의 자연어처리 최근 연구 동향
딥러닝 기반의 자연어처리 최근 연구 동향LGCNSairesearch
 
Lecture 4: Neural Networks I
Lecture 4: Neural Networks ILecture 4: Neural Networks I
Lecture 4: Neural Networks ISang Jun Lee
 
효율적인 2D 게임 개발을 위한 2d skeletal 구조에 관한 연구 - Spine을 중심으로
효율적인 2D 게임 개발을 위한 2d skeletal 구조에 관한 연구 - Spine을 중심으로효율적인 2D 게임 개발을 위한 2d skeletal 구조에 관한 연구 - Spine을 중심으로
효율적인 2D 게임 개발을 위한 2d skeletal 구조에 관한 연구 - Spine을 중심으로Hyunwoo Kim
 
Adversarial Attack in Neural Machine Translation
Adversarial Attack in Neural Machine TranslationAdversarial Attack in Neural Machine Translation
Adversarial Attack in Neural Machine TranslationHyunKyu Jeon
 
[Tf2017] day2 jwkang_pub
[Tf2017] day2 jwkang_pub[Tf2017] day2 jwkang_pub
[Tf2017] day2 jwkang_pubJaewook. Kang
 
2017 tensor flow dev summit
2017 tensor flow dev summit2017 tensor flow dev summit
2017 tensor flow dev summitTae Young Lee
 
차원축소 훑어보기 (PCA, SVD, NMF)
차원축소 훑어보기 (PCA, SVD, NMF)차원축소 훑어보기 (PCA, SVD, NMF)
차원축소 훑어보기 (PCA, SVD, NMF)beom kyun choi
 
[Paper review] neural production system
[Paper review] neural production system[Paper review] neural production system
[Paper review] neural production systemSeonghoon Jung
 
Tfk 6618 tensor_flow로얼굴인식구현_r10_mariocho
Tfk 6618 tensor_flow로얼굴인식구현_r10_mariochoTfk 6618 tensor_flow로얼굴인식구현_r10_mariocho
Tfk 6618 tensor_flow로얼굴인식구현_r10_mariochoMario Cho
 
Latest Frame interpolation Algorithms
Latest Frame interpolation AlgorithmsLatest Frame interpolation Algorithms
Latest Frame interpolation AlgorithmsHyeongmin Lee
 
Ndc2010 전형규 마비노기2 캐릭터 렌더링 기술
Ndc2010 전형규   마비노기2 캐릭터 렌더링 기술Ndc2010 전형규   마비노기2 캐릭터 렌더링 기술
Ndc2010 전형규 마비노기2 캐릭터 렌더링 기술henjeon
 

Similar a A neural image caption generator (20)

[Tf2017] day4 jwkang_pub
[Tf2017] day4 jwkang_pub[Tf2017] day4 jwkang_pub
[Tf2017] day4 jwkang_pub
 
Text summarization
Text summarizationText summarization
Text summarization
 
딥 러닝 자연어 처리 학습을 위한 PPT! (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리 학습을 위한 PPT! (Deep Learning for Natural Language Processing)딥 러닝 자연어 처리 학습을 위한 PPT! (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리 학습을 위한 PPT! (Deep Learning for Natural Language Processing)
 
딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)
 
LSTM 네트워크 이해하기
LSTM 네트워크 이해하기LSTM 네트워크 이해하기
LSTM 네트워크 이해하기
 
EveryBody Tensorflow module2 GIST Jan 2018 Korean
EveryBody Tensorflow module2 GIST Jan 2018 KoreanEveryBody Tensorflow module2 GIST Jan 2018 Korean
EveryBody Tensorflow module2 GIST Jan 2018 Korean
 
딥러닝 기반의 자연어처리 최근 연구 동향
딥러닝 기반의 자연어처리 최근 연구 동향딥러닝 기반의 자연어처리 최근 연구 동향
딥러닝 기반의 자연어처리 최근 연구 동향
 
LeNet & GoogLeNet
LeNet & GoogLeNetLeNet & GoogLeNet
LeNet & GoogLeNet
 
Lecture 4: Neural Networks I
Lecture 4: Neural Networks ILecture 4: Neural Networks I
Lecture 4: Neural Networks I
 
효율적인 2D 게임 개발을 위한 2d skeletal 구조에 관한 연구 - Spine을 중심으로
효율적인 2D 게임 개발을 위한 2d skeletal 구조에 관한 연구 - Spine을 중심으로효율적인 2D 게임 개발을 위한 2d skeletal 구조에 관한 연구 - Spine을 중심으로
효율적인 2D 게임 개발을 위한 2d skeletal 구조에 관한 연구 - Spine을 중심으로
 
Adversarial Attack in Neural Machine Translation
Adversarial Attack in Neural Machine TranslationAdversarial Attack in Neural Machine Translation
Adversarial Attack in Neural Machine Translation
 
Rnn keras
Rnn kerasRnn keras
Rnn keras
 
R.T.Bach
R.T.BachR.T.Bach
R.T.Bach
 
[Tf2017] day2 jwkang_pub
[Tf2017] day2 jwkang_pub[Tf2017] day2 jwkang_pub
[Tf2017] day2 jwkang_pub
 
2017 tensor flow dev summit
2017 tensor flow dev summit2017 tensor flow dev summit
2017 tensor flow dev summit
 
차원축소 훑어보기 (PCA, SVD, NMF)
차원축소 훑어보기 (PCA, SVD, NMF)차원축소 훑어보기 (PCA, SVD, NMF)
차원축소 훑어보기 (PCA, SVD, NMF)
 
[Paper review] neural production system
[Paper review] neural production system[Paper review] neural production system
[Paper review] neural production system
 
Tfk 6618 tensor_flow로얼굴인식구현_r10_mariocho
Tfk 6618 tensor_flow로얼굴인식구현_r10_mariochoTfk 6618 tensor_flow로얼굴인식구현_r10_mariocho
Tfk 6618 tensor_flow로얼굴인식구현_r10_mariocho
 
Latest Frame interpolation Algorithms
Latest Frame interpolation AlgorithmsLatest Frame interpolation Algorithms
Latest Frame interpolation Algorithms
 
Ndc2010 전형규 마비노기2 캐릭터 렌더링 기술
Ndc2010 전형규   마비노기2 캐릭터 렌더링 기술Ndc2010 전형규   마비노기2 캐릭터 렌더링 기술
Ndc2010 전형규 마비노기2 캐릭터 렌더링 기술
 

Más 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홍배 김
 
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홍배 김
 

Más de 홍배 김 (14)

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
 
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
 

A neural image caption generator

  • 1. Show and Tell : A Neural Image Caption Generator 참고자료 1. “Show and Tell: A Neural Image Caption Generator”, O.Vinyals, A.Toshev, S.Bengio, D.Erhan 2. CV勉強会@関東「CVPR2015読み会」発表資料, 皆川卓也 3. Lecture Note “Recurrent Neural Networks”, CS231n, Andrej Karpathy 2016. 7. 김홍배 한국항공우주연구원
  • 2. 개요  1장의 스틸사진으로 부터 설명문(Caption)을 생성  자동번역등에 사용되는 Recurrent Neural Networks (RNN)에 Deep Convolutional Neural Networks에서 생성한 이미지의 특징벡터를 입력  Neural Image Caption (NIC)  종래방법을 크게 상회하는 정확도
  • 3. Convolutional Neural Networks (CNN)  CNN이 「학습데이터로부터 이미지 인식에 효과적인 특징들을 자동으로 학습하는 네트워크」 라는 것을 이해하고 있어야 함  GoogLeNet을 개량한 아래 논문을 사용  S.Ioffe and C.Szegedy, “Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift”, arXiv 2015
  • 4. Reccurent Neural Networks (RNN) ・・・・・・  시계열 데이터등의 「연속적 데이터」를 취급하기 위한 뉴럴넷  음성인식, 자동번역, 영상인식등에 활용  예측대상의 dimension이 가변  시간t의 은익층 출력이 시간t+1의 은익층 입력으로 됨 출력 은익층 입력
  • 5. Reccurent Neural Networks (RNN)  전개하면 정적인 네트워크로 표현됨. ・・・・・・ ・・・・・・ ・・・・・・ t-1 t t+1 출력 은익층 입력 훈련데이터 훈련데이터 훈련데이터  일반적인 오차 역전파법으로 변수를 학습시킬 수 있다.
  • 6. Long-Short Term Memory (LSTM)  RNN은 계열이 길어지면 계층이 깊어지므로 전파된 오차구배가 발산 또는 소멸됨.  Gradient Vanishing or Explosion  각 데이터의 입출력 및 과거 데이터의 사용/미사용을 제어함으로써, 긴 계열을 취급가능. Long-Short Term Memory (LSTM)
  • 7. depth time RNN LSTM tt-1 l l-1 ℎ 𝑡−1 𝑙 ℎ 𝑡 𝑙−1 ℎ 𝑡 𝑙 ℎ 𝑡 𝑙 Long-Short Term Memory (LSTM)  RNN과 LSTM의 수식적 차이
  • 8. f x i g x + tanh o x f x i g x + tanh o x @ time t ht-1 xt xt+1 ht ht+1 ct-1 Cell state ct ct+1 Long-Short Term Memory (LSTM) @ time t+1  LSTM의 각각의 Cell은 다음과 같으며, 여러 개의 gate로 구성 입력 또는 하부층 출력 전시점(t-1) cell 데이터 전시점(t-1) 출력 출력
  • 9. f Forget Gate  과거 계열 데이터의 사용/미사용을 제어 𝑓𝑡 = 𝜎(𝑊𝑓 𝑥 𝑥𝑡 + 𝑊 𝑓h ht-1 ) x Long-Short Term Memory (LSTM) ct-1 ht-1 xt - Sigmoid ft’n의 출력값은 0 ~ 1 사이에 존재 - ft가 “1”이면 이전 State 값을 유지 - ft가 “0”이면 이전 State 값을 삭제 Cell state 학습하는 변수 입력 또는 하부층 출력 전시점(t-1) cell 데이터 전시점(t-1) 출력
  • 10. Input Gate  입력데이터의 사용/미사용을 제어 Long-Short Term Memory (LSTM) i g x f gt= tanh(Wgx x𝑡 + 𝑊ghht-1) xct-1 ht-1 xt - gt 는 Hyperbolic tangent ft’n의 출력값이므로 -1 ~ 1 사이에 존재 - it는 Sigmoid ft’n의 출력값이므로 0~1 사이에 존재 Cell state + it= σ(Wix x𝑡 + 𝑊ihht-1) yt = gt⨀it y 학습하는 변수 ht-1 xt ct 현시점(t) cell 데이터
  • 11. Output Gate  출력데이터의 사용/미사용을 제어 Long-Short Term Memory (LSTM) x f ot = σ(Wox x𝑡 + 𝑊ohht-1) xct-1 Cell state + ht = ot⨀tanh(ct) y 학습하는 변수 tanh o x ht ht-1 xt ct 현시점(t) 출력
  • 12. Long-Short Term Memory (LSTM) i f o g sigmoid sigmoid tanh sigmoid 4n x 2n 4n 4*n nx1 nx1 Wix Wih Wfx Wfh Wox Woh Wgx Wgh xt ℎ 𝑡−1 𝑙 2n  Matrix와 Vector 형태로 간략화 시키면 LSTM weight matrix to be identified 하층 출력 또는 입력벡터 (x) 전시점(t-1) 출력벡터
  • 13. Neural Image Caption (NIC)  사진(I)를 입력으로 주었을 때  정답 “설명문“, S를 만들어 낼 가능성을 최대가 되도록  학습데이터(I, S)를 이용하여  넷의 변수(w)들을 찾아내는 과정 설명문 w∗ = argmin 𝐼,𝑆 log ‫(݌‬S|I;w) w 사진, 변수 확률 손실함수 전체 학습데이터 셋에 대한 손실함수 손실함수를 최소화 시키는 변수, w*를 구하는 작업
  • 14. Neural Image Caption (NIC)  사진으로부터 설명문 생성 𝑝 𝑆 𝐼; 𝑤 = 𝑡=0 𝑁 𝑝 𝑆𝑡 𝐼, 𝑆0, 𝑆1,···, 𝑆𝑡−1; 𝑤 단어수 각 단어는 그전 단어열의 영향을 받는다. 𝑆 ={𝑆0, 𝑆1, ⋯} 단어, 따라서 설명문 S는 길이가 변하는 계열데이터
  • 15. Neural Image Caption (NIC)  사진으로부터 설명문 생성 𝑝 𝑆 𝐼; 𝑤 = 𝑡=0 𝑁 𝑝 𝑆𝑡 𝐼, 𝑆0, 𝑆1,···, 𝑆𝑡−1; 𝑤 학습 데이터 셋(I,S)로 부터 훈련을 통해 찾아내는 변수
  • 16. ht-1 xt 단어 @ t Neural Image Caption (NIC) St L S T M WeSt 입력 @ t 출력@t Pt+1(St+1)=softmax(ℎ 𝑡 )  LSTM based Sentence Generator의 기본 구조 ℎ 𝑡 : 단어별 확률적 분포를 계산 ht log ‫(݌‬St+1) : 손실함수 계산 : word embedding 과정 출력@t-1
  • 17. 17 Neural Image Caption (NIC)  Word Embedding 일반적으로 “one hot“ vector형태로 단어를 나타내는데, 단어들로 구성된 Dictionary의 크기가 바뀌기 쉬움 이경우 LSTM의 모델링등에 어려움이 있음 이에 따라 가변의 “one hot“ vector형태를 고정된 길이의 Vector형태로 변형시키는 과정이 필요 dog 0010000000 cat one hot vector representation 0000001000 Word embedding vector representation dog 0.10.30.20.10.20.3 cat we 0.20.10.20.20.10.1 xtSt
  • 18. 18 Neural Image Caption (NIC)  손실함수 For 𝑦_𝑖 = 1 𝑐𝑎𝑠𝑒 J(w)=-log𝑦𝑖 𝑦𝑖 1 J(w) As 𝑦𝑖 approaches to 1, J(w) becomes 0 J(w)=-∑𝑦_𝑖•log𝑦𝑖 y : 분류기에서 추정한 확률값 y_ : 정답 Cross entropy로 정의함
  • 20. Neural Image Caption (NIC) 사진의 특징벡터를 Deep CNN에서 가져움 LSTM으로최초의 입력이됨(𝒙−𝟏)
  • 21. Neural Image Caption (NIC) 단어𝑺 𝟎을입력 다음 단어가 𝑺 𝟏일확률
  • 22. Neural Image Caption (NIC) h 𝟎, c𝟎
  • 23. NIC의 학습과정 ImageNet+ Drop out 으로 Pretraining 랜던하게변수를초기화
  • 24. NIC의 학습과정  학습용 사진과 설명문 셋
  • 28. SpecialStart Word 가장 확률이 높은 단어 𝑺 𝟏을선택 NIC로 예측 (Sampling)
  • 29. 선택된 단어 𝑺 𝟏을입력 end- of- sentence token이 나타날때 까지 계속 NIC로 예측 (Sampling)
  • 30. NIC로 예측 (BeamSearch) 확률이 높은 k개 의 단어를 유지
  • 31. 확률이 높은 k개 의 문장을 유지 K개의단어를입력 NIC로 예측 (BeamSearch)
  • 32. NIC로 예측(BeamSearch) 확률이 높은 k개 의 문장을 유지 K개의단어를입력 이하에서는 BeamSearch를 이용
  • 34. 실험결과  3개의 지표로 MSCOCO 데이터 셋에 대한 정량평가  사람이 평가한 성능에 근접한 결과를 내는 경우도 있음
  • 35. 다른 방법과의 비교  기존 방법에 비해 대폭적인 정확도 개선
  • 36. 상위 N개의 문장열 4  동일한 사진에 대하여 다른 표현을 얻어냄  학습 데이터에는 없는 새로운 표현이 만들어짐
  • 38. 결론  Deep CNN과 RNN을 사용해서 사진으로부터 설명문을 만들어내는 방법을 제안 1개의 네트웍으로 오차 역전파로 변수를 학습 RNN에는 LSTM을 사용하여 긴 문장에서도 학습시 에 전파되는 오차가 발산하지 않음. 종래에 비하여 대폭적 정확도 개선