SlideShare a Scribd company logo
1 of 42
Download to read offline
One Shot Learning
SK Telecom Video Tech. Lab.
김지성 Manager
Contents
Why do we need one-shot learning?
What is one-shot learning?
How to do “one-shot learning”
Recap
종합기술원
미래기술원
Lab Introduction using Backpropagation
Video Tech. Lab
One Shot Learning:
Learning a class from
a single labelled example
Giraffe Classification
VS
어린이는 한 장의 기린 사진을 통해
기린이라는 Class의 Concept을
학습 가능함
DNN은 한 class를
학습하기 위해
수백장 or 수천장
필요함
Korean Food Classifier
CNN Architecutre
…
1. Batch Size (ex. 256장)씩 학습한다. (120만장씩 90번)
2. 최적화는 Gradient based Optimization
( Extensive, Incremental Training on Large DB )
3. 새로운 Image에 대한 학습 반영이 느리다.
4. 그러므로 One-Shot Learning에 적합하지 않다!
Machine Learning Principle:
Test and Train conditions
Must Match.
Matching Networks Architecutre (deepmind, ‘16)
1. Test 할 때 1장만 보여주면서 학습할 때 수백장 보여주는게 좋을까?
2. 학습할 때도 한 class당 한장씩 만 보여주어야 한다! (or 5장)
3. g, f 는 입력을 embedding 하는 neural network (VGG, Inception)
4. Embedding을 통해 나온 feature vector들 사이의 유사도를 구한다.
5. 유사도의 weighted sum을 통해 최종 Test label을 결정
Matching Networks Architecutre
: Test Example
Attention by Softmax & Cosine distance
Candidate : Chihuahua
Test Input : Shepherd
Candidate : Retriever
Candidate : Siberian Husky
Candidate : Shepherd
fc7 : 4096 dim
CNN
CNN
: Test Label: Training Set
Matching Networks Architecutre
: Test Example
It’s differentiable! End to End Nearest Neighbour Classifier
Candidate : Chihuahua
Test Input : Shepherd
Candidate : Retriever
Candidate : Siberian Husky
Candidate : Shepherd
fc7 : 4096 dim
CNN
CNN
: Test Label: Training Set
CNN
CNN
CNN
Bi-
LSTM
LSTM
Matching Networks Architecutre
CNNCNNCNNCNN
Bi-LSTM
fc7 : 4096 dim
fc7 : 4096 dim
fc7 : 4096 dim
fc7 : 4096 dim
Matching Networks Result
Recap
Why do we need one-shot learning?
If there is a few data for training/testing
What is one-shot learning?
Learning a class from a single labelled example
How to do “one-shot learning”
Start with Omniglot Example
import tensorflow as tf
Face Recognition
Appendix
One-Shot Learning
How can we learn a novel concept from a
few examples? (random guess will be 1/N)
Korean
Problem Setting - Training
Problem Setting - Training
Greek
Problem Setting - Testing
1 Angelic
2 Oriya
3 Tibetan
4 Keble
5 ULOG
1 Angelic ?
2 Oriya
3 Tibetan ?
4 Keble
5 ULOG? = 1/N
한번은 정답을 알려준다. (One-shot)
새로운 Character에 대해 Test (5지 선다)
Recent Papers about One Shot Learning
One-shot Learning with Memory-Augmented Neural Networks
a) Submitted on : 16.05.19
b) Written by : Deep Mind
c) Link : https://arxiv.org/abs/1605.06065
Matching Networks for One Shot Learning
a) Submitted on : 16.06.13
b) Written by : Deep Mind
c) Link : https://arxiv.org/abs/1606.04080
One Shot Learning with
Memory
Augmented
Neural
Network
MANN Architecture
RAM 
CPU 
Neural Turing Machine vs Memory Augmented Neural Network
1. MANN은 NTM의 변형이다.
2. Controller는 Feed Forward NN or LSTM을 사용하였다.
3. 기존 NTM은 복사, 정렬등의 알고리즘을 학습하는데 사용하였지만 이
논문에서는 One-shot Learing에 사용
4. 빠른 학습을 위해 Memory에 Write할 때 가장 적게 사용된 메모리 or
가장 최근에 사용된 메모리에 Write함 (LRUA)
5. 그렇다면 기본적인 질문?! 왜 Augmented Memory가 필요할까?
Why do we need Differentiable Memory?
잘 알려진 것 처럼 CNN is good for spatial structure (Image, … )
RNN is good for temporal structure (Audio, …)
Augmenting Neural Nets with a Memory Module
CNN + RNN is good for spatiotemporal structure (Video, …)
그렇다면 아주 간단한 Question & Answering 문제에서도
CNN 및 RNN or 그 조합이 잘 동작하는가?
Augmenting Neural Nets with a Memory Module
Augmenting Neural Nets with a Memory Module
bAbI task Example Story
Sam moved to the garden.
Mary left the milk.
John left the football.
Daniel moved to the garden.
Sam went to the kitchen.
Sandra moved to the hallway.
Mary moved to the hallway.
Mary left the milk.
Sam drops the apple there.
Q : Where was the apple after the garden?
Augmenting Neural Nets with a Memory Module
bAbI task Example Story
Sam moved to the garden.
Mary left the milk.
John left the football.
Daniel moved to the garden.
Sam went to the kitchen.
Sandra moved to the hallway.
Mary moved to the hallway.
Mary left the milk.
Sam drops the apple there.
Q : Where was the apple after the garden?
Augmenting Neural Nets with a Memory Module
bAbI task Example Story
Sam moved to the garden.
Mary left the milk.
John left the football.
Daniel moved to the garden.
Sam went to the kitchen.
Sandra moved to the hallway.
Mary moved to the hallway.
Mary left the milk.
Sam drops the apple there.
Q : Where was the apple after the garden?
Augmenting Neural Nets with a Memory Module
bAbI task Example Story
Sam moved to the garden.
Mary left the milk.
John left the football.
Daniel moved to the garden.
Sam went to the kitchen.
Sandra moved to the hallway.
Mary moved to the hallway.
Mary left the milk.
Sam drops the apple there.
Q : Where was the apple after the garden?
Augmenting Neural Nets with a Memory Module
즉! Data가 out-of-order인 경우 기존 CNN, RNN으로는 잘 해결되지 않는다.
현재 아래 구조의 data들에 대해서는 아직 다양한 노력 中
1. Out-of-order access (순차적이지 않은 접근)
2. 장기 기억
3. 정렬되지 않은 data
Differentialble Memory : MemN2N
1. 단어를 one-hot vector로 변형한 뒤 A, B, C matrix를 통해 문장을 메모리화
2. Embedding 된 질문 문장(u)과의 inner product를 통해 Attention 결정
3. 구해진 attention과 입력 Output Memory와의 weighted sum을 통해
output matrix o 구함
4. 최종적으로 Softmax(W(u+o))를 고려해 답을 도출
MANN - Task Setup
1. : Training Set
2. 입력이미지는 105 x 105  20 x 20  400 x 1 로 flatten
3. Time off-set labels 을 사용 (x_t, y_t-1) 하여 현재 결과가 다음
입력으로 들어가도록 구성
MANN - Network Strategy
1. Episode = Task  학습에 사용한 Sequence (x_t, y_t-1)
2. 1 episode의 길이는 5 classes 일 경우에는 50, 10 classes일
경우에는 100
3. 학습은 이런 episode를 10만번 수행 하여 결과 도출
MANN - Network Strategy
1. Time off-set labels 을 사용 (x_t, y_t-1) 하여 현재 결과가 다음
입력으로 들어가도록 구성
2. External Memory에는 (image, label) 쌍으로 저장해 놓는다.
3. External Memory에 새로 입력된 이미지와 유사도가 큰 이미지가
있으면 Read해서 결과를 도출한다.
Omniglot classification - LSTM (5 way)
Omniglot classification - MANN (5 way)
Omniglot classification - LSTM (15 way)
Omniglot classification - MANN (15 way)
Human vs MANN
1. 사람에게도 동일하게 한장의 사진을 보여준 뒤 1-5 사이의 숫자를
선택하게 하고 매 Instance 마다 정답을 알려줄 경우 1-shot의
경우 57.3% 정확도
2. 하지만 MANN은 82.8 % 정확도
3. 앞에서 설명한 Matching Net은 98.1% 정확도
Summary
1. Internal Memory (CNN, RNN)는 새로운 information을
Internal Memory(Weights) 에 반영하는 속도가 느림.
2. External Memory (MemN2N, NTM)을 사용하면 빠르게
새로운 정보를 저장하고 검색하는 것이 가능함. (MANN)
3. Deep Neural Feature에 대한 Metric Learning 과 External
Memory의 아이디어를 결합하여 Matching Network를
제안함
4. 학습에 필요한 이미지가 충분하지 않을 경우 큰 장점이
있지만 반대의 경우에는 State-of-the Art 대비 열세

More Related Content

What's hot

Maximum Entropy IRL(最大エントロピー逆強化学習)とその発展系について
Maximum Entropy IRL(最大エントロピー逆強化学習)とその発展系についてMaximum Entropy IRL(最大エントロピー逆強化学習)とその発展系について
Maximum Entropy IRL(最大エントロピー逆強化学習)とその発展系についてYusuke Nakata
 
20191006 bayesian dl_1_pub
20191006 bayesian dl_1_pub20191006 bayesian dl_1_pub
20191006 bayesian dl_1_pubYoichi Tokita
 
ハミルトニアンモンテカルロ法についての説明
ハミルトニアンモンテカルロ法についての説明ハミルトニアンモンテカルロ法についての説明
ハミルトニアンモンテカルロ法についての説明KCS Keio Computer Society
 
基礎からのベイズ統計学第5章
基礎からのベイズ統計学第5章基礎からのベイズ統計学第5章
基礎からのベイズ統計学第5章hiro5585
 
(文献紹介)Deep Unrolling: Learned ISTA (LISTA)
(文献紹介)Deep Unrolling: Learned ISTA (LISTA)(文献紹介)Deep Unrolling: Learned ISTA (LISTA)
(文献紹介)Deep Unrolling: Learned ISTA (LISTA)Morpho, Inc.
 
Interpretability beyond feature attribution quantitative testing with concept...
Interpretability beyond feature attribution quantitative testing with concept...Interpretability beyond feature attribution quantitative testing with concept...
Interpretability beyond feature attribution quantitative testing with concept...MLconf
 
Meta-Learning with Memory-Augmented Neural Networks (MANN)
Meta-Learning with Memory-Augmented Neural Networks (MANN)Meta-Learning with Memory-Augmented Neural Networks (MANN)
Meta-Learning with Memory-Augmented Neural Networks (MANN)Yeonsu Kim
 
Time series classification
Time series classificationTime series classification
Time series classificationSung Kim
 
【DL輪読会】SDEdit: Guided Image Synthesis and Editing with Stochastic Differentia...
【DL輪読会】SDEdit: Guided Image Synthesis and Editing with Stochastic Differentia...【DL輪読会】SDEdit: Guided Image Synthesis and Editing with Stochastic Differentia...
【DL輪読会】SDEdit: Guided Image Synthesis and Editing with Stochastic Differentia...Deep Learning JP
 
最近強化学習の良記事がたくさん出てきたので勉強しながらまとめた
最近強化学習の良記事がたくさん出てきたので勉強しながらまとめた最近強化学習の良記事がたくさん出てきたので勉強しながらまとめた
最近強化学習の良記事がたくさん出てきたので勉強しながらまとめたKatsuya Ito
 
CMA-ESサンプラーによるハイパーパラメータ最適化 at Optuna Meetup #1
CMA-ESサンプラーによるハイパーパラメータ最適化 at Optuna Meetup #1CMA-ESサンプラーによるハイパーパラメータ最適化 at Optuna Meetup #1
CMA-ESサンプラーによるハイパーパラメータ最適化 at Optuna Meetup #1Masashi Shibata
 
第7回WBAシンポジウム:全脳確率的生成モデル(WB-PGM)〜世界モデルと推論に基づく汎用人工知能に向けて
第7回WBAシンポジウム:全脳確率的生成モデル(WB-PGM)〜世界モデルと推論に基づく汎用人工知能に向けて第7回WBAシンポジウム:全脳確率的生成モデル(WB-PGM)〜世界モデルと推論に基づく汎用人工知能に向けて
第7回WBAシンポジウム:全脳確率的生成モデル(WB-PGM)〜世界モデルと推論に基づく汎用人工知能に向けてThe Whole Brain Architecture Initiative
 
Review: Incremental Few-shot Instance Segmentation [CDM]
Review: Incremental Few-shot Instance Segmentation [CDM]Review: Incremental Few-shot Instance Segmentation [CDM]
Review: Incremental Few-shot Instance Segmentation [CDM]Dongmin Choi
 
強化学習を利用した自律型GameAIの取り組み ~高速自動プレイによるステージ設計支援~ #denatechcon
強化学習を利用した自律型GameAIの取り組み ~高速自動プレイによるステージ設計支援~ #denatechcon強化学習を利用した自律型GameAIの取り組み ~高速自動プレイによるステージ設計支援~ #denatechcon
強化学習を利用した自律型GameAIの取り組み ~高速自動プレイによるステージ設計支援~ #denatechconDeNA
 
Bart : Denoising Sequence-to-Sequence Pre-training for Natural Language Gener...
Bart : Denoising Sequence-to-Sequence Pre-training for Natural Language Gener...Bart : Denoising Sequence-to-Sequence Pre-training for Natural Language Gener...
Bart : Denoising Sequence-to-Sequence Pre-training for Natural Language Gener...taeseon ryu
 
「再代入なんて、あるわけない」 ~ふつうのプログラマが関数型言語を知るべき理由~ (Gunma.web #5 2011/05/14)
「再代入なんて、あるわけない」 ~ふつうのプログラマが関数型言語を知るべき理由~ (Gunma.web #5 2011/05/14)「再代入なんて、あるわけない」 ~ふつうのプログラマが関数型言語を知るべき理由~ (Gunma.web #5 2011/05/14)
「再代入なんて、あるわけない」 ~ふつうのプログラマが関数型言語を知るべき理由~ (Gunma.web #5 2011/05/14)parrotstudio
 
AI 연구자를 위한 클린코드 - GDG DevFest Seoul 2019
AI 연구자를 위한 클린코드 - GDG DevFest Seoul 2019AI 연구자를 위한 클린코드 - GDG DevFest Seoul 2019
AI 연구자를 위한 클린코드 - GDG DevFest Seoul 2019Kenneth Ceyer
 
AutoEncoderで特徴抽出
AutoEncoderで特徴抽出AutoEncoderで特徴抽出
AutoEncoderで特徴抽出Kai Sasaki
 
混合整数ブラックボックス最適化に向けたCMA-ESの改良 / Optuna Meetup #2
混合整数ブラックボックス最適化に向けたCMA-ESの改良 / Optuna Meetup #2混合整数ブラックボックス最適化に向けたCMA-ESの改良 / Optuna Meetup #2
混合整数ブラックボックス最適化に向けたCMA-ESの改良 / Optuna Meetup #2RHamano
 

What's hot (20)

Maximum Entropy IRL(最大エントロピー逆強化学習)とその発展系について
Maximum Entropy IRL(最大エントロピー逆強化学習)とその発展系についてMaximum Entropy IRL(最大エントロピー逆強化学習)とその発展系について
Maximum Entropy IRL(最大エントロピー逆強化学習)とその発展系について
 
20191006 bayesian dl_1_pub
20191006 bayesian dl_1_pub20191006 bayesian dl_1_pub
20191006 bayesian dl_1_pub
 
ハミルトニアンモンテカルロ法についての説明
ハミルトニアンモンテカルロ法についての説明ハミルトニアンモンテカルロ法についての説明
ハミルトニアンモンテカルロ法についての説明
 
基礎からのベイズ統計学第5章
基礎からのベイズ統計学第5章基礎からのベイズ統計学第5章
基礎からのベイズ統計学第5章
 
(文献紹介)Deep Unrolling: Learned ISTA (LISTA)
(文献紹介)Deep Unrolling: Learned ISTA (LISTA)(文献紹介)Deep Unrolling: Learned ISTA (LISTA)
(文献紹介)Deep Unrolling: Learned ISTA (LISTA)
 
Interpretability beyond feature attribution quantitative testing with concept...
Interpretability beyond feature attribution quantitative testing with concept...Interpretability beyond feature attribution quantitative testing with concept...
Interpretability beyond feature attribution quantitative testing with concept...
 
Meta-Learning with Memory-Augmented Neural Networks (MANN)
Meta-Learning with Memory-Augmented Neural Networks (MANN)Meta-Learning with Memory-Augmented Neural Networks (MANN)
Meta-Learning with Memory-Augmented Neural Networks (MANN)
 
Time series classification
Time series classificationTime series classification
Time series classification
 
【DL輪読会】SDEdit: Guided Image Synthesis and Editing with Stochastic Differentia...
【DL輪読会】SDEdit: Guided Image Synthesis and Editing with Stochastic Differentia...【DL輪読会】SDEdit: Guided Image Synthesis and Editing with Stochastic Differentia...
【DL輪読会】SDEdit: Guided Image Synthesis and Editing with Stochastic Differentia...
 
最近強化学習の良記事がたくさん出てきたので勉強しながらまとめた
最近強化学習の良記事がたくさん出てきたので勉強しながらまとめた最近強化学習の良記事がたくさん出てきたので勉強しながらまとめた
最近強化学習の良記事がたくさん出てきたので勉強しながらまとめた
 
CMA-ESサンプラーによるハイパーパラメータ最適化 at Optuna Meetup #1
CMA-ESサンプラーによるハイパーパラメータ最適化 at Optuna Meetup #1CMA-ESサンプラーによるハイパーパラメータ最適化 at Optuna Meetup #1
CMA-ESサンプラーによるハイパーパラメータ最適化 at Optuna Meetup #1
 
第7回WBAシンポジウム:全脳確率的生成モデル(WB-PGM)〜世界モデルと推論に基づく汎用人工知能に向けて
第7回WBAシンポジウム:全脳確率的生成モデル(WB-PGM)〜世界モデルと推論に基づく汎用人工知能に向けて第7回WBAシンポジウム:全脳確率的生成モデル(WB-PGM)〜世界モデルと推論に基づく汎用人工知能に向けて
第7回WBAシンポジウム:全脳確率的生成モデル(WB-PGM)〜世界モデルと推論に基づく汎用人工知能に向けて
 
Review: Incremental Few-shot Instance Segmentation [CDM]
Review: Incremental Few-shot Instance Segmentation [CDM]Review: Incremental Few-shot Instance Segmentation [CDM]
Review: Incremental Few-shot Instance Segmentation [CDM]
 
파이썬으로 익히는 딥러닝
파이썬으로 익히는 딥러닝파이썬으로 익히는 딥러닝
파이썬으로 익히는 딥러닝
 
強化学習を利用した自律型GameAIの取り組み ~高速自動プレイによるステージ設計支援~ #denatechcon
強化学習を利用した自律型GameAIの取り組み ~高速自動プレイによるステージ設計支援~ #denatechcon強化学習を利用した自律型GameAIの取り組み ~高速自動プレイによるステージ設計支援~ #denatechcon
強化学習を利用した自律型GameAIの取り組み ~高速自動プレイによるステージ設計支援~ #denatechcon
 
Bart : Denoising Sequence-to-Sequence Pre-training for Natural Language Gener...
Bart : Denoising Sequence-to-Sequence Pre-training for Natural Language Gener...Bart : Denoising Sequence-to-Sequence Pre-training for Natural Language Gener...
Bart : Denoising Sequence-to-Sequence Pre-training for Natural Language Gener...
 
「再代入なんて、あるわけない」 ~ふつうのプログラマが関数型言語を知るべき理由~ (Gunma.web #5 2011/05/14)
「再代入なんて、あるわけない」 ~ふつうのプログラマが関数型言語を知るべき理由~ (Gunma.web #5 2011/05/14)「再代入なんて、あるわけない」 ~ふつうのプログラマが関数型言語を知るべき理由~ (Gunma.web #5 2011/05/14)
「再代入なんて、あるわけない」 ~ふつうのプログラマが関数型言語を知るべき理由~ (Gunma.web #5 2011/05/14)
 
AI 연구자를 위한 클린코드 - GDG DevFest Seoul 2019
AI 연구자를 위한 클린코드 - GDG DevFest Seoul 2019AI 연구자를 위한 클린코드 - GDG DevFest Seoul 2019
AI 연구자를 위한 클린코드 - GDG DevFest Seoul 2019
 
AutoEncoderで特徴抽出
AutoEncoderで特徴抽出AutoEncoderで特徴抽出
AutoEncoderで特徴抽出
 
混合整数ブラックボックス最適化に向けたCMA-ESの改良 / Optuna Meetup #2
混合整数ブラックボックス最適化に向けたCMA-ESの改良 / Optuna Meetup #2混合整数ブラックボックス最適化に向けたCMA-ESの改良 / Optuna Meetup #2
混合整数ブラックボックス最適化に向けたCMA-ESの改良 / Optuna Meetup #2
 

Similar to One-Shot Learning

Chapter 15 Representation learning - 1
Chapter 15 Representation learning - 1Chapter 15 Representation learning - 1
Chapter 15 Representation learning - 1KyeongUkJang
 
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홍배 김
 
Nationality recognition
Nationality recognitionNationality recognition
Nationality recognition준영 박
 
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
 
[Tf2017] day4 jwkang_pub
[Tf2017] day4 jwkang_pub[Tf2017] day4 jwkang_pub
[Tf2017] day4 jwkang_pubJaewook. Kang
 
180624 mobile visionnet_baeksucon_jwkang_pub
180624 mobile visionnet_baeksucon_jwkang_pub180624 mobile visionnet_baeksucon_jwkang_pub
180624 mobile visionnet_baeksucon_jwkang_pubJaewook. Kang
 
Anomaly detection practive_using_deep_learning
Anomaly detection practive_using_deep_learningAnomaly detection practive_using_deep_learning
Anomaly detection practive_using_deep_learning도형 임
 
Deep neural networks cnn rnn_ae_some practical techniques
Deep neural networks cnn rnn_ae_some practical techniquesDeep neural networks cnn rnn_ae_some practical techniques
Deep neural networks cnn rnn_ae_some practical techniquesKang Pilsung
 
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016Taehoon Kim
 
Deep learning seminar_snu_161031
Deep learning seminar_snu_161031Deep learning seminar_snu_161031
Deep learning seminar_snu_161031Jinwon Lee
 
Ml for 정형데이터
Ml for 정형데이터Ml for 정형데이터
Ml for 정형데이터JEEHYUN PAIK
 
Deep Learning for Chatbot (4/4)
Deep Learning for Chatbot (4/4)Deep Learning for Chatbot (4/4)
Deep Learning for Chatbot (4/4)Jaemin Cho
 
Alpha Go Introduction
Alpha Go IntroductionAlpha Go Introduction
Alpha Go IntroductionIldoo Kim
 
쫄지말자딥러닝2 - CNN RNN 포함버전
쫄지말자딥러닝2 - CNN RNN 포함버전쫄지말자딥러닝2 - CNN RNN 포함버전
쫄지말자딥러닝2 - CNN RNN 포함버전Modulabs
 
Distilling the knowledge in a neural network
Distilling the knowledge in a neural networkDistilling the knowledge in a neural network
Distilling the knowledge in a neural networkKyeongUkJang
 
딥러닝 - 역사와 이론적 기초
딥러닝 - 역사와 이론적 기초딥러닝 - 역사와 이론적 기초
딥러닝 - 역사와 이론적 기초Hyungsoo Ryoo
 
PR-203: Class-Balanced Loss Based on Effective Number of Samples
PR-203: Class-Balanced Loss Based on Effective Number of SamplesPR-203: Class-Balanced Loss Based on Effective Number of Samples
PR-203: Class-Balanced Loss Based on Effective Number of SamplesSunghoon Joo
 
Image Deep Learning 실무적용
Image Deep Learning 실무적용Image Deep Learning 실무적용
Image Deep Learning 실무적용Youngjae Kim
 
딥러닝 세계에 입문하기 위반 분투
딥러닝 세계에 입문하기 위반 분투딥러닝 세계에 입문하기 위반 분투
딥러닝 세계에 입문하기 위반 분투Ubuntu Korea Community
 

Similar to One-Shot Learning (20)

Chapter 15 Representation learning - 1
Chapter 15 Representation learning - 1Chapter 15 Representation learning - 1
Chapter 15 Representation learning - 1
 
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
 
Nationality recognition
Nationality recognitionNationality recognition
Nationality recognition
 
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
 
[Tf2017] day4 jwkang_pub
[Tf2017] day4 jwkang_pub[Tf2017] day4 jwkang_pub
[Tf2017] day4 jwkang_pub
 
180624 mobile visionnet_baeksucon_jwkang_pub
180624 mobile visionnet_baeksucon_jwkang_pub180624 mobile visionnet_baeksucon_jwkang_pub
180624 mobile visionnet_baeksucon_jwkang_pub
 
Anomaly detection practive_using_deep_learning
Anomaly detection practive_using_deep_learningAnomaly detection practive_using_deep_learning
Anomaly detection practive_using_deep_learning
 
Deep neural networks cnn rnn_ae_some practical techniques
Deep neural networks cnn rnn_ae_some practical techniquesDeep neural networks cnn rnn_ae_some practical techniques
Deep neural networks cnn rnn_ae_some practical techniques
 
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
 
Deep learning seminar_snu_161031
Deep learning seminar_snu_161031Deep learning seminar_snu_161031
Deep learning seminar_snu_161031
 
Ml for 정형데이터
Ml for 정형데이터Ml for 정형데이터
Ml for 정형데이터
 
Deep learning overview
Deep learning overviewDeep learning overview
Deep learning overview
 
Deep Learning for Chatbot (4/4)
Deep Learning for Chatbot (4/4)Deep Learning for Chatbot (4/4)
Deep Learning for Chatbot (4/4)
 
Alpha Go Introduction
Alpha Go IntroductionAlpha Go Introduction
Alpha Go Introduction
 
쫄지말자딥러닝2 - CNN RNN 포함버전
쫄지말자딥러닝2 - CNN RNN 포함버전쫄지말자딥러닝2 - CNN RNN 포함버전
쫄지말자딥러닝2 - CNN RNN 포함버전
 
Distilling the knowledge in a neural network
Distilling the knowledge in a neural networkDistilling the knowledge in a neural network
Distilling the knowledge in a neural network
 
딥러닝 - 역사와 이론적 기초
딥러닝 - 역사와 이론적 기초딥러닝 - 역사와 이론적 기초
딥러닝 - 역사와 이론적 기초
 
PR-203: Class-Balanced Loss Based on Effective Number of Samples
PR-203: Class-Balanced Loss Based on Effective Number of SamplesPR-203: Class-Balanced Loss Based on Effective Number of Samples
PR-203: Class-Balanced Loss Based on Effective Number of Samples
 
Image Deep Learning 실무적용
Image Deep Learning 실무적용Image Deep Learning 실무적용
Image Deep Learning 실무적용
 
딥러닝 세계에 입문하기 위반 분투
딥러닝 세계에 입문하기 위반 분투딥러닝 세계에 입문하기 위반 분투
딥러닝 세계에 입문하기 위반 분투
 

One-Shot Learning

  • 1. One Shot Learning SK Telecom Video Tech. Lab. 김지성 Manager
  • 2. Contents Why do we need one-shot learning? What is one-shot learning? How to do “one-shot learning” Recap
  • 4. One Shot Learning: Learning a class from a single labelled example
  • 5. Giraffe Classification VS 어린이는 한 장의 기린 사진을 통해 기린이라는 Class의 Concept을 학습 가능함 DNN은 한 class를 학습하기 위해 수백장 or 수천장 필요함
  • 7. CNN Architecutre … 1. Batch Size (ex. 256장)씩 학습한다. (120만장씩 90번) 2. 최적화는 Gradient based Optimization ( Extensive, Incremental Training on Large DB ) 3. 새로운 Image에 대한 학습 반영이 느리다. 4. 그러므로 One-Shot Learning에 적합하지 않다!
  • 8. Machine Learning Principle: Test and Train conditions Must Match.
  • 9. Matching Networks Architecutre (deepmind, ‘16) 1. Test 할 때 1장만 보여주면서 학습할 때 수백장 보여주는게 좋을까? 2. 학습할 때도 한 class당 한장씩 만 보여주어야 한다! (or 5장) 3. g, f 는 입력을 embedding 하는 neural network (VGG, Inception) 4. Embedding을 통해 나온 feature vector들 사이의 유사도를 구한다. 5. 유사도의 weighted sum을 통해 최종 Test label을 결정
  • 10. Matching Networks Architecutre : Test Example Attention by Softmax & Cosine distance Candidate : Chihuahua Test Input : Shepherd Candidate : Retriever Candidate : Siberian Husky Candidate : Shepherd fc7 : 4096 dim CNN CNN : Test Label: Training Set
  • 11. Matching Networks Architecutre : Test Example It’s differentiable! End to End Nearest Neighbour Classifier Candidate : Chihuahua Test Input : Shepherd Candidate : Retriever Candidate : Siberian Husky Candidate : Shepherd fc7 : 4096 dim CNN CNN : Test Label: Training Set CNN CNN CNN Bi- LSTM LSTM
  • 12. Matching Networks Architecutre CNNCNNCNNCNN Bi-LSTM fc7 : 4096 dim fc7 : 4096 dim fc7 : 4096 dim fc7 : 4096 dim
  • 14. Recap Why do we need one-shot learning? If there is a few data for training/testing What is one-shot learning? Learning a class from a single labelled example How to do “one-shot learning” Start with Omniglot Example import tensorflow as tf
  • 17. One-Shot Learning How can we learn a novel concept from a few examples? (random guess will be 1/N)
  • 19. Problem Setting - Training Greek
  • 20. Problem Setting - Testing 1 Angelic 2 Oriya 3 Tibetan 4 Keble 5 ULOG 1 Angelic ? 2 Oriya 3 Tibetan ? 4 Keble 5 ULOG? = 1/N 한번은 정답을 알려준다. (One-shot) 새로운 Character에 대해 Test (5지 선다)
  • 21. Recent Papers about One Shot Learning One-shot Learning with Memory-Augmented Neural Networks a) Submitted on : 16.05.19 b) Written by : Deep Mind c) Link : https://arxiv.org/abs/1605.06065 Matching Networks for One Shot Learning a) Submitted on : 16.06.13 b) Written by : Deep Mind c) Link : https://arxiv.org/abs/1606.04080
  • 22. One Shot Learning with Memory Augmented Neural Network
  • 24. Neural Turing Machine vs Memory Augmented Neural Network 1. MANN은 NTM의 변형이다. 2. Controller는 Feed Forward NN or LSTM을 사용하였다. 3. 기존 NTM은 복사, 정렬등의 알고리즘을 학습하는데 사용하였지만 이 논문에서는 One-shot Learing에 사용 4. 빠른 학습을 위해 Memory에 Write할 때 가장 적게 사용된 메모리 or 가장 최근에 사용된 메모리에 Write함 (LRUA) 5. 그렇다면 기본적인 질문?! 왜 Augmented Memory가 필요할까?
  • 25. Why do we need Differentiable Memory? 잘 알려진 것 처럼 CNN is good for spatial structure (Image, … ) RNN is good for temporal structure (Audio, …)
  • 26. Augmenting Neural Nets with a Memory Module CNN + RNN is good for spatiotemporal structure (Video, …) 그렇다면 아주 간단한 Question & Answering 문제에서도 CNN 및 RNN or 그 조합이 잘 동작하는가?
  • 27. Augmenting Neural Nets with a Memory Module
  • 28. Augmenting Neural Nets with a Memory Module bAbI task Example Story Sam moved to the garden. Mary left the milk. John left the football. Daniel moved to the garden. Sam went to the kitchen. Sandra moved to the hallway. Mary moved to the hallway. Mary left the milk. Sam drops the apple there. Q : Where was the apple after the garden?
  • 29. Augmenting Neural Nets with a Memory Module bAbI task Example Story Sam moved to the garden. Mary left the milk. John left the football. Daniel moved to the garden. Sam went to the kitchen. Sandra moved to the hallway. Mary moved to the hallway. Mary left the milk. Sam drops the apple there. Q : Where was the apple after the garden?
  • 30. Augmenting Neural Nets with a Memory Module bAbI task Example Story Sam moved to the garden. Mary left the milk. John left the football. Daniel moved to the garden. Sam went to the kitchen. Sandra moved to the hallway. Mary moved to the hallway. Mary left the milk. Sam drops the apple there. Q : Where was the apple after the garden?
  • 31. Augmenting Neural Nets with a Memory Module bAbI task Example Story Sam moved to the garden. Mary left the milk. John left the football. Daniel moved to the garden. Sam went to the kitchen. Sandra moved to the hallway. Mary moved to the hallway. Mary left the milk. Sam drops the apple there. Q : Where was the apple after the garden?
  • 32. Augmenting Neural Nets with a Memory Module 즉! Data가 out-of-order인 경우 기존 CNN, RNN으로는 잘 해결되지 않는다. 현재 아래 구조의 data들에 대해서는 아직 다양한 노력 中 1. Out-of-order access (순차적이지 않은 접근) 2. 장기 기억 3. 정렬되지 않은 data
  • 33. Differentialble Memory : MemN2N 1. 단어를 one-hot vector로 변형한 뒤 A, B, C matrix를 통해 문장을 메모리화 2. Embedding 된 질문 문장(u)과의 inner product를 통해 Attention 결정 3. 구해진 attention과 입력 Output Memory와의 weighted sum을 통해 output matrix o 구함 4. 최종적으로 Softmax(W(u+o))를 고려해 답을 도출
  • 34. MANN - Task Setup 1. : Training Set 2. 입력이미지는 105 x 105  20 x 20  400 x 1 로 flatten 3. Time off-set labels 을 사용 (x_t, y_t-1) 하여 현재 결과가 다음 입력으로 들어가도록 구성
  • 35. MANN - Network Strategy 1. Episode = Task  학습에 사용한 Sequence (x_t, y_t-1) 2. 1 episode의 길이는 5 classes 일 경우에는 50, 10 classes일 경우에는 100 3. 학습은 이런 episode를 10만번 수행 하여 결과 도출
  • 36. MANN - Network Strategy 1. Time off-set labels 을 사용 (x_t, y_t-1) 하여 현재 결과가 다음 입력으로 들어가도록 구성 2. External Memory에는 (image, label) 쌍으로 저장해 놓는다. 3. External Memory에 새로 입력된 이미지와 유사도가 큰 이미지가 있으면 Read해서 결과를 도출한다.
  • 39. Omniglot classification - LSTM (15 way)
  • 40. Omniglot classification - MANN (15 way)
  • 41. Human vs MANN 1. 사람에게도 동일하게 한장의 사진을 보여준 뒤 1-5 사이의 숫자를 선택하게 하고 매 Instance 마다 정답을 알려줄 경우 1-shot의 경우 57.3% 정확도 2. 하지만 MANN은 82.8 % 정확도 3. 앞에서 설명한 Matching Net은 98.1% 정확도
  • 42. Summary 1. Internal Memory (CNN, RNN)는 새로운 information을 Internal Memory(Weights) 에 반영하는 속도가 느림. 2. External Memory (MemN2N, NTM)을 사용하면 빠르게 새로운 정보를 저장하고 검색하는 것이 가능함. (MANN) 3. Deep Neural Feature에 대한 Metric Learning 과 External Memory의 아이디어를 결합하여 Matching Network를 제안함 4. 학습에 필요한 이미지가 충분하지 않을 경우 큰 장점이 있지만 반대의 경우에는 State-of-the Art 대비 열세