SlideShare ist ein Scribd-Unternehmen logo
1 von 52
2017.01.23
이승은
A Beginner’s Guide to Understanding CNN
Convolutional Neural Networks
2
언제 쓰는지?
어떻게 쓰는지?
….
이게 뭔지….?
모델 자체에 대한 이해 중심으로….
(용어 + 약간의 수리적 설명)
3
아마도 마지막장에선…
을 설명할 수 있을 것입니다!
Convolutional Layer, Activation Layer(ReLU), Pooling Layer,
Fully Connected Layer, Dropout 에 대한 개념 및 역할
Kernel Size, Stride, Padding에 대한 개념
4
Convolutional Neural Nets
이미지 분류
패턴 인식을 통해 기존 정보를 일반화하여 다른 환경의 이미지에 대해서도 잘 분류함. Sparse Connectivity 한 특징이 있음.
http://www.slideshare.net/zukun/p03-neural-networks-cvpr2012-deep-learning-methods-for-vision
내가 발견하고자 하는 대상(labeled object: 아인슈타인)이 어떨땐 배경에 파묻혀있음
배경과 대상을 잘 분리하여 detect하려면 절대적인 위치보다 상대적 위치를 고려하는 게 중요함
거기다 계산량도 줄어듬!
5
CNN: Input과 Output
Input
0~255
Depth(R,G,B)
Channel
Output
0.8
0.15
0.05
cat
dog
bird
Width
Height
6
A Classical CNN Architecture
https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/
7
A Classical CNN Architecture
convolutional layer를 줄여서 conv layer로 많이 표현함
Convolutional Layer
모든 Input이 거쳐가는 첫번째 Layer
Feature를 detect하는 역할을 수행
Low level feature High level feature
8
Convolution 단어의 뜻…?
Convolutional Neural Network
Convolutional Layer
9
Convolution
http://www.dictionary.com/browse/convolution?s=t
10
이미지를 빨간 사각형에서 초록 사각형으로
rolling하며 detect하는 것
Convolutional Layer를 생각하면 떠오르는 느낌을 설명하자면…
11
Convolutional Layer
32
32
Input image
Activation map
(Feature map)
28
28
Filter 5 x 5 x 3 (rgb)
x 3 (rgb)
input, output 확인
width, height, depth(channel) 확인
https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/
12
Filter와 (Local) Receptive Field
Filter Size = Receptive Field
(height, width, depth 모두 똑같음)
그러나 이 둘은 다른 것!
https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/
13
Filter는 detect하고자 하는 feature에 대한 내용이 담긴 사각형
Receptive Field는 이미지 위를 filter size로 rolling하며 detect되는 실제 feature
kernel, weights
neuron
https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/
14
Activation Map (Feature Map)
해당 receptive field에 fiter에서 detect하고자 하는 feature가 있는지 없는지 알려줌
•
•
= 6600
= 0
(50x30)+(20x30)+(50x30)+(50x30)+(50x30)
있다!
없다!
•
https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/
15
잠깐 쉬어가는 기호 얘기, * 와
Element-wise multiplication(앞장의 계산)을 설명할 때 어디서는 * 이걸 쓰고 어떨 땐 를 씁니다.
수리적으로 굉장히 다른 표현인데… 뭐가 맞는 건가요?
http://stats.stackexchange.com/questions/161093/how-exactly-do-convolutional-neural-networks-use-convolution-in-place-of-matrix
Output이 1개일 때는 (inner product)를 쓰시고
Output이 1개 이상일 때는 * (convolution)을 쓰시면 됩
니다
드디어 시간이 되었습니다… 싫지만 봐야하는 수리적 표현을 보시죠 ㅠㅠ
???난희??
Element-wise multiplication은 “Hadamard Product”라고 주장하는 분들도 있는데 안타깝게도 이에 대한 수리적인 표현이 없습니다 ㅠ
ㅠ
그래도 통념상 이해하기 쉬운 수식을 써야 소통이 원활할 것 같아서 찾아봤어요. 물론 아래 말고 이거나 이걸 쓰자고 하는 분들
도 있긴 합니다.
∘ ⊙
16
http://yann.lecun.com/exdb/publis/pdf/lecun-98.pdf
CNN의 시작은 언제일까?
http://yann.lecun.com/exdb/publis/pdf/lecun-99.pdf
CNN의 시초(?)라 불리는 Yann LeCun의 논문들을 살펴보았다.
LeNet-5가 CNN의 시작이었죠
아래가 시초라 불리는 대표적인 두 논문… 물론 가끔 다른 논문들을 시초로 언급해서 헷갈리지만 ㅠㅠ
그리고 Habel and Wiesel(1962), Fukushima(1975), LeCun(1986) 등등 비슷한 개념으로 시초를 얘기하자면… 끝도 없이 다른 걸 찾을 수도 있구용…
Convolution에 대한 수리적 정의를 정확히 찾기 위해…
17
하지만 수리적 Convolution에 대한 정의는 안보인다…ㅜㅜ
http://yann.lecun.com/exdb/publis/pdf/lecun-99.pdf
두 논문을 보면, 하기와 같이 동일한 문단이 있다.
그리고 shift 라는 단어가 보인다.
관련될 만한 reference도 눈에 잘 안 보임…
18
(Discrete) Convolution의 수리적 정의
https://en.wikipedia.org/wiki/Convolution
For complex-valued functions f, g defined on the set Z of integers, the discrete convolution of f and g
is given by:
The convolution of two finite sequences is defined by extending the sequences to finitely supported
functions on the set of integers. When the sequences are the coefficients of two polynomials, then the
coefficients of the ordinary product of the two polynomials are the convolution of the original two
sequences. This is known as the Cauchy product of the coefficients of the sequences.
Thus when g has finite support in the set{-M,-M+1, … ,M-1,M} (representing, for instance, a finite
impulse response), a finite summation may be used:
Cauchy product의 generalization은 inner product….
이미지 g (filter)에 마치 f (receptive field)가 움직이면서 f와 곱해서 합하는 맥락상 비슷한 느낌…
사실 Convolution과 일반적인 수리적 정의의 신호처리 Convolution과 완전히 다른 거라는 얘기도 있긴 하지만…
그래도 일단위키피디아에서 비슷해보이는 정의를 찾아보자!
(교환법칙 성립)
19
Activation Map(Feature Map)의 크기는 어떻게 계산할까?
(output이 1개의 scalar 값이라면….)
32 32-5+1=28
28
Activation Map Size = Input Size - Filter Size + 1
굉장히 먼 길을 헤맸…다시 activation map으로 돌아오면!
가로 X 세로…?
https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/
20
[심화과정] Activation Map(Feature Map)의 크기는 어떻게 계산할까?
Stride: 몇 pixel씩 filter가 convolving하는지 결정하는 값
• Stride 값이 클수록 overlapping이 덜하고 계산량도 output(activation map) 크기가 작아짐
• 정답은 없으나 Karen Simonyan&Andrew Zisserman 논문에선 stride 값을 1로 설정하여 overlapping
을 통해 feature detection을 잘할 수 있도록 제안함
• 만약 가장 큰 stride 값을 구하고 싶으면, (input size-filter size)값을 1보다 큰 소수(2,3,5, …)로 나눠서 떨
어지는 경우가 있으면 해당 값(몫)을 stride값으로 할 수 있음.
Input: 7 x 7 / Filter: 3 x 3 / Stride: 1 Input: 7 x 7 / Filter: 3 x 3 / Stride: 2
Output(activation map) 크기: (7-3)/1+1 Output(activation map) 크기: (7-3)/2+1
https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/
21
[심화과정] Activation Map(Feature Map)의 크기는 어떻게 계산할까?
Zero Padding: activation map이 input 데이터와 동일한 크기를 유지하기 위해 사용하
는 값
• Conv layer과정에서 output 크기가 줄어드는데 원본 input 데이터에 대한 손실을 방지하는 효과가 있음
Output(activation map) 크기: (32-5)/1+1 = 28
Input: 32 x 32 / Filter: 5 x 5 / Stride: 1 / Zero Padding: 0 일때,
Input: 32 x 32 / Filter: 5 x 5 / Stride: 1 / Zero Padding: 2 일때,
Zero Padding된 Input 크기: 32 + 2 x 2 = 36
Output(activation map) 크기: (32-5+2*2)/1+1 = 32
Zero Padding 값은 얼마로 정해야할까?
Stride가 1일때
( Filter Size - 1 ) / 2
filter 1개 만큼 더 움직이려면 filter size -1 만큼이 필요하고
이 0들을 양쪽에 둬야하니 2로 나눔
https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/
22
[심화과정] Activation Map(Feature Map)의 크기는 어떻게 계산할까?
Output Size = (Input Size+ 2 x Padding - Filter Size) / Stride +1
Padding이 있을 경우 반영된 Input 크기
(Stride가 1일때) Input 크기에서 Filter 크기를 빼면, 남을 filter의 convolving 횟수가 나옴
(Stride가 1이 아닐때) filter의 가능한 convolving 횟수를 stride값으로 나눔
Convolving하기 전, 첫번째 filter가 input과 inner product를 수행한 횟수
23
Activation Map(Feature Map)의 depth는 얼마일까?
R
G
B
정답:
Filter의 갯수와 같음!
http://cs231n.github.io/convolutional-networks/
힌트 1. Input channel이 여러개인 경우에는 inner product 결과에 대한 partial-sum을 수행한다.
고로, RGB 세 종류의 input이 3개의 filter를 적용한 결과는 하나의 scalar 값이다.
http://linleygroup.com/mpr/article.php?id=11561
힌트 2. Filter는 여러개를 쓸 수 있다.
Shared Weights한 특징
파란색 상자(local receptive fields)는 convolving하
며 계속 바뀌지만 빨간색 상자(filter, weight)는 변
하지 않음
어떤 receptive field에 유용한 feature라면 다른
receptive field에도 유용할 것이라는 가정에 근거
함
24
실제 Conv Layer에서의 계산 구현 방법은…?
http://www.rle.mit.edu/eems/wp-content/uploads/2016/11/Tutorial-on-DNN-All-Parts.pdf
Kernel Computation인 matrix multiplication을 어떻게 구현할까? MIT의 ‘Hardware Architecture for DNN’ 자료인데 여기선 convolution 계
산으로 간주하고 Toeplitz matrix에 대한 cross product로 변환해서 풀었네요. 하지만 이 부분은 수식을 좀 더 확인해봐야할 것 같아요.
(저도 다보기 너무 힘들어서 여기까지만 ㅠㅠ)
25
Activation Layer
• Conv Layer 바로 다음에 사용하는 nonlinear layer
(Conv layer의 output을 activation map이라고 부르는 이유!)
다시 CNN의 classical architecture를 확인하면…
26
Nonlinear Layer가 왜 필요한 것인가…?
만약 Nonlinear Layer가 없다면,
만약 Conv Layer만 있다면,
Only Matrix 연산만 하게 되고…
그럼 Linear한 단순한 문제밖에 못 풀게 됨
universal function approximator. http://www.statistics4u.com/fundstat_eng/cc_linvsnonlin.html
x*x*x*x는 그냥 x^4로 한번에 계산해버리는 게 나음
27
Systematic evaluation of CNN advances on the ImageNet
Nonlinear layer가 없으면 성능이 나쁨 ( 정확도가 낮아요 ㅠㅠ )
안 쓰는 경우
28
Activation Layer엔 뭐가 있냐면…
전통적인(conventional) activation layer: sigmoid, tanh
하지만 요즘 대세는
ReLU, Maxout
시간이 없으니 오늘은 제일 기본적인 ReLU만 할게요…ㅠㅠ
Maxout(두 개의 W와 b 중에서 큰 값이 나온 것을 사용하는 함수),
Leaky-ReLU(ReLU 함수의 변형으로 음수에 대해 1/10로 값을 줄여서 사용하는 함수)등등은
링크1, 링크2 링크3으로 셀프 공부 추천합니다!
Leaky-ReLU, P-ReLU, R-ReLU
29
전통적인 방법들을 quick하게 봅시다!
Sigmoid Hyperbolic tangent
98년도, 르쿤 선생님은 ‘Efficient Backprop’에서 말씀하셨습니다.
일반적인 Sigmoid보다 tanh를 쓰라고요. 이유는 tanh가 평균이 0에 가깝고 원점에 대해 대칭
(symmetric)하기 때문에 normalized된 output을 낼 수 있기 때문이죠. (이 output은 다음 단계에서 normalized input
으로 들어갈 수 있죠)
http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf
둘 다 non-linear하게 값을 특정 범위로 한정할 수 있고 미분 시 계산이 쉬워서 backprop 할 때 좋아요
30
ReLU
Rectified Linear Unit
Geoffrey hinton쌤은 말하셨죠…우리는 wrong type of non-linearity를 사용해서 NN이 발전하지 못했다고…
수정된
그렇다면 무엇을 수정했는가?
1. (계산량을 줄이기 위해 노력했지만…그럼에도 불구하고) 복잡하고 느린 계산
2. Gradient가 사라지는 현상. Vanishing Gradient Problem으로 유명하죠
http://www.cs.toronto.edu/~fritz/absps/imagenet.pdf
31
ReLU
Rectified Linear Unit
Geoffrey hinton쌤은 말하셨죠…우리는 wrong type of non-linearity를 사용해서 NN이 발전하지 못했다고…
수정된
그렇다면 무엇을 수정했는가?
1. (계산량을 줄이기 위해 노력했지만…그럼에도 불구하고) 복잡하고 느린 계산
2. Gradient가 사라지는 현상. Vanishing Gradient Problem으로 유명하죠
내가 바로 ReLU….누가봐도 쉽죠?
max([x,0])으로 처리하면 계산량도 엄청 작다…!
미분항도 1,0으로 나온다…ㄷㄷㄷ
https://www.cs.toronto.edu/~hinton/absps/reluICML.pdf
32
Vanishing Gradient 현상은 무엇인가?
RNN에서 많이 나오죠. 더 자세한 내용은 RNN 시간에 해요~
Sigmoid(tanh)는 미분값이 작기(0.3 미만, 1이하) 때문에 계속 곱하다보면 0에 수렴해버림
Ouput에 대한 초기 layer의 weight들은 사라지는(의미가 없어지는) 현상 발생
ReLU는 미분값이 0 혹은 1이기 때문에 값이 0 이상인 경우 output까지 초기 layer weight도 전달될
수 있음
https://nn.readthedocs.io/en/rtd/transfer/
Sigmoid Hyperbolic tangnet ReLU
수리적 해석을 보고싶으시면 여기로
33
Pooling Layer
• 연속적인 Conv layer 사이에
subsampling을 위한 layer
다시 CNN의 classical architecture를 확인하면…
34
http://www.slideshare.net/zukun/p03-neural-networks-cvpr2012-deep-learning-methods-for-vision
인접할 수록 겹치는 부분(stride 1이라면 겹치는 부분이 엄청 많겠죠!)이 많음
그러니 그 중에서(Spatial Sub-sampling한 특징) best match selection만 가져다 쓰자.
그러면 더 feature detection에도 robust해져서 overfitting도 방지하고 계산량도 줄일 수 있다.
Pooling Layer
weight 하나 정도 튀는 노이즈가 있어도 묻힘
35
Max Pooling
제일 많이 쓰이는 Pooling의 한 종류로 한 subregion에서 제일 큰 숫자를 선택함
Max값을 쓰는 이유는 특정 feature가 존재할 때 큰 activation값을 가지므로 가장 효과적일 수 있
기 때문임 실제로 average pooling이나 L2-norm pooling보다 더 좋은 결과를 보여줌
2x2 filter, 2 stride(filter와 같은 크기)가 max pooling에서 가장 일반적인 subregion 정의 방법임
아래 subregion에서 가장 큰 수는? 6
위 Max Pooling 사용 시 줄일 수 있는 계산 비용은?
정답: 1/4, 75%
36
Pooling Layer은 꼭 써야 하나?
아니요.
안 쓰거나 stride값을 크게하는 방향의 트랜드도 있긴 함
그래도 직관적으로 이해할 수 있는 방법이고 실제로 성능이 좋아지는 경우가 많
으므로
일단 먼저 써보고 다른 방법을 고려하길 추천함
Graham, Benjamin (2014-12-18). "Fractional Max-Pooling”
Springenberg, Jost Tobias; Dosovitskiy, Alexey; Brox, Thomas; Riedmiller, Martin (2014-12-21). "Striving for Simplicity: The All Convolutional Net"
37
Fully Connected Layer
• CNN의 가장 마지막 layer
로 N개의 class로 분류함
CNN의 classical architecture의 마지막 단계
뭔지 이미 아시죠?
38
시각화된 Summary
Convolutional Layer
Activation Layer
Non-linearity, ReLu
http://mlss.tuebingen.mpg.de/2015/slides/fergus/Fergus_1.pdf
Pooling
http://cs231n.github.io/convolutional-networks/
39
CNN의 classical architecture 다 배웠다!!!!!
그러면 이제 성능을 높이긴 위한 기술을 배워봅시다!
Dropout, Batch Normalization(BN), Initialization 기법 중 이번 시간엔 dropout만!
40
Dropout
Training 중 random하게 특정 unit들을 제외하여 overfitting 문제를 개선하는
regularization 기법
여러개의 모델을 합칠 경우 성능이 좋아지는 경우가 machine learning(ML)에 있는데 그게 neural net(NN)에
선 계산량 때문에 쉽지 않음.
Dropout을 통해 마치 서로 다른 네트워크 여러개를 학습한 average model을 test set에 적용하는 효과를 얻
을 수 있음
Hinton, Geoffrey E. 외 5명 (2012). "Improving neural networks by preventing co-adaptation of feature detectors"
Nitish Srivastava; Geoffrey Hinton 외 3명 (2015). "Dropout: A Simple Way to Prevent Neural Networks from Overfitting"
Training할 땐 p의 확률로 해당 unit의 on/off를 결정하고
Test할 땐 weight에 p를 곱해서 합하는 방법을 사용함
41
Dropout 효과 굉장히 좋음!
Nitish Srivastava; Geoffrey Hinton 외 3명 (2015). "Dropout: A Simple Way to Prevent Neural Networks from Overfitting"
자매품으로 Random Dropout 기법도 있음
각 layer에서 p를 random하게 가져가는 기법
http://www.vision.cs.chubu.ac.jp/MPRG/C_group/C070_fukui2015.pdf
42
이제 아래에 대해선 잘 아시겠죠?
Convolutional Layer, Activation Layer(ReLU), Pooling Layer,
Fully Connected Layer, Dropout 에 대한 개념 및 역할
Kernel Size, Stride, Padding에 대한 개념
43
The neural inspiration in models like convolutional nets is very tenuous.
That's why I call them "convolutional nets”, not "convolutional neural
nets", and why we call the nodes "units" and not "neurons".
화되었지만 처음 CNN으로 문제를 풀어 유명하게 만든 저자는 Convolutional Nets이란 표현을
Yann LeCun Facebook
마지막으로, CNN을 검색하다보면 convolutional nets도 많이 나오는데
너는 진정 CNN과 동의어이냐….?
44
끝
45
CNN에서의 굵직한 논문들은 다음과 같습니다.
주로 ILSVRC 우승작이라 볼 수 있죠..
AlexNet
(2012)
ZF Net
(2013)
GoogLeNet
(2014)
VGGNet
(2014)
ResNet
(2015)
(IMAGENET Large Scale Visual Recognition Challenge)
VGGNet
(2014)
VGGNet을 리뷰해보도록하겠습니다!
46
Karen Simonyan; Andrew Zisserman (2015) “Very Deep Convolutional Networks For Large-Scale Image Recognition”
VGG의 가장 큰 기여는 3 x 3 짜리 작은 convolution filters(stride=1)를 가
지고도 깊게 (16-19 weight layers) 만들면 좋은 결과를 얻을 수 있다는 것을
보인 것
AlexNet: 11x11 filters, 4 strides / ZF Net: 7x7 filters, 2 stridesVisual Geometry Group의 약자
47
Motivation
5 X 5 filter 1개
= 3 x 3 filter 2개 (2 strides)
7 X 7 filter 1개
= 3 x 3 filter 3개 (2 strides)
3 X 3 filter를 여러개 쓰면 5 x 5나 7 x 7과 비슷한 효과를 내면서 parameter수를 줄일 수 있다
Input/Ouput이 channel c개를 가질 때, 각각의 parameter수:
7 x 7 conv 사용 시 3 x 3보다 parameter 수 81% 증가
7 x 7 conv layer: 7^2xc^2 = 49 x c^2
3 x 3 conv layer: 3x(3^2xc^2) = 27 x c^2
5 x 5 conv 사용 시 3 x 3보다 parameter 수 39% 증가
5 x 5 conv layer: 5^2xc^2 = 25 x c^2
3 x 3 conv layer: 2x(3^2xc^2) = 18 x c^2
48
ConvNet configurations
깊어짐
• 표시 설명
• conv3-64: filter size: 3, 64
channels
• ReLU는 생략(실제론 사용됨)
• conv1(C열): 크기 변화없이 non-
linearity를 증가시키기 위해 삽입
됨
Karen Simonyan; Andrew Zisserman (2015) “Very Deep Convolutional Networks For Large-Scale Image Recognition”
49
Training
• 초기화 방법(weight): config A는 shallow하므로 random으로, 나머지는 config A 로
initialize함
• 초기화 방법(bias): 0
• Input image: 224 x 224의 고정된 이미지를 얻기 위해 rescale 후 random으로 짜름
Testing
• Fully-convolutional network를 이미지에 적용해 test time에 소요되는 sample multiple crop
시간을 줄임
Implementation Detail
• C++ Caffe toolbax로 구현
• 4개의 NVIDA Titan Black GPU가 꽂힌 single 시스템 사용
• 모델과 데이터의 parallelism을 활용하여 각 net의 서로 다른 layer에 적용함
• Training에 약 2-3주 소요
Karen Simonyan; Andrew Zisserman (2015) “Very Deep Convolutional Networks For Large-Scale Image Recognition”
50
Classification Expriment
• ​A에 적용한 A-LRN(Local
Response Normalisation)은 효과
가 없었고 나머지에는
normalisation 적용 안함
• 깊이가 깊어질수록 classification
error가 낮아지지만 19 이상은
saturation되었음 (단, 다른 input
데이터에서는 다른 결과가 나올
수 있음)
• conv1도 도움이 되었음
Karen Simonyan; Andrew Zisserman (2015) “Very Deep Convolutional Networks For Large-Scale Image Recognition”
51
Comparison with the state-of-the-art
Karen Simonyan; Andrew Zisserman (2015) “Very Deep Convolutional Networks For Large-Scale Image Recognition”
7개 모델을 ensemble해서 만들었던 ILSVRC 제출 모델 외에 추가로 만든 VGG을 통해 가
장 좋은 알고리즘보다 낮은 classification error rate을 만들 수 있었음
• soft-max class posterior을 평균내어 여러 모델의 결과를 합침
52
끝

Weitere ähnliche Inhalte

Was ist angesagt?

텐서플로우로 배우는 딥러닝
텐서플로우로 배우는 딥러닝텐서플로우로 배우는 딥러닝
텐서플로우로 배우는 딥러닝찬웅 주
 
인공신경망
인공신경망인공신경망
인공신경망종열 현
 
순환신경망(Recurrent neural networks) 개요
순환신경망(Recurrent neural networks) 개요순환신경망(Recurrent neural networks) 개요
순환신경망(Recurrent neural networks) 개요Byoung-Hee Kim
 
데이터는 차트가 아니라 돈이 되어야 한다.
데이터는 차트가 아니라 돈이 되어야 한다.데이터는 차트가 아니라 돈이 되어야 한다.
데이터는 차트가 아니라 돈이 되어야 한다.Yongho Ha
 
오늘 밤부터 쓰는 google analytics (구글 애널리틱스, GA)
오늘 밤부터 쓰는 google analytics (구글 애널리틱스, GA) 오늘 밤부터 쓰는 google analytics (구글 애널리틱스, GA)
오늘 밤부터 쓰는 google analytics (구글 애널리틱스, GA) Yongho Ha
 
스타트업 데이터분석 - 퍼널분석과 코호트분석
스타트업 데이터분석 - 퍼널분석과 코호트분석스타트업 데이터분석 - 퍼널분석과 코호트분석
스타트업 데이터분석 - 퍼널분석과 코호트분석Seonggwan Lee
 
밑바닥부터 시작하는딥러닝 8장
밑바닥부터 시작하는딥러닝 8장밑바닥부터 시작하는딥러닝 8장
밑바닥부터 시작하는딥러닝 8장Sunggon Song
 
Ai 그까이거
Ai 그까이거Ai 그까이거
Ai 그까이거도형 임
 
스타트업은 데이터를 어떻게 바라봐야 할까? (개정판)
스타트업은 데이터를 어떻게 바라봐야 할까? (개정판)스타트업은 데이터를 어떻게 바라봐야 할까? (개정판)
스타트업은 데이터를 어떻게 바라봐야 할까? (개정판)Yongho Ha
 
Rnn개념정리
Rnn개념정리Rnn개념정리
Rnn개념정리종현 최
 
코로나19로 인해 변화된 우리 시대의 데이터 트랜드
코로나19로 인해 변화된 우리 시대의 데이터 트랜드코로나19로 인해 변화된 우리 시대의 데이터 트랜드
코로나19로 인해 변화된 우리 시대의 데이터 트랜드Yongho Ha
 
딥러닝의 기본
딥러닝의 기본딥러닝의 기본
딥러닝의 기본deepseaswjh
 
빅데이터, 클라우드, IoT, 머신러닝. 왜 이렇게 많은 것들이 나타날까?
빅데이터, 클라우드, IoT, 머신러닝. 왜 이렇게 많은 것들이 나타날까?빅데이터, 클라우드, IoT, 머신러닝. 왜 이렇게 많은 것들이 나타날까?
빅데이터, 클라우드, IoT, 머신러닝. 왜 이렇게 많은 것들이 나타날까?Yongho Ha
 
boosting 기법 이해 (bagging vs boosting)
boosting 기법 이해 (bagging vs boosting)boosting 기법 이해 (bagging vs boosting)
boosting 기법 이해 (bagging vs boosting)SANG WON PARK
 
어떻게 하면 데이터 사이언티스트가 될 수 있나요?
어떻게 하면 데이터 사이언티스트가 될 수 있나요?어떻게 하면 데이터 사이언티스트가 될 수 있나요?
어떻게 하면 데이터 사이언티스트가 될 수 있나요?Yongho Ha
 
오토인코더의 모든 것
오토인코더의 모든 것오토인코더의 모든 것
오토인코더의 모든 것NAVER Engineering
 
[우리가 데이터를 쓰는 법] 좋다는 건 알겠는데 좀 써보고 싶소. 데이터! - 넘버웍스 하용호 대표
[우리가 데이터를 쓰는 법] 좋다는 건 알겠는데 좀 써보고 싶소. 데이터! - 넘버웍스 하용호 대표[우리가 데이터를 쓰는 법] 좋다는 건 알겠는데 좀 써보고 싶소. 데이터! - 넘버웍스 하용호 대표
[우리가 데이터를 쓰는 법] 좋다는 건 알겠는데 좀 써보고 싶소. 데이터! - 넘버웍스 하용호 대표Dylan Ko
 
인공지능개론 (머신러닝 중심)
인공지능개론 (머신러닝 중심)인공지능개론 (머신러닝 중심)
인공지능개론 (머신러닝 중심)SK(주) C&C - 강병호
 
[팝콘 시즌1] 이윤희 : 다짜고짜 배워보는 인과추론
[팝콘 시즌1] 이윤희 : 다짜고짜 배워보는 인과추론[팝콘 시즌1] 이윤희 : 다짜고짜 배워보는 인과추론
[팝콘 시즌1] 이윤희 : 다짜고짜 배워보는 인과추론PAP (Product Analytics Playground)
 

Was ist angesagt? (20)

텐서플로우로 배우는 딥러닝
텐서플로우로 배우는 딥러닝텐서플로우로 배우는 딥러닝
텐서플로우로 배우는 딥러닝
 
인공신경망
인공신경망인공신경망
인공신경망
 
순환신경망(Recurrent neural networks) 개요
순환신경망(Recurrent neural networks) 개요순환신경망(Recurrent neural networks) 개요
순환신경망(Recurrent neural networks) 개요
 
데이터는 차트가 아니라 돈이 되어야 한다.
데이터는 차트가 아니라 돈이 되어야 한다.데이터는 차트가 아니라 돈이 되어야 한다.
데이터는 차트가 아니라 돈이 되어야 한다.
 
오늘 밤부터 쓰는 google analytics (구글 애널리틱스, GA)
오늘 밤부터 쓰는 google analytics (구글 애널리틱스, GA) 오늘 밤부터 쓰는 google analytics (구글 애널리틱스, GA)
오늘 밤부터 쓰는 google analytics (구글 애널리틱스, GA)
 
스타트업 데이터분석 - 퍼널분석과 코호트분석
스타트업 데이터분석 - 퍼널분석과 코호트분석스타트업 데이터분석 - 퍼널분석과 코호트분석
스타트업 데이터분석 - 퍼널분석과 코호트분석
 
밑바닥부터 시작하는딥러닝 8장
밑바닥부터 시작하는딥러닝 8장밑바닥부터 시작하는딥러닝 8장
밑바닥부터 시작하는딥러닝 8장
 
Ai 그까이거
Ai 그까이거Ai 그까이거
Ai 그까이거
 
스타트업은 데이터를 어떻게 바라봐야 할까? (개정판)
스타트업은 데이터를 어떻게 바라봐야 할까? (개정판)스타트업은 데이터를 어떻게 바라봐야 할까? (개정판)
스타트업은 데이터를 어떻게 바라봐야 할까? (개정판)
 
Rnn개념정리
Rnn개념정리Rnn개념정리
Rnn개념정리
 
코로나19로 인해 변화된 우리 시대의 데이터 트랜드
코로나19로 인해 변화된 우리 시대의 데이터 트랜드코로나19로 인해 변화된 우리 시대의 데이터 트랜드
코로나19로 인해 변화된 우리 시대의 데이터 트랜드
 
딥러닝의 기본
딥러닝의 기본딥러닝의 기본
딥러닝의 기본
 
빅데이터, 클라우드, IoT, 머신러닝. 왜 이렇게 많은 것들이 나타날까?
빅데이터, 클라우드, IoT, 머신러닝. 왜 이렇게 많은 것들이 나타날까?빅데이터, 클라우드, IoT, 머신러닝. 왜 이렇게 많은 것들이 나타날까?
빅데이터, 클라우드, IoT, 머신러닝. 왜 이렇게 많은 것들이 나타날까?
 
boosting 기법 이해 (bagging vs boosting)
boosting 기법 이해 (bagging vs boosting)boosting 기법 이해 (bagging vs boosting)
boosting 기법 이해 (bagging vs boosting)
 
Cnn 강의
Cnn 강의Cnn 강의
Cnn 강의
 
어떻게 하면 데이터 사이언티스트가 될 수 있나요?
어떻게 하면 데이터 사이언티스트가 될 수 있나요?어떻게 하면 데이터 사이언티스트가 될 수 있나요?
어떻게 하면 데이터 사이언티스트가 될 수 있나요?
 
오토인코더의 모든 것
오토인코더의 모든 것오토인코더의 모든 것
오토인코더의 모든 것
 
[우리가 데이터를 쓰는 법] 좋다는 건 알겠는데 좀 써보고 싶소. 데이터! - 넘버웍스 하용호 대표
[우리가 데이터를 쓰는 법] 좋다는 건 알겠는데 좀 써보고 싶소. 데이터! - 넘버웍스 하용호 대표[우리가 데이터를 쓰는 법] 좋다는 건 알겠는데 좀 써보고 싶소. 데이터! - 넘버웍스 하용호 대표
[우리가 데이터를 쓰는 법] 좋다는 건 알겠는데 좀 써보고 싶소. 데이터! - 넘버웍스 하용호 대표
 
인공지능개론 (머신러닝 중심)
인공지능개론 (머신러닝 중심)인공지능개론 (머신러닝 중심)
인공지능개론 (머신러닝 중심)
 
[팝콘 시즌1] 이윤희 : 다짜고짜 배워보는 인과추론
[팝콘 시즌1] 이윤희 : 다짜고짜 배워보는 인과추론[팝콘 시즌1] 이윤희 : 다짜고짜 배워보는 인과추론
[팝콘 시즌1] 이윤희 : 다짜고짜 배워보는 인과추론
 

Andere mochten auch

랩탑으로 tensorflow 도전하기 - tutorial
랩탑으로 tensorflow 도전하기 - tutorial랩탑으로 tensorflow 도전하기 - tutorial
랩탑으로 tensorflow 도전하기 - tutorialLee Seungeun
 
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
 
Deep Learning - A Literature survey
Deep Learning - A Literature surveyDeep Learning - A Literature survey
Deep Learning - A Literature surveyAkshay Hegde
 
Python+numpy pandas 4편
Python+numpy pandas 4편Python+numpy pandas 4편
Python+numpy pandas 4편Yong Joon Moon
 
04. logistic regression ( 로지스틱 회귀 )
04. logistic regression ( 로지스틱 회귀 )04. logistic regression ( 로지스틱 회귀 )
04. logistic regression ( 로지스틱 회귀 )Jeonghun Yoon
 
랩탑으로 tensorflow 도전하기 - tensorflow 설치
랩탑으로 tensorflow 도전하기 - tensorflow 설치랩탑으로 tensorflow 도전하기 - tensorflow 설치
랩탑으로 tensorflow 도전하기 - tensorflow 설치Lee Seungeun
 
Lecture 29 Convolutional Neural Networks - Computer Vision Spring2015
Lecture 29 Convolutional Neural Networks -  Computer Vision Spring2015Lecture 29 Convolutional Neural Networks -  Computer Vision Spring2015
Lecture 29 Convolutional Neural Networks - Computer Vision Spring2015Jia-Bin Huang
 
Deep Learning through Examples
Deep Learning through ExamplesDeep Learning through Examples
Deep Learning through ExamplesSri Ambati
 
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016Taehoon Kim
 

Andere mochten auch (9)

랩탑으로 tensorflow 도전하기 - tutorial
랩탑으로 tensorflow 도전하기 - tutorial랩탑으로 tensorflow 도전하기 - tutorial
랩탑으로 tensorflow 도전하기 - tutorial
 
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
 
Deep Learning - A Literature survey
Deep Learning - A Literature surveyDeep Learning - A Literature survey
Deep Learning - A Literature survey
 
Python+numpy pandas 4편
Python+numpy pandas 4편Python+numpy pandas 4편
Python+numpy pandas 4편
 
04. logistic regression ( 로지스틱 회귀 )
04. logistic regression ( 로지스틱 회귀 )04. logistic regression ( 로지스틱 회귀 )
04. logistic regression ( 로지스틱 회귀 )
 
랩탑으로 tensorflow 도전하기 - tensorflow 설치
랩탑으로 tensorflow 도전하기 - tensorflow 설치랩탑으로 tensorflow 도전하기 - tensorflow 설치
랩탑으로 tensorflow 도전하기 - tensorflow 설치
 
Lecture 29 Convolutional Neural Networks - Computer Vision Spring2015
Lecture 29 Convolutional Neural Networks -  Computer Vision Spring2015Lecture 29 Convolutional Neural Networks -  Computer Vision Spring2015
Lecture 29 Convolutional Neural Networks - Computer Vision Spring2015
 
Deep Learning through Examples
Deep Learning through ExamplesDeep Learning through Examples
Deep Learning through Examples
 
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
 

Ähnlich wie CNN 초보자가 만드는 초보자 가이드 (VGG 약간 포함)

[컴퓨터비전과 인공지능] 7. 합성곱 신경망 2
[컴퓨터비전과 인공지능] 7. 합성곱 신경망 2[컴퓨터비전과 인공지능] 7. 합성곱 신경망 2
[컴퓨터비전과 인공지능] 7. 합성곱 신경망 2jdo
 
Chapter 10 sequence modeling recurrent and recursive nets
Chapter 10 sequence modeling recurrent and recursive netsChapter 10 sequence modeling recurrent and recursive nets
Chapter 10 sequence modeling recurrent and recursive netsKyeongUkJang
 
FCN to DeepLab.v3+
FCN to DeepLab.v3+FCN to DeepLab.v3+
FCN to DeepLab.v3+Whi Kwon
 
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
 
딥러닝을 위한 Tensor flow(skt academy)
딥러닝을 위한 Tensor flow(skt academy)딥러닝을 위한 Tensor flow(skt academy)
딥러닝을 위한 Tensor flow(skt academy)Tae Young Lee
 
캐빈머피 머신러닝 Kevin Murphy Machine Learning Statistic
캐빈머피 머신러닝 Kevin Murphy Machine Learning Statistic캐빈머피 머신러닝 Kevin Murphy Machine Learning Statistic
캐빈머피 머신러닝 Kevin Murphy Machine Learning Statistic용진 조
 
Convolutional Neural Networks
Convolutional Neural NetworksConvolutional Neural Networks
Convolutional Neural NetworksSanghoon Yoon
 
Attention is all you need 설명
Attention is all you need 설명Attention is all you need 설명
Attention is all you need 설명Junho Lee
 
Final project v0.84
Final project v0.84Final project v0.84
Final project v0.84Soukwon Jun
 
2.supervised learning(epoch#2)-3
2.supervised learning(epoch#2)-32.supervised learning(epoch#2)-3
2.supervised learning(epoch#2)-3Haesun Park
 
DP 알고리즘에 대해 알아보자.pdf
DP 알고리즘에 대해 알아보자.pdfDP 알고리즘에 대해 알아보자.pdf
DP 알고리즘에 대해 알아보자.pdfHo Jeong Im
 
History of Vision AI
History of Vision AIHistory of Vision AI
History of Vision AITae Young Lee
 
Survey of activation functions
Survey of activation functionsSurvey of activation functions
Survey of activation functions창기 문
 
[컴퓨터비전과 인공지능] 10. 신경망 학습하기 파트 1 - 1. 활성화 함수
[컴퓨터비전과 인공지능] 10. 신경망 학습하기 파트 1 - 1. 활성화 함수[컴퓨터비전과 인공지능] 10. 신경망 학습하기 파트 1 - 1. 활성화 함수
[컴퓨터비전과 인공지능] 10. 신경망 학습하기 파트 1 - 1. 활성화 함수jdo
 
인공지능, 기계학습 그리고 딥러닝
인공지능, 기계학습 그리고 딥러닝인공지능, 기계학습 그리고 딥러닝
인공지능, 기계학습 그리고 딥러닝Jinwon Lee
 
Neural Graph Collaborative Filtering paper review
Neural Graph Collaborative Filtering paper review Neural Graph Collaborative Filtering paper review
Neural Graph Collaborative Filtering paper review taeseon ryu
 
Deep neural networks for You-Tube recommendations
Deep neural networks for You-Tube recommendationsDeep neural networks for You-Tube recommendations
Deep neural networks for You-Tube recommendationsseungwoo kim
 
Deep Learning & Convolutional Neural Network
Deep Learning & Convolutional Neural NetworkDeep Learning & Convolutional Neural Network
Deep Learning & Convolutional Neural Networkagdatalab
 

Ähnlich wie CNN 초보자가 만드는 초보자 가이드 (VGG 약간 포함) (20)

[컴퓨터비전과 인공지능] 7. 합성곱 신경망 2
[컴퓨터비전과 인공지능] 7. 합성곱 신경망 2[컴퓨터비전과 인공지능] 7. 합성곱 신경망 2
[컴퓨터비전과 인공지능] 7. 합성곱 신경망 2
 
Chapter 10 sequence modeling recurrent and recursive nets
Chapter 10 sequence modeling recurrent and recursive netsChapter 10 sequence modeling recurrent and recursive nets
Chapter 10 sequence modeling recurrent and recursive nets
 
FCN to DeepLab.v3+
FCN to DeepLab.v3+FCN to DeepLab.v3+
FCN to DeepLab.v3+
 
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
 
딥러닝을 위한 Tensor flow(skt academy)
딥러닝을 위한 Tensor flow(skt academy)딥러닝을 위한 Tensor flow(skt academy)
딥러닝을 위한 Tensor flow(skt academy)
 
캐빈머피 머신러닝 Kevin Murphy Machine Learning Statistic
캐빈머피 머신러닝 Kevin Murphy Machine Learning Statistic캐빈머피 머신러닝 Kevin Murphy Machine Learning Statistic
캐빈머피 머신러닝 Kevin Murphy Machine Learning Statistic
 
Convolutional Neural Networks
Convolutional Neural NetworksConvolutional Neural Networks
Convolutional Neural Networks
 
Attention is all you need 설명
Attention is all you need 설명Attention is all you need 설명
Attention is all you need 설명
 
Deep learning overview
Deep learning overviewDeep learning overview
Deep learning overview
 
Final project v0.84
Final project v0.84Final project v0.84
Final project v0.84
 
CNN
CNNCNN
CNN
 
2.supervised learning(epoch#2)-3
2.supervised learning(epoch#2)-32.supervised learning(epoch#2)-3
2.supervised learning(epoch#2)-3
 
DP 알고리즘에 대해 알아보자.pdf
DP 알고리즘에 대해 알아보자.pdfDP 알고리즘에 대해 알아보자.pdf
DP 알고리즘에 대해 알아보자.pdf
 
History of Vision AI
History of Vision AIHistory of Vision AI
History of Vision AI
 
Survey of activation functions
Survey of activation functionsSurvey of activation functions
Survey of activation functions
 
[컴퓨터비전과 인공지능] 10. 신경망 학습하기 파트 1 - 1. 활성화 함수
[컴퓨터비전과 인공지능] 10. 신경망 학습하기 파트 1 - 1. 활성화 함수[컴퓨터비전과 인공지능] 10. 신경망 학습하기 파트 1 - 1. 활성화 함수
[컴퓨터비전과 인공지능] 10. 신경망 학습하기 파트 1 - 1. 활성화 함수
 
인공지능, 기계학습 그리고 딥러닝
인공지능, 기계학습 그리고 딥러닝인공지능, 기계학습 그리고 딥러닝
인공지능, 기계학습 그리고 딥러닝
 
Neural Graph Collaborative Filtering paper review
Neural Graph Collaborative Filtering paper review Neural Graph Collaborative Filtering paper review
Neural Graph Collaborative Filtering paper review
 
Deep neural networks for You-Tube recommendations
Deep neural networks for You-Tube recommendationsDeep neural networks for You-Tube recommendations
Deep neural networks for You-Tube recommendations
 
Deep Learning & Convolutional Neural Network
Deep Learning & Convolutional Neural NetworkDeep Learning & Convolutional Neural Network
Deep Learning & Convolutional Neural Network
 

CNN 초보자가 만드는 초보자 가이드 (VGG 약간 포함)

  • 1. 2017.01.23 이승은 A Beginner’s Guide to Understanding CNN Convolutional Neural Networks
  • 2. 2 언제 쓰는지? 어떻게 쓰는지? …. 이게 뭔지….? 모델 자체에 대한 이해 중심으로…. (용어 + 약간의 수리적 설명)
  • 3. 3 아마도 마지막장에선… 을 설명할 수 있을 것입니다! Convolutional Layer, Activation Layer(ReLU), Pooling Layer, Fully Connected Layer, Dropout 에 대한 개념 및 역할 Kernel Size, Stride, Padding에 대한 개념
  • 4. 4 Convolutional Neural Nets 이미지 분류 패턴 인식을 통해 기존 정보를 일반화하여 다른 환경의 이미지에 대해서도 잘 분류함. Sparse Connectivity 한 특징이 있음. http://www.slideshare.net/zukun/p03-neural-networks-cvpr2012-deep-learning-methods-for-vision 내가 발견하고자 하는 대상(labeled object: 아인슈타인)이 어떨땐 배경에 파묻혀있음 배경과 대상을 잘 분리하여 detect하려면 절대적인 위치보다 상대적 위치를 고려하는 게 중요함 거기다 계산량도 줄어듬!
  • 6. 6 A Classical CNN Architecture https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/
  • 7. 7 A Classical CNN Architecture convolutional layer를 줄여서 conv layer로 많이 표현함 Convolutional Layer 모든 Input이 거쳐가는 첫번째 Layer Feature를 detect하는 역할을 수행 Low level feature High level feature
  • 8. 8 Convolution 단어의 뜻…? Convolutional Neural Network Convolutional Layer
  • 10. 10 이미지를 빨간 사각형에서 초록 사각형으로 rolling하며 detect하는 것 Convolutional Layer를 생각하면 떠오르는 느낌을 설명하자면…
  • 11. 11 Convolutional Layer 32 32 Input image Activation map (Feature map) 28 28 Filter 5 x 5 x 3 (rgb) x 3 (rgb) input, output 확인 width, height, depth(channel) 확인 https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/
  • 12. 12 Filter와 (Local) Receptive Field Filter Size = Receptive Field (height, width, depth 모두 똑같음) 그러나 이 둘은 다른 것! https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/
  • 13. 13 Filter는 detect하고자 하는 feature에 대한 내용이 담긴 사각형 Receptive Field는 이미지 위를 filter size로 rolling하며 detect되는 실제 feature kernel, weights neuron https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/
  • 14. 14 Activation Map (Feature Map) 해당 receptive field에 fiter에서 detect하고자 하는 feature가 있는지 없는지 알려줌 • • = 6600 = 0 (50x30)+(20x30)+(50x30)+(50x30)+(50x30) 있다! 없다! • https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/
  • 15. 15 잠깐 쉬어가는 기호 얘기, * 와 Element-wise multiplication(앞장의 계산)을 설명할 때 어디서는 * 이걸 쓰고 어떨 땐 를 씁니다. 수리적으로 굉장히 다른 표현인데… 뭐가 맞는 건가요? http://stats.stackexchange.com/questions/161093/how-exactly-do-convolutional-neural-networks-use-convolution-in-place-of-matrix Output이 1개일 때는 (inner product)를 쓰시고 Output이 1개 이상일 때는 * (convolution)을 쓰시면 됩 니다 드디어 시간이 되었습니다… 싫지만 봐야하는 수리적 표현을 보시죠 ㅠㅠ ???난희?? Element-wise multiplication은 “Hadamard Product”라고 주장하는 분들도 있는데 안타깝게도 이에 대한 수리적인 표현이 없습니다 ㅠ ㅠ 그래도 통념상 이해하기 쉬운 수식을 써야 소통이 원활할 것 같아서 찾아봤어요. 물론 아래 말고 이거나 이걸 쓰자고 하는 분들 도 있긴 합니다. ∘ ⊙
  • 16. 16 http://yann.lecun.com/exdb/publis/pdf/lecun-98.pdf CNN의 시작은 언제일까? http://yann.lecun.com/exdb/publis/pdf/lecun-99.pdf CNN의 시초(?)라 불리는 Yann LeCun의 논문들을 살펴보았다. LeNet-5가 CNN의 시작이었죠 아래가 시초라 불리는 대표적인 두 논문… 물론 가끔 다른 논문들을 시초로 언급해서 헷갈리지만 ㅠㅠ 그리고 Habel and Wiesel(1962), Fukushima(1975), LeCun(1986) 등등 비슷한 개념으로 시초를 얘기하자면… 끝도 없이 다른 걸 찾을 수도 있구용… Convolution에 대한 수리적 정의를 정확히 찾기 위해…
  • 17. 17 하지만 수리적 Convolution에 대한 정의는 안보인다…ㅜㅜ http://yann.lecun.com/exdb/publis/pdf/lecun-99.pdf 두 논문을 보면, 하기와 같이 동일한 문단이 있다. 그리고 shift 라는 단어가 보인다. 관련될 만한 reference도 눈에 잘 안 보임…
  • 18. 18 (Discrete) Convolution의 수리적 정의 https://en.wikipedia.org/wiki/Convolution For complex-valued functions f, g defined on the set Z of integers, the discrete convolution of f and g is given by: The convolution of two finite sequences is defined by extending the sequences to finitely supported functions on the set of integers. When the sequences are the coefficients of two polynomials, then the coefficients of the ordinary product of the two polynomials are the convolution of the original two sequences. This is known as the Cauchy product of the coefficients of the sequences. Thus when g has finite support in the set{-M,-M+1, … ,M-1,M} (representing, for instance, a finite impulse response), a finite summation may be used: Cauchy product의 generalization은 inner product…. 이미지 g (filter)에 마치 f (receptive field)가 움직이면서 f와 곱해서 합하는 맥락상 비슷한 느낌… 사실 Convolution과 일반적인 수리적 정의의 신호처리 Convolution과 완전히 다른 거라는 얘기도 있긴 하지만… 그래도 일단위키피디아에서 비슷해보이는 정의를 찾아보자! (교환법칙 성립)
  • 19. 19 Activation Map(Feature Map)의 크기는 어떻게 계산할까? (output이 1개의 scalar 값이라면….) 32 32-5+1=28 28 Activation Map Size = Input Size - Filter Size + 1 굉장히 먼 길을 헤맸…다시 activation map으로 돌아오면! 가로 X 세로…? https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/
  • 20. 20 [심화과정] Activation Map(Feature Map)의 크기는 어떻게 계산할까? Stride: 몇 pixel씩 filter가 convolving하는지 결정하는 값 • Stride 값이 클수록 overlapping이 덜하고 계산량도 output(activation map) 크기가 작아짐 • 정답은 없으나 Karen Simonyan&Andrew Zisserman 논문에선 stride 값을 1로 설정하여 overlapping 을 통해 feature detection을 잘할 수 있도록 제안함 • 만약 가장 큰 stride 값을 구하고 싶으면, (input size-filter size)값을 1보다 큰 소수(2,3,5, …)로 나눠서 떨 어지는 경우가 있으면 해당 값(몫)을 stride값으로 할 수 있음. Input: 7 x 7 / Filter: 3 x 3 / Stride: 1 Input: 7 x 7 / Filter: 3 x 3 / Stride: 2 Output(activation map) 크기: (7-3)/1+1 Output(activation map) 크기: (7-3)/2+1 https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/
  • 21. 21 [심화과정] Activation Map(Feature Map)의 크기는 어떻게 계산할까? Zero Padding: activation map이 input 데이터와 동일한 크기를 유지하기 위해 사용하 는 값 • Conv layer과정에서 output 크기가 줄어드는데 원본 input 데이터에 대한 손실을 방지하는 효과가 있음 Output(activation map) 크기: (32-5)/1+1 = 28 Input: 32 x 32 / Filter: 5 x 5 / Stride: 1 / Zero Padding: 0 일때, Input: 32 x 32 / Filter: 5 x 5 / Stride: 1 / Zero Padding: 2 일때, Zero Padding된 Input 크기: 32 + 2 x 2 = 36 Output(activation map) 크기: (32-5+2*2)/1+1 = 32 Zero Padding 값은 얼마로 정해야할까? Stride가 1일때 ( Filter Size - 1 ) / 2 filter 1개 만큼 더 움직이려면 filter size -1 만큼이 필요하고 이 0들을 양쪽에 둬야하니 2로 나눔 https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/
  • 22. 22 [심화과정] Activation Map(Feature Map)의 크기는 어떻게 계산할까? Output Size = (Input Size+ 2 x Padding - Filter Size) / Stride +1 Padding이 있을 경우 반영된 Input 크기 (Stride가 1일때) Input 크기에서 Filter 크기를 빼면, 남을 filter의 convolving 횟수가 나옴 (Stride가 1이 아닐때) filter의 가능한 convolving 횟수를 stride값으로 나눔 Convolving하기 전, 첫번째 filter가 input과 inner product를 수행한 횟수
  • 23. 23 Activation Map(Feature Map)의 depth는 얼마일까? R G B 정답: Filter의 갯수와 같음! http://cs231n.github.io/convolutional-networks/ 힌트 1. Input channel이 여러개인 경우에는 inner product 결과에 대한 partial-sum을 수행한다. 고로, RGB 세 종류의 input이 3개의 filter를 적용한 결과는 하나의 scalar 값이다. http://linleygroup.com/mpr/article.php?id=11561 힌트 2. Filter는 여러개를 쓸 수 있다. Shared Weights한 특징 파란색 상자(local receptive fields)는 convolving하 며 계속 바뀌지만 빨간색 상자(filter, weight)는 변 하지 않음 어떤 receptive field에 유용한 feature라면 다른 receptive field에도 유용할 것이라는 가정에 근거 함
  • 24. 24 실제 Conv Layer에서의 계산 구현 방법은…? http://www.rle.mit.edu/eems/wp-content/uploads/2016/11/Tutorial-on-DNN-All-Parts.pdf Kernel Computation인 matrix multiplication을 어떻게 구현할까? MIT의 ‘Hardware Architecture for DNN’ 자료인데 여기선 convolution 계 산으로 간주하고 Toeplitz matrix에 대한 cross product로 변환해서 풀었네요. 하지만 이 부분은 수식을 좀 더 확인해봐야할 것 같아요. (저도 다보기 너무 힘들어서 여기까지만 ㅠㅠ)
  • 25. 25 Activation Layer • Conv Layer 바로 다음에 사용하는 nonlinear layer (Conv layer의 output을 activation map이라고 부르는 이유!) 다시 CNN의 classical architecture를 확인하면…
  • 26. 26 Nonlinear Layer가 왜 필요한 것인가…? 만약 Nonlinear Layer가 없다면, 만약 Conv Layer만 있다면, Only Matrix 연산만 하게 되고… 그럼 Linear한 단순한 문제밖에 못 풀게 됨 universal function approximator. http://www.statistics4u.com/fundstat_eng/cc_linvsnonlin.html x*x*x*x는 그냥 x^4로 한번에 계산해버리는 게 나음
  • 27. 27 Systematic evaluation of CNN advances on the ImageNet Nonlinear layer가 없으면 성능이 나쁨 ( 정확도가 낮아요 ㅠㅠ ) 안 쓰는 경우
  • 28. 28 Activation Layer엔 뭐가 있냐면… 전통적인(conventional) activation layer: sigmoid, tanh 하지만 요즘 대세는 ReLU, Maxout 시간이 없으니 오늘은 제일 기본적인 ReLU만 할게요…ㅠㅠ Maxout(두 개의 W와 b 중에서 큰 값이 나온 것을 사용하는 함수), Leaky-ReLU(ReLU 함수의 변형으로 음수에 대해 1/10로 값을 줄여서 사용하는 함수)등등은 링크1, 링크2 링크3으로 셀프 공부 추천합니다! Leaky-ReLU, P-ReLU, R-ReLU
  • 29. 29 전통적인 방법들을 quick하게 봅시다! Sigmoid Hyperbolic tangent 98년도, 르쿤 선생님은 ‘Efficient Backprop’에서 말씀하셨습니다. 일반적인 Sigmoid보다 tanh를 쓰라고요. 이유는 tanh가 평균이 0에 가깝고 원점에 대해 대칭 (symmetric)하기 때문에 normalized된 output을 낼 수 있기 때문이죠. (이 output은 다음 단계에서 normalized input 으로 들어갈 수 있죠) http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf 둘 다 non-linear하게 값을 특정 범위로 한정할 수 있고 미분 시 계산이 쉬워서 backprop 할 때 좋아요
  • 30. 30 ReLU Rectified Linear Unit Geoffrey hinton쌤은 말하셨죠…우리는 wrong type of non-linearity를 사용해서 NN이 발전하지 못했다고… 수정된 그렇다면 무엇을 수정했는가? 1. (계산량을 줄이기 위해 노력했지만…그럼에도 불구하고) 복잡하고 느린 계산 2. Gradient가 사라지는 현상. Vanishing Gradient Problem으로 유명하죠 http://www.cs.toronto.edu/~fritz/absps/imagenet.pdf
  • 31. 31 ReLU Rectified Linear Unit Geoffrey hinton쌤은 말하셨죠…우리는 wrong type of non-linearity를 사용해서 NN이 발전하지 못했다고… 수정된 그렇다면 무엇을 수정했는가? 1. (계산량을 줄이기 위해 노력했지만…그럼에도 불구하고) 복잡하고 느린 계산 2. Gradient가 사라지는 현상. Vanishing Gradient Problem으로 유명하죠 내가 바로 ReLU….누가봐도 쉽죠? max([x,0])으로 처리하면 계산량도 엄청 작다…! 미분항도 1,0으로 나온다…ㄷㄷㄷ https://www.cs.toronto.edu/~hinton/absps/reluICML.pdf
  • 32. 32 Vanishing Gradient 현상은 무엇인가? RNN에서 많이 나오죠. 더 자세한 내용은 RNN 시간에 해요~ Sigmoid(tanh)는 미분값이 작기(0.3 미만, 1이하) 때문에 계속 곱하다보면 0에 수렴해버림 Ouput에 대한 초기 layer의 weight들은 사라지는(의미가 없어지는) 현상 발생 ReLU는 미분값이 0 혹은 1이기 때문에 값이 0 이상인 경우 output까지 초기 layer weight도 전달될 수 있음 https://nn.readthedocs.io/en/rtd/transfer/ Sigmoid Hyperbolic tangnet ReLU 수리적 해석을 보고싶으시면 여기로
  • 33. 33 Pooling Layer • 연속적인 Conv layer 사이에 subsampling을 위한 layer 다시 CNN의 classical architecture를 확인하면…
  • 34. 34 http://www.slideshare.net/zukun/p03-neural-networks-cvpr2012-deep-learning-methods-for-vision 인접할 수록 겹치는 부분(stride 1이라면 겹치는 부분이 엄청 많겠죠!)이 많음 그러니 그 중에서(Spatial Sub-sampling한 특징) best match selection만 가져다 쓰자. 그러면 더 feature detection에도 robust해져서 overfitting도 방지하고 계산량도 줄일 수 있다. Pooling Layer weight 하나 정도 튀는 노이즈가 있어도 묻힘
  • 35. 35 Max Pooling 제일 많이 쓰이는 Pooling의 한 종류로 한 subregion에서 제일 큰 숫자를 선택함 Max값을 쓰는 이유는 특정 feature가 존재할 때 큰 activation값을 가지므로 가장 효과적일 수 있 기 때문임 실제로 average pooling이나 L2-norm pooling보다 더 좋은 결과를 보여줌 2x2 filter, 2 stride(filter와 같은 크기)가 max pooling에서 가장 일반적인 subregion 정의 방법임 아래 subregion에서 가장 큰 수는? 6 위 Max Pooling 사용 시 줄일 수 있는 계산 비용은? 정답: 1/4, 75%
  • 36. 36 Pooling Layer은 꼭 써야 하나? 아니요. 안 쓰거나 stride값을 크게하는 방향의 트랜드도 있긴 함 그래도 직관적으로 이해할 수 있는 방법이고 실제로 성능이 좋아지는 경우가 많 으므로 일단 먼저 써보고 다른 방법을 고려하길 추천함 Graham, Benjamin (2014-12-18). "Fractional Max-Pooling” Springenberg, Jost Tobias; Dosovitskiy, Alexey; Brox, Thomas; Riedmiller, Martin (2014-12-21). "Striving for Simplicity: The All Convolutional Net"
  • 37. 37 Fully Connected Layer • CNN의 가장 마지막 layer 로 N개의 class로 분류함 CNN의 classical architecture의 마지막 단계 뭔지 이미 아시죠?
  • 38. 38 시각화된 Summary Convolutional Layer Activation Layer Non-linearity, ReLu http://mlss.tuebingen.mpg.de/2015/slides/fergus/Fergus_1.pdf Pooling http://cs231n.github.io/convolutional-networks/
  • 39. 39 CNN의 classical architecture 다 배웠다!!!!! 그러면 이제 성능을 높이긴 위한 기술을 배워봅시다! Dropout, Batch Normalization(BN), Initialization 기법 중 이번 시간엔 dropout만!
  • 40. 40 Dropout Training 중 random하게 특정 unit들을 제외하여 overfitting 문제를 개선하는 regularization 기법 여러개의 모델을 합칠 경우 성능이 좋아지는 경우가 machine learning(ML)에 있는데 그게 neural net(NN)에 선 계산량 때문에 쉽지 않음. Dropout을 통해 마치 서로 다른 네트워크 여러개를 학습한 average model을 test set에 적용하는 효과를 얻 을 수 있음 Hinton, Geoffrey E. 외 5명 (2012). "Improving neural networks by preventing co-adaptation of feature detectors" Nitish Srivastava; Geoffrey Hinton 외 3명 (2015). "Dropout: A Simple Way to Prevent Neural Networks from Overfitting" Training할 땐 p의 확률로 해당 unit의 on/off를 결정하고 Test할 땐 weight에 p를 곱해서 합하는 방법을 사용함
  • 41. 41 Dropout 효과 굉장히 좋음! Nitish Srivastava; Geoffrey Hinton 외 3명 (2015). "Dropout: A Simple Way to Prevent Neural Networks from Overfitting" 자매품으로 Random Dropout 기법도 있음 각 layer에서 p를 random하게 가져가는 기법 http://www.vision.cs.chubu.ac.jp/MPRG/C_group/C070_fukui2015.pdf
  • 42. 42 이제 아래에 대해선 잘 아시겠죠? Convolutional Layer, Activation Layer(ReLU), Pooling Layer, Fully Connected Layer, Dropout 에 대한 개념 및 역할 Kernel Size, Stride, Padding에 대한 개념
  • 43. 43 The neural inspiration in models like convolutional nets is very tenuous. That's why I call them "convolutional nets”, not "convolutional neural nets", and why we call the nodes "units" and not "neurons". 화되었지만 처음 CNN으로 문제를 풀어 유명하게 만든 저자는 Convolutional Nets이란 표현을 Yann LeCun Facebook 마지막으로, CNN을 검색하다보면 convolutional nets도 많이 나오는데 너는 진정 CNN과 동의어이냐….?
  • 45. 45 CNN에서의 굵직한 논문들은 다음과 같습니다. 주로 ILSVRC 우승작이라 볼 수 있죠.. AlexNet (2012) ZF Net (2013) GoogLeNet (2014) VGGNet (2014) ResNet (2015) (IMAGENET Large Scale Visual Recognition Challenge) VGGNet (2014) VGGNet을 리뷰해보도록하겠습니다!
  • 46. 46 Karen Simonyan; Andrew Zisserman (2015) “Very Deep Convolutional Networks For Large-Scale Image Recognition” VGG의 가장 큰 기여는 3 x 3 짜리 작은 convolution filters(stride=1)를 가 지고도 깊게 (16-19 weight layers) 만들면 좋은 결과를 얻을 수 있다는 것을 보인 것 AlexNet: 11x11 filters, 4 strides / ZF Net: 7x7 filters, 2 stridesVisual Geometry Group의 약자
  • 47. 47 Motivation 5 X 5 filter 1개 = 3 x 3 filter 2개 (2 strides) 7 X 7 filter 1개 = 3 x 3 filter 3개 (2 strides) 3 X 3 filter를 여러개 쓰면 5 x 5나 7 x 7과 비슷한 효과를 내면서 parameter수를 줄일 수 있다 Input/Ouput이 channel c개를 가질 때, 각각의 parameter수: 7 x 7 conv 사용 시 3 x 3보다 parameter 수 81% 증가 7 x 7 conv layer: 7^2xc^2 = 49 x c^2 3 x 3 conv layer: 3x(3^2xc^2) = 27 x c^2 5 x 5 conv 사용 시 3 x 3보다 parameter 수 39% 증가 5 x 5 conv layer: 5^2xc^2 = 25 x c^2 3 x 3 conv layer: 2x(3^2xc^2) = 18 x c^2
  • 48. 48 ConvNet configurations 깊어짐 • 표시 설명 • conv3-64: filter size: 3, 64 channels • ReLU는 생략(실제론 사용됨) • conv1(C열): 크기 변화없이 non- linearity를 증가시키기 위해 삽입 됨 Karen Simonyan; Andrew Zisserman (2015) “Very Deep Convolutional Networks For Large-Scale Image Recognition”
  • 49. 49 Training • 초기화 방법(weight): config A는 shallow하므로 random으로, 나머지는 config A 로 initialize함 • 초기화 방법(bias): 0 • Input image: 224 x 224의 고정된 이미지를 얻기 위해 rescale 후 random으로 짜름 Testing • Fully-convolutional network를 이미지에 적용해 test time에 소요되는 sample multiple crop 시간을 줄임 Implementation Detail • C++ Caffe toolbax로 구현 • 4개의 NVIDA Titan Black GPU가 꽂힌 single 시스템 사용 • 모델과 데이터의 parallelism을 활용하여 각 net의 서로 다른 layer에 적용함 • Training에 약 2-3주 소요 Karen Simonyan; Andrew Zisserman (2015) “Very Deep Convolutional Networks For Large-Scale Image Recognition”
  • 50. 50 Classification Expriment • ​A에 적용한 A-LRN(Local Response Normalisation)은 효과 가 없었고 나머지에는 normalisation 적용 안함 • 깊이가 깊어질수록 classification error가 낮아지지만 19 이상은 saturation되었음 (단, 다른 input 데이터에서는 다른 결과가 나올 수 있음) • conv1도 도움이 되었음 Karen Simonyan; Andrew Zisserman (2015) “Very Deep Convolutional Networks For Large-Scale Image Recognition”
  • 51. 51 Comparison with the state-of-the-art Karen Simonyan; Andrew Zisserman (2015) “Very Deep Convolutional Networks For Large-Scale Image Recognition” 7개 모델을 ensemble해서 만들었던 ILSVRC 제출 모델 외에 추가로 만든 VGG을 통해 가 장 좋은 알고리즘보다 낮은 classification error rate을 만들 수 있었음 • soft-max class posterior을 평균내어 여러 모델의 결과를 합침