SlideShare a Scribd company logo
Going deeper with convolutions
인연준
GoogLeNet : Inception models
2014년 ILSVRC에서 top-5 test error 6.7%로 우승!
1. Introduction
GoogLeNet 의 motivation
아주 단순하게도 image recognition model 의 성능을 높여보자
가장 쉬운 방법
NN의 depth와 width를 늘리는 것
문제
1. Parameter 개수 증가
2. computing resource 증가
→ overfitting
1. Introduction
GoogLeNet 은 이전 모델들 보다 더 deep하고 wide한 모델을 만들었는데
어떻게 더 좋은 성능을 얻을 수 있었을까?
2. Inception network의 아이디어
28 x 28 x 192
input
1 x 1 x 192 filter
3 x 3 x 192 filter
5 x 5 x 192 filter
Max pooling
32
128
64
32
output
28 x 28 x 256
2. Inception network의 아이디어
가장 기본적인 아이디어는 한 레이어 안에서 여러 종류의 필터를 병렬적으로 사용해서
네트워크가 알아서 parameter나 필터 크기의 조합을 학습하는 것
2. Inception network의 아이디어
1. 그냥
여러 크기의 필터를 병렬적으로 한번에 사용하게된 계기
1 x 1이 가장 좁은 scope
3 x 3이 약간 넓어진 scope
5 x 5이 더 넓어진 scope
얘네를 한번에 써볼까? 하는 아이디어
2. 어떤 크기의 필터를 고르는 것도 하나의 hyper-parameter
어떤 크기의 필터를 쓸지 고민하지 말고 그냥 한번에 다 써보자!
2. Inception network의 아이디어
가장 기본적인 아이디어는 한 레이어 안에서 여러 종류의 필터를 병렬적으로 사용해서
네트워크가 알아서 parameter나 필터 크기의 조합을 학습하는 것
근데 여기에 큰 문제가 하나 있다
2. Inception network의 아이디어
일반적인 ConvNet 보다 parameter가 엄청나게 많아짐
그래서 성능이 후졌다.
저 architecture를 유지하면서 연산량을 줄여야한다…
일반적인 ConvNet
inceptionNetwork의 Naive한 접근
2. Inception network의 아이디어
이 녀석이 추가가 됐다
어떤 역할을 하는지 살펴보자
그래서
3. 1 x 1 filter의 연산
* =
1 2 3 6 5 8
3 5 5 1 3 4
2 1 3 4 9 3
4 7 8 5 7 9
1 5 3 7 4 8
5 4 9 8 3 5
6 x 6
2 4 6 12 10 16
6 10 ,,, ,,, ,,, ,,,
,,, ,,, ,,, ,,, ,,,
6 x 6 x 32
*
1 x 1 x 32
=
3. 1 x 1 filter의 연산
* =
1 2 3 6 5 8
3 5 5 1 3 4
2 1 3 4 9 3
4 7 8 5 7 9
1 5 3 7 4 8
5 4 9 8 3 5
6 x 6
2 4 6 12 10 16
6 10 ,,, ,,, ,,, ,,,
,,, ,,, ,,, ,,, ,,,
* =
6 x 6 x 32 1 x 1 x 32
ReLU
3. 1 x 1 filter의 역할
1 x 1 filter를 사용함으로써 얻을 수 있는 이점
1. 채널 수 조절
2. 계산량 감소
3. 비선형성
3. 1 x 1 filter의 역할 – 채널 수 감소
높이, 너비, 채널 다 줄어든다
convolution
높이, 너비만 줄어든다
pooling
채널만 줄이고 싶다면?
?????
채널만 줄이고 싶다면?
1 x 1 filter가 유용하다
3. 1 x 1 filter의 역할 – 채널 수 감소
3. 1 x 1 filter의 역할 – 계산량 감소
5 x 5 filter로 Convolution 연산을 할 때의 계산량을 구해보자
192 x 5 x 5 x 28 x 28 x 32 = 1억 2천만
채널 수로 인한 연산
3. 1 x 1 filter의 역할 – 계산량 감소
1 x 1 filter로 채널수를 줄이고 5 x 5 convolution 연산을 할 때의 연산량은
192 x 1 x 1 x 28 x 28 x 16 16 x 5 x 5 x 28 x 28 x 32+
= 240만 = 1천만
1240만 / 1억2천만 = 0.1
채널 수로 인한 연산
3. 1 x 1 filter의 역할 – 계산량 감소
3 x 3, 5 x 5 같은 연산량이 많은 convolution 연산을 하기 전에
전처리 식으로 1 x 1 filter를 먼저 거쳐서 채널 수를 줄여준다
동일한 인풋 으로 5 x 5 convolution layer를 거치고 동일한 아웃풋이 나왔지만
1억 2천만 1240만
연산량은 10배 차이
3. 1 x 1 filter의 역할 – 비선형성
동일한 input과 동일한 output이지만
1 x 1 filter를 사용한 경우에는 ReLU를 두번 거치기 때문에 더 강한 비선형성
더 강하고 좋은 representation 학습 가능
4. GoogLeNet 파헤치기
Previous
Activation
28 x 28 x 192
1 x 1
CONV
5 x 5
CONV
16개
Output: 28 x 28 x 32
1 x 1
CONV
3 x 3
CONV96개
Output: 28 x 28 x 128
1 x 1
CONV
Output: 28 x 28 x 64
1 x 1
CONV
MAXPOOL
3 x 3
28 x 28 x 192
Output: 28 x 28 x 32
192가 너무 많아서 1 x 1 거친다
4. GoogLeNet 파헤치기
Previous
Activation
28 x 28 x 192
1 x 1
CONV
5 x 5
CONV
16개
1 x 1
CONV
3 x 3
CONV96개
1 x 1
CONV
1 x 1
CONV
MAXPOOL
3 x 3
28 x 28 x 192
192가 너무 많아서 1 x 1 거친다
Channel
Concat
Output: 28 x 28 x 256
4. GoogLeNet 파헤치기
이런 곁가지 들도 있다
4. GoogLeNet 파헤치기
처음에 이렇게 곁가지가 없는 형태였는데
네트워크가 워낙 깊다보니 ReLU를 사용했음에도
Gradient가 효과적으로 backprop되지 못하는 문제 발생
Given the relatively large depth of the network, the
ability to propagate gradients back through all the
layers in an effective manner was a concern.
4. GoogLeNet 파헤치기
그래서 중간에 이런 곁가지들을 만들었다
잘 안 보이는데 끝단의 FC net, softmax와 output layer랑 같은 구조다
즉 중간에 예측을 하는 곁가지들이다
신기하게도 중간 곁가지들이 strong performance를 보였고
얘네들도 학습에 이용한다.
4. GoogLeNet 파헤치기
저 곁가지들도 똑같이 Backprop을 하고,
loss 에 0.3이라는 가중치를 붙여서 전체 네트워크의 총 loss에 추가된다
이 구조가 regularization 효과를 가져왔다.
4. GoogLeNet 파헤치기
자세한 설명은 없었지만 뇌피셜로 생각해보면
1번 곁가지를 학습하면서 생기는 weight, 2번에서 생기는 weight, 끝단에서 생기는 weight가
합쳐지면서
끝단에서 overfitting을 유발했던 weight를 중화시키는 효과
1
2
최종 예측을 할때는 곁가지는 제거하고 사용
5. GoogLeNet In ILSVRC ILSVRC 2014 competition
…
1000개의 class label
120만개 training data
5만개 validation data
10만개 test data
metric
보통 Top-1 error rate, Top-5 error rate
data
이 두 가지를 많이 쓰는데
ILSVRC 2014에서는 Top-5 error만 사용
Top-5 error : 예측할 때 5개의 class label을 제시하고
그것 중 하나라도 맞으면 correct
Top-1 error : 예측할 때 1개의 class label을 제시하고
그것이 맞으면 correct
5. GoogLeNet In ILSVRC
이것이 GoogLeNet 으로 인셉션네트워크의 첫 시작이었다
이후에 인셉션 네트워크를 발전시킨 인셉션 v2 v3 v4 등이 나왔으니
다음에 다뤄보자!!
GoogLeNet 을 Keras로 구현한 깃헙 코드
https://gist.github.com/joelouismarino/a2ede9ab3928f99
9575423b9887abd14
reference
1. Andrew Ng 의 C4W2L05 강의
2. PR-034 : Inception and Xception
3. Going Deeper with Convolutions paper

More Related Content

What's hot

[DL輪読会]Active Domain Randomization
[DL輪読会]Active Domain Randomization[DL輪読会]Active Domain Randomization
[DL輪読会]Active Domain Randomization
Deep Learning JP
 
Neural networks
Neural networksNeural networks
Neural networks
Slideshare
 
PRML第6章「カーネル法」
PRML第6章「カーネル法」PRML第6章「カーネル法」
PRML第6章「カーネル法」
Keisuke Sugawara
 
データ解析2 線形代数の復習
データ解析2 線形代数の復習データ解析2 線形代数の復習
データ解析2 線形代数の復習
Hirotaka Hachiya
 
文献紹介:Learning From Noisy Labels With Deep Neural Networks: A Survey
文献紹介:Learning From Noisy Labels With Deep Neural Networks: A Survey文献紹介:Learning From Noisy Labels With Deep Neural Networks: A Survey
文献紹介:Learning From Noisy Labels With Deep Neural Networks: A Survey
Toru Tamaki
 
Chapter6.4
Chapter6.4Chapter6.4
Chapter6.4
Takuya Minagawa
 
Objects as points
Objects as pointsObjects as points
Objects as points
DADAJONJURAKUZIEV
 
Cnn 발표자료
Cnn 발표자료Cnn 발표자료
Cnn 발표자료
종현 최
 
분산 강화학습 논문(DeepMind IMPALA) 구현
분산 강화학습 논문(DeepMind IMPALA) 구현분산 강화학습 논문(DeepMind IMPALA) 구현
분산 강화학습 논문(DeepMind IMPALA) 구현
정주 김
 
1次式とノルムで構成された最適化問題とその双対問題
1次式とノルムで構成された最適化問題とその双対問題1次式とノルムで構成された最適化問題とその双対問題
1次式とノルムで構成された最適化問題とその双対問題
京都大学大学院情報学研究科数理工学専攻
 
Deep Learning & Convolutional Neural Network
Deep Learning & Convolutional Neural NetworkDeep Learning & Convolutional Neural Network
Deep Learning & Convolutional Neural Network
agdatalab
 
An Introduction to Spectral Graph Theory
An Introduction to Spectral Graph TheoryAn Introduction to Spectral Graph Theory
An Introduction to Spectral Graph Theory
joisino
 
CNN Tutorial
CNN TutorialCNN Tutorial
CNN Tutorial
Sungjoon Choi
 
Modern Convolutional Neural Network techniques for image segmentation
Modern Convolutional Neural Network techniques for image segmentationModern Convolutional Neural Network techniques for image segmentation
Modern Convolutional Neural Network techniques for image segmentation
Gioele Ciaparrone
 
강화학습 기초부터 DQN까지 (Reinforcement Learning from Basics to DQN)
강화학습 기초부터 DQN까지 (Reinforcement Learning from Basics to DQN)강화학습 기초부터 DQN까지 (Reinforcement Learning from Basics to DQN)
강화학습 기초부터 DQN까지 (Reinforcement Learning from Basics to DQN)
Curt Park
 
はじめてのパターン認識輪読会 10章後半
はじめてのパターン認識輪読会 10章後半はじめてのパターン認識輪読会 10章後半
はじめてのパターン認識輪読会 10章後半koba cky
 
[DL輪読会]Graph Convolutional Policy Network for Goal-Directed Molecular Graph G...
[DL輪読会]Graph Convolutional Policy Network for Goal-Directed Molecular Graph G...[DL輪読会]Graph Convolutional Policy Network for Goal-Directed Molecular Graph G...
[DL輪読会]Graph Convolutional Policy Network for Goal-Directed Molecular Graph G...
Deep Learning JP
 
ConvNetの歴史とResNet亜種、ベストプラクティス
ConvNetの歴史とResNet亜種、ベストプラクティスConvNetの歴史とResNet亜種、ベストプラクティス
ConvNetの歴史とResNet亜種、ベストプラクティス
Yusuke Uchida
 
Densenet CNN
Densenet CNNDensenet CNN
Densenet CNN
ArunKumar7374
 
[DL輪読会]Conditional Neural Processes
[DL輪読会]Conditional Neural Processes[DL輪読会]Conditional Neural Processes
[DL輪読会]Conditional Neural Processes
Deep Learning JP
 

What's hot (20)

[DL輪読会]Active Domain Randomization
[DL輪読会]Active Domain Randomization[DL輪読会]Active Domain Randomization
[DL輪読会]Active Domain Randomization
 
Neural networks
Neural networksNeural networks
Neural networks
 
PRML第6章「カーネル法」
PRML第6章「カーネル法」PRML第6章「カーネル法」
PRML第6章「カーネル法」
 
データ解析2 線形代数の復習
データ解析2 線形代数の復習データ解析2 線形代数の復習
データ解析2 線形代数の復習
 
文献紹介:Learning From Noisy Labels With Deep Neural Networks: A Survey
文献紹介:Learning From Noisy Labels With Deep Neural Networks: A Survey文献紹介:Learning From Noisy Labels With Deep Neural Networks: A Survey
文献紹介:Learning From Noisy Labels With Deep Neural Networks: A Survey
 
Chapter6.4
Chapter6.4Chapter6.4
Chapter6.4
 
Objects as points
Objects as pointsObjects as points
Objects as points
 
Cnn 발표자료
Cnn 발표자료Cnn 발표자료
Cnn 발표자료
 
분산 강화학습 논문(DeepMind IMPALA) 구현
분산 강화학습 논문(DeepMind IMPALA) 구현분산 강화학습 논문(DeepMind IMPALA) 구현
분산 강화학습 논문(DeepMind IMPALA) 구현
 
1次式とノルムで構成された最適化問題とその双対問題
1次式とノルムで構成された最適化問題とその双対問題1次式とノルムで構成された最適化問題とその双対問題
1次式とノルムで構成された最適化問題とその双対問題
 
Deep Learning & Convolutional Neural Network
Deep Learning & Convolutional Neural NetworkDeep Learning & Convolutional Neural Network
Deep Learning & Convolutional Neural Network
 
An Introduction to Spectral Graph Theory
An Introduction to Spectral Graph TheoryAn Introduction to Spectral Graph Theory
An Introduction to Spectral Graph Theory
 
CNN Tutorial
CNN TutorialCNN Tutorial
CNN Tutorial
 
Modern Convolutional Neural Network techniques for image segmentation
Modern Convolutional Neural Network techniques for image segmentationModern Convolutional Neural Network techniques for image segmentation
Modern Convolutional Neural Network techniques for image segmentation
 
강화학습 기초부터 DQN까지 (Reinforcement Learning from Basics to DQN)
강화학습 기초부터 DQN까지 (Reinforcement Learning from Basics to DQN)강화학습 기초부터 DQN까지 (Reinforcement Learning from Basics to DQN)
강화학습 기초부터 DQN까지 (Reinforcement Learning from Basics to DQN)
 
はじめてのパターン認識輪読会 10章後半
はじめてのパターン認識輪読会 10章後半はじめてのパターン認識輪読会 10章後半
はじめてのパターン認識輪読会 10章後半
 
[DL輪読会]Graph Convolutional Policy Network for Goal-Directed Molecular Graph G...
[DL輪読会]Graph Convolutional Policy Network for Goal-Directed Molecular Graph G...[DL輪読会]Graph Convolutional Policy Network for Goal-Directed Molecular Graph G...
[DL輪読会]Graph Convolutional Policy Network for Goal-Directed Molecular Graph G...
 
ConvNetの歴史とResNet亜種、ベストプラクティス
ConvNetの歴史とResNet亜種、ベストプラクティスConvNetの歴史とResNet亜種、ベストプラクティス
ConvNetの歴史とResNet亜種、ベストプラクティス
 
Densenet CNN
Densenet CNNDensenet CNN
Densenet CNN
 
[DL輪読会]Conditional Neural Processes
[DL輪読会]Conditional Neural Processes[DL輪読会]Conditional Neural Processes
[DL輪読会]Conditional Neural Processes
 

Similar to GoogLenet

History of Vision AI
History of Vision AIHistory of Vision AI
History of Vision AI
Tae Young Lee
 
[컴퓨터비전과 인공지능] 7. 합성곱 신경망 2
[컴퓨터비전과 인공지능] 7. 합성곱 신경망 2[컴퓨터비전과 인공지능] 7. 합성곱 신경망 2
[컴퓨터비전과 인공지능] 7. 합성곱 신경망 2
jdo
 
HistoryOfCNN
HistoryOfCNNHistoryOfCNN
HistoryOfCNN
Tae Young Lee
 
Convolutional neural networks
Convolutional neural networksConvolutional neural networks
Convolutional neural networks
HyunjinBae3
 
Image Deep Learning 실무적용
Image Deep Learning 실무적용Image Deep Learning 실무적용
Image Deep Learning 실무적용
Youngjae Kim
 
[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 4 - ResNet
[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 4 - ResNet[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 4 - ResNet
[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 4 - ResNet
jdo
 
03.12 cnn backpropagation
03.12 cnn backpropagation03.12 cnn backpropagation
03.12 cnn backpropagation
Dea-hwan Ki
 
밑바닥부터 시작하는딥러닝 8장
밑바닥부터 시작하는딥러닝 8장밑바닥부터 시작하는딥러닝 8장
밑바닥부터 시작하는딥러닝 8장
Sunggon Song
 
Deep learning overview
Deep learning overviewDeep learning overview
Deep learning overview
강민국 강민국
 
Denoising auto encoders(d a)
Denoising auto encoders(d a)Denoising auto encoders(d a)
Denoising auto encoders(d a)
Tae Young Lee
 
[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 3 - GoogLeNet
[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 3 - GoogLeNet[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 3 - GoogLeNet
[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 3 - GoogLeNet
jdo
 
CNN
CNNCNN
CNN
chs71
 
인공지능, 기계학습 그리고 딥러닝
인공지능, 기계학습 그리고 딥러닝인공지능, 기계학습 그리고 딥러닝
인공지능, 기계학습 그리고 딥러닝
Jinwon Lee
 
[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 2 - ZFNet, VGG-16
 [컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 2 - ZFNet, VGG-16 [컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 2 - ZFNet, VGG-16
[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 2 - ZFNet, VGG-16
jdo
 
Bag of Tricks for Image Classification with Convolutional Neural Networks (C...
Bag of Tricks for Image Classification  with Convolutional Neural Networks (C...Bag of Tricks for Image Classification  with Convolutional Neural Networks (C...
Bag of Tricks for Image Classification with Convolutional Neural Networks (C...
gohyunwoong
 
Image net classification with deep convolutional neural networks
Image net classification with deep convolutional neural networks Image net classification with deep convolutional neural networks
Image net classification with deep convolutional neural networks
Korea, Sejong University.
 
Supervised Constrastive Learning
Supervised Constrastive LearningSupervised Constrastive Learning
Supervised Constrastive Learning
Sungchul Kim
 
네트워크 경량화 이모저모 @ 2020 DLD
네트워크 경량화 이모저모 @ 2020 DLD네트워크 경량화 이모저모 @ 2020 DLD
네트워크 경량화 이모저모 @ 2020 DLD
Kim Junghoon
 
AlexNet, VGG, GoogleNet, Resnet
AlexNet, VGG, GoogleNet, ResnetAlexNet, VGG, GoogleNet, Resnet
AlexNet, VGG, GoogleNet, Resnet
Jungwon Kim
 

Similar to GoogLenet (20)

History of Vision AI
History of Vision AIHistory of Vision AI
History of Vision AI
 
[컴퓨터비전과 인공지능] 7. 합성곱 신경망 2
[컴퓨터비전과 인공지능] 7. 합성곱 신경망 2[컴퓨터비전과 인공지능] 7. 합성곱 신경망 2
[컴퓨터비전과 인공지능] 7. 합성곱 신경망 2
 
HistoryOfCNN
HistoryOfCNNHistoryOfCNN
HistoryOfCNN
 
Convolutional neural networks
Convolutional neural networksConvolutional neural networks
Convolutional neural networks
 
Image Deep Learning 실무적용
Image Deep Learning 실무적용Image Deep Learning 실무적용
Image Deep Learning 실무적용
 
[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 4 - ResNet
[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 4 - ResNet[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 4 - ResNet
[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 4 - ResNet
 
03.12 cnn backpropagation
03.12 cnn backpropagation03.12 cnn backpropagation
03.12 cnn backpropagation
 
밑바닥부터 시작하는딥러닝 8장
밑바닥부터 시작하는딥러닝 8장밑바닥부터 시작하는딥러닝 8장
밑바닥부터 시작하는딥러닝 8장
 
Deep learning overview
Deep learning overviewDeep learning overview
Deep learning overview
 
Denoising auto encoders(d a)
Denoising auto encoders(d a)Denoising auto encoders(d a)
Denoising auto encoders(d a)
 
[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 3 - GoogLeNet
[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 3 - GoogLeNet[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 3 - GoogLeNet
[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 3 - GoogLeNet
 
CNN
CNNCNN
CNN
 
인공지능, 기계학습 그리고 딥러닝
인공지능, 기계학습 그리고 딥러닝인공지능, 기계학습 그리고 딥러닝
인공지능, 기계학습 그리고 딥러닝
 
[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 2 - ZFNet, VGG-16
 [컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 2 - ZFNet, VGG-16 [컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 2 - ZFNet, VGG-16
[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 2 - ZFNet, VGG-16
 
Bag of Tricks for Image Classification with Convolutional Neural Networks (C...
Bag of Tricks for Image Classification  with Convolutional Neural Networks (C...Bag of Tricks for Image Classification  with Convolutional Neural Networks (C...
Bag of Tricks for Image Classification with Convolutional Neural Networks (C...
 
Image net classification with deep convolutional neural networks
Image net classification with deep convolutional neural networks Image net classification with deep convolutional neural networks
Image net classification with deep convolutional neural networks
 
Supervised Constrastive Learning
Supervised Constrastive LearningSupervised Constrastive Learning
Supervised Constrastive Learning
 
네트워크 경량화 이모저모 @ 2020 DLD
네트워크 경량화 이모저모 @ 2020 DLD네트워크 경량화 이모저모 @ 2020 DLD
네트워크 경량화 이모저모 @ 2020 DLD
 
Gan
GanGan
Gan
 
AlexNet, VGG, GoogleNet, Resnet
AlexNet, VGG, GoogleNet, ResnetAlexNet, VGG, GoogleNet, Resnet
AlexNet, VGG, GoogleNet, Resnet
 

More from KyeongUkJang

Photo wake up - 3d character animation from a single photo
Photo wake up - 3d character animation from a single photoPhoto wake up - 3d character animation from a single photo
Photo wake up - 3d character animation from a single photo
KyeongUkJang
 
AlphagoZero
AlphagoZeroAlphagoZero
AlphagoZero
KyeongUkJang
 
GAN - Generative Adversarial Nets
GAN - Generative Adversarial NetsGAN - Generative Adversarial Nets
GAN - Generative Adversarial Nets
KyeongUkJang
 
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
KyeongUkJang
 
Latent Dirichlet Allocation
Latent Dirichlet AllocationLatent Dirichlet Allocation
Latent Dirichlet Allocation
KyeongUkJang
 
Gaussian Mixture Model
Gaussian Mixture ModelGaussian Mixture Model
Gaussian Mixture Model
KyeongUkJang
 
CNN for sentence classification
CNN for sentence classificationCNN for sentence classification
CNN for sentence classification
KyeongUkJang
 
Visualizing data using t-SNE
Visualizing data using t-SNEVisualizing data using t-SNE
Visualizing data using t-SNE
KyeongUkJang
 
Playing atari with deep reinforcement learning
Playing atari with deep reinforcement learningPlaying atari with deep reinforcement learning
Playing atari with deep reinforcement learning
KyeongUkJang
 
Chapter 20 - GAN
Chapter 20 - GANChapter 20 - GAN
Chapter 20 - GAN
KyeongUkJang
 
Chapter 20 - VAE
Chapter 20 - VAEChapter 20 - VAE
Chapter 20 - VAE
KyeongUkJang
 
Chapter 20 Deep generative models
Chapter 20 Deep generative modelsChapter 20 Deep generative models
Chapter 20 Deep generative models
KyeongUkJang
 
Chapter 19 Variational Inference
Chapter 19 Variational InferenceChapter 19 Variational Inference
Chapter 19 Variational Inference
KyeongUkJang
 
Natural Language Processing(NLP) - basic 2
Natural Language Processing(NLP) - basic 2Natural Language Processing(NLP) - basic 2
Natural Language Processing(NLP) - basic 2
KyeongUkJang
 
Natural Language Processing(NLP) - Basic
Natural Language Processing(NLP) - BasicNatural Language Processing(NLP) - Basic
Natural Language Processing(NLP) - Basic
KyeongUkJang
 
Chapter 17 monte carlo methods
Chapter 17 monte carlo methodsChapter 17 monte carlo methods
Chapter 17 monte carlo methods
KyeongUkJang
 
Chapter 16 structured probabilistic models for deep learning - 2
Chapter 16 structured probabilistic models for deep learning - 2Chapter 16 structured probabilistic models for deep learning - 2
Chapter 16 structured probabilistic models for deep learning - 2
KyeongUkJang
 
Chapter 16 structured probabilistic models for deep learning - 1
Chapter 16 structured probabilistic models for deep learning - 1Chapter 16 structured probabilistic models for deep learning - 1
Chapter 16 structured probabilistic models for deep learning - 1
KyeongUkJang
 
Chapter 15 Representation learning - 2
Chapter 15 Representation learning - 2Chapter 15 Representation learning - 2
Chapter 15 Representation learning - 2
KyeongUkJang
 

More from KyeongUkJang (20)

Photo wake up - 3d character animation from a single photo
Photo wake up - 3d character animation from a single photoPhoto wake up - 3d character animation from a single photo
Photo wake up - 3d character animation from a single photo
 
YOLO
YOLOYOLO
YOLO
 
AlphagoZero
AlphagoZeroAlphagoZero
AlphagoZero
 
GAN - Generative Adversarial Nets
GAN - Generative Adversarial NetsGAN - Generative Adversarial Nets
GAN - Generative Adversarial Nets
 
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
 
Latent Dirichlet Allocation
Latent Dirichlet AllocationLatent Dirichlet Allocation
Latent Dirichlet Allocation
 
Gaussian Mixture Model
Gaussian Mixture ModelGaussian Mixture Model
Gaussian Mixture Model
 
CNN for sentence classification
CNN for sentence classificationCNN for sentence classification
CNN for sentence classification
 
Visualizing data using t-SNE
Visualizing data using t-SNEVisualizing data using t-SNE
Visualizing data using t-SNE
 
Playing atari with deep reinforcement learning
Playing atari with deep reinforcement learningPlaying atari with deep reinforcement learning
Playing atari with deep reinforcement learning
 
Chapter 20 - GAN
Chapter 20 - GANChapter 20 - GAN
Chapter 20 - GAN
 
Chapter 20 - VAE
Chapter 20 - VAEChapter 20 - VAE
Chapter 20 - VAE
 
Chapter 20 Deep generative models
Chapter 20 Deep generative modelsChapter 20 Deep generative models
Chapter 20 Deep generative models
 
Chapter 19 Variational Inference
Chapter 19 Variational InferenceChapter 19 Variational Inference
Chapter 19 Variational Inference
 
Natural Language Processing(NLP) - basic 2
Natural Language Processing(NLP) - basic 2Natural Language Processing(NLP) - basic 2
Natural Language Processing(NLP) - basic 2
 
Natural Language Processing(NLP) - Basic
Natural Language Processing(NLP) - BasicNatural Language Processing(NLP) - Basic
Natural Language Processing(NLP) - Basic
 
Chapter 17 monte carlo methods
Chapter 17 monte carlo methodsChapter 17 monte carlo methods
Chapter 17 monte carlo methods
 
Chapter 16 structured probabilistic models for deep learning - 2
Chapter 16 structured probabilistic models for deep learning - 2Chapter 16 structured probabilistic models for deep learning - 2
Chapter 16 structured probabilistic models for deep learning - 2
 
Chapter 16 structured probabilistic models for deep learning - 1
Chapter 16 structured probabilistic models for deep learning - 1Chapter 16 structured probabilistic models for deep learning - 1
Chapter 16 structured probabilistic models for deep learning - 1
 
Chapter 15 Representation learning - 2
Chapter 15 Representation learning - 2Chapter 15 Representation learning - 2
Chapter 15 Representation learning - 2
 

GoogLenet

  • 1. Going deeper with convolutions 인연준
  • 2. GoogLeNet : Inception models 2014년 ILSVRC에서 top-5 test error 6.7%로 우승!
  • 3. 1. Introduction GoogLeNet 의 motivation 아주 단순하게도 image recognition model 의 성능을 높여보자 가장 쉬운 방법 NN의 depth와 width를 늘리는 것 문제 1. Parameter 개수 증가 2. computing resource 증가 → overfitting
  • 4. 1. Introduction GoogLeNet 은 이전 모델들 보다 더 deep하고 wide한 모델을 만들었는데 어떻게 더 좋은 성능을 얻을 수 있었을까?
  • 5. 2. Inception network의 아이디어 28 x 28 x 192 input 1 x 1 x 192 filter 3 x 3 x 192 filter 5 x 5 x 192 filter Max pooling 32 128 64 32 output 28 x 28 x 256
  • 6. 2. Inception network의 아이디어 가장 기본적인 아이디어는 한 레이어 안에서 여러 종류의 필터를 병렬적으로 사용해서 네트워크가 알아서 parameter나 필터 크기의 조합을 학습하는 것
  • 7. 2. Inception network의 아이디어 1. 그냥 여러 크기의 필터를 병렬적으로 한번에 사용하게된 계기 1 x 1이 가장 좁은 scope 3 x 3이 약간 넓어진 scope 5 x 5이 더 넓어진 scope 얘네를 한번에 써볼까? 하는 아이디어 2. 어떤 크기의 필터를 고르는 것도 하나의 hyper-parameter 어떤 크기의 필터를 쓸지 고민하지 말고 그냥 한번에 다 써보자!
  • 8. 2. Inception network의 아이디어 가장 기본적인 아이디어는 한 레이어 안에서 여러 종류의 필터를 병렬적으로 사용해서 네트워크가 알아서 parameter나 필터 크기의 조합을 학습하는 것 근데 여기에 큰 문제가 하나 있다
  • 9. 2. Inception network의 아이디어 일반적인 ConvNet 보다 parameter가 엄청나게 많아짐 그래서 성능이 후졌다. 저 architecture를 유지하면서 연산량을 줄여야한다… 일반적인 ConvNet inceptionNetwork의 Naive한 접근
  • 10. 2. Inception network의 아이디어 이 녀석이 추가가 됐다 어떤 역할을 하는지 살펴보자 그래서
  • 11. 3. 1 x 1 filter의 연산 * = 1 2 3 6 5 8 3 5 5 1 3 4 2 1 3 4 9 3 4 7 8 5 7 9 1 5 3 7 4 8 5 4 9 8 3 5 6 x 6 2 4 6 12 10 16 6 10 ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, 6 x 6 x 32 * 1 x 1 x 32 =
  • 12. 3. 1 x 1 filter의 연산 * = 1 2 3 6 5 8 3 5 5 1 3 4 2 1 3 4 9 3 4 7 8 5 7 9 1 5 3 7 4 8 5 4 9 8 3 5 6 x 6 2 4 6 12 10 16 6 10 ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, * = 6 x 6 x 32 1 x 1 x 32 ReLU
  • 13. 3. 1 x 1 filter의 역할 1 x 1 filter를 사용함으로써 얻을 수 있는 이점 1. 채널 수 조절 2. 계산량 감소 3. 비선형성
  • 14. 3. 1 x 1 filter의 역할 – 채널 수 감소 높이, 너비, 채널 다 줄어든다 convolution 높이, 너비만 줄어든다 pooling 채널만 줄이고 싶다면? ?????
  • 15. 채널만 줄이고 싶다면? 1 x 1 filter가 유용하다 3. 1 x 1 filter의 역할 – 채널 수 감소
  • 16. 3. 1 x 1 filter의 역할 – 계산량 감소 5 x 5 filter로 Convolution 연산을 할 때의 계산량을 구해보자 192 x 5 x 5 x 28 x 28 x 32 = 1억 2천만 채널 수로 인한 연산
  • 17. 3. 1 x 1 filter의 역할 – 계산량 감소 1 x 1 filter로 채널수를 줄이고 5 x 5 convolution 연산을 할 때의 연산량은 192 x 1 x 1 x 28 x 28 x 16 16 x 5 x 5 x 28 x 28 x 32+ = 240만 = 1천만 1240만 / 1억2천만 = 0.1 채널 수로 인한 연산
  • 18. 3. 1 x 1 filter의 역할 – 계산량 감소 3 x 3, 5 x 5 같은 연산량이 많은 convolution 연산을 하기 전에 전처리 식으로 1 x 1 filter를 먼저 거쳐서 채널 수를 줄여준다 동일한 인풋 으로 5 x 5 convolution layer를 거치고 동일한 아웃풋이 나왔지만 1억 2천만 1240만 연산량은 10배 차이
  • 19. 3. 1 x 1 filter의 역할 – 비선형성 동일한 input과 동일한 output이지만 1 x 1 filter를 사용한 경우에는 ReLU를 두번 거치기 때문에 더 강한 비선형성 더 강하고 좋은 representation 학습 가능
  • 20. 4. GoogLeNet 파헤치기 Previous Activation 28 x 28 x 192 1 x 1 CONV 5 x 5 CONV 16개 Output: 28 x 28 x 32 1 x 1 CONV 3 x 3 CONV96개 Output: 28 x 28 x 128 1 x 1 CONV Output: 28 x 28 x 64 1 x 1 CONV MAXPOOL 3 x 3 28 x 28 x 192 Output: 28 x 28 x 32 192가 너무 많아서 1 x 1 거친다
  • 21. 4. GoogLeNet 파헤치기 Previous Activation 28 x 28 x 192 1 x 1 CONV 5 x 5 CONV 16개 1 x 1 CONV 3 x 3 CONV96개 1 x 1 CONV 1 x 1 CONV MAXPOOL 3 x 3 28 x 28 x 192 192가 너무 많아서 1 x 1 거친다 Channel Concat Output: 28 x 28 x 256
  • 22. 4. GoogLeNet 파헤치기 이런 곁가지 들도 있다
  • 23. 4. GoogLeNet 파헤치기 처음에 이렇게 곁가지가 없는 형태였는데 네트워크가 워낙 깊다보니 ReLU를 사용했음에도 Gradient가 효과적으로 backprop되지 못하는 문제 발생 Given the relatively large depth of the network, the ability to propagate gradients back through all the layers in an effective manner was a concern.
  • 24. 4. GoogLeNet 파헤치기 그래서 중간에 이런 곁가지들을 만들었다 잘 안 보이는데 끝단의 FC net, softmax와 output layer랑 같은 구조다 즉 중간에 예측을 하는 곁가지들이다 신기하게도 중간 곁가지들이 strong performance를 보였고 얘네들도 학습에 이용한다.
  • 25. 4. GoogLeNet 파헤치기 저 곁가지들도 똑같이 Backprop을 하고, loss 에 0.3이라는 가중치를 붙여서 전체 네트워크의 총 loss에 추가된다 이 구조가 regularization 효과를 가져왔다.
  • 26. 4. GoogLeNet 파헤치기 자세한 설명은 없었지만 뇌피셜로 생각해보면 1번 곁가지를 학습하면서 생기는 weight, 2번에서 생기는 weight, 끝단에서 생기는 weight가 합쳐지면서 끝단에서 overfitting을 유발했던 weight를 중화시키는 효과 1 2 최종 예측을 할때는 곁가지는 제거하고 사용
  • 27. 5. GoogLeNet In ILSVRC ILSVRC 2014 competition … 1000개의 class label 120만개 training data 5만개 validation data 10만개 test data metric 보통 Top-1 error rate, Top-5 error rate data 이 두 가지를 많이 쓰는데 ILSVRC 2014에서는 Top-5 error만 사용 Top-5 error : 예측할 때 5개의 class label을 제시하고 그것 중 하나라도 맞으면 correct Top-1 error : 예측할 때 1개의 class label을 제시하고 그것이 맞으면 correct
  • 28. 5. GoogLeNet In ILSVRC
  • 29. 이것이 GoogLeNet 으로 인셉션네트워크의 첫 시작이었다 이후에 인셉션 네트워크를 발전시킨 인셉션 v2 v3 v4 등이 나왔으니 다음에 다뤄보자!!
  • 30. GoogLeNet 을 Keras로 구현한 깃헙 코드 https://gist.github.com/joelouismarino/a2ede9ab3928f99 9575423b9887abd14
  • 31. reference 1. Andrew Ng 의 C4W2L05 강의 2. PR-034 : Inception and Xception 3. Going Deeper with Convolutions paper