One-stage Network(YOLO, SSD 등)의 문제점 예를 들어 근본적인 문제인 # of Hard positives(object) << # of Easy negatives(back ground) 또는 large object 와 small object 를 동시에 detect하는 경우 등과 같이 극단적인 Class 간 unbalance나 난이도에서 차이가 나는 문제가 동시에 존재함으로써 발생하는 문제를 해결하기 위하여 제시된 Focal loss를 class간 아주 극단적인 unbalance data에 대한 classification 문제(예를 들어 1:10이나 1:100)에 적용한 실험결과가 있어서 정리해봤습니다. 결과적으로 hyper parameter의 설정에 매우 민감하다는 실험결과와 잘만 활용할 경우, class간 unbalance를 해결하기 위한 data level의 sampling 방법이나 classifier level에서의 특별한 고려 없이 좋은 결과를 얻을 수 있다는 내용입니다.
One-stage Network(YOLO, SSD 등)의 문제점 예를 들어 근본적인 문제인 # of Hard positives(object) << # of Easy negatives(back ground) 또는 large object 와 small object 를 동시에 detect하는 경우 등과 같이 극단적인 Class 간 unbalance나 난이도에서 차이가 나는 문제가 동시에 존재함으로써 발생하는 문제를 해결하기 위하여 제시된 Focal loss를 class간 아주 극단적인 unbalance data에 대한 classification 문제(예를 들어 1:10이나 1:100)에 적용한 실험결과가 있어서 정리해봤습니다. 결과적으로 hyper parameter의 설정에 매우 민감하다는 실험결과와 잘만 활용할 경우, class간 unbalance를 해결하기 위한 data level의 sampling 방법이나 classifier level에서의 특별한 고려 없이 좋은 결과를 얻을 수 있다는 내용입니다.
Modern Convolutional Neural Network techniques for image segmentationGioele Ciaparrone
Recently, Convolutional Neural Networks have been successfully applied to image segmentation tasks. Here we present some of the most recent techniques that increased the accuracy in such tasks. First we describe the Inception architecture and its evolution, which allowed to increase width and depth of the network without increasing the computational burden. We then show how to adapt classification networks into fully convolutional networks, able to perform pixel-wise classification for segmentation tasks. We finally introduce the hypercolumn technique to further improve state-of-the-art on various fine-grained localization tasks.
Revised presentation slide for NLP-DL, 2016/6/22.
Recent Progress (from 2014) in Recurrent Neural Networks and Natural Language Processing.
Profile http://www.cl.ecei.tohoku.ac.jp/~sosuke.k/
Japanese ver. https://www.slideshare.net/hytae/rnn-63761483
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...Simplilearn
This presentation on TensorFlow will help you understand what is Deep Learning and it's libraries, why use TensorFlow, what is TensorFlow, how to build a computational graph, programming using elements in TensorFlow, what are Recurrent Neural Networks along with a use case implementation on TensorFlow. TensorFlow is a software library developed by Google for the purposes of conducting machine learning and deep neural network research. In this video, you will learn the fundamentals of TensorFlow concepts, functions and operations required to implement deep learning algorithms and leverage data like never before. Now let's get started in mastering the concept of Deep Learning using TensorFlow.
Below topics are explained in this TensorFlow presentation:
1. What is Deep Learning?
2. Top Deep Learning libraries?
3. Why use TensorFlow?
4. What is TensorFlow?
5. Building a computational graph
6. Programming elements in TensorFlow
7. Introducing Recurrent Neural Networks
8. Use case implementation of RNN using TensorFlow
Why Deep Learning?
It is one of the most popular software platforms used for deep learning and contains powerful tools to help you build and implement artificial neural networks. Advancements in deep learning are being seen in smartphone applications, creating efficiencies in the power grid, driving advancements in healthcare, improving agricultural yields, and helping us find solutions to climate change.
You can gain in-depth knowledge of Deep Learning by taking our Deep Learning certification training course. With Simplilearn’s Deep Learning course, you will prepare for a career as a Deep Learning engineer as you master concepts and techniques including supervised and unsupervised learning, mathematical and heuristic aspects, and hands-on modeling to develop algorithms. Those who complete the course will be able to:
1. Understand the concepts of TensorFlow, its main functions, operations and the execution pipeline
2. Implement deep learning algorithms, understand neural networks and traverse the layers of data abstraction which will empower you to understand data like never before
3. Master and comprehend advanced topics such as convolutional neural networks, recurrent neural networks, training deep networks and high-level interfaces
4. Build deep learning models in TensorFlow and interpret the results
5. Understand the language and fundamental concepts of artificial neural networks
6. Troubleshoot and improve deep learning models
7. Build your own deep learning project
8. Differentiate between machine learning, deep learning and artificial intelligence
Learn more at: https://www.simplilearn.com
Final project, Machine Learning Having it Deep and Structured, NTU
- Rank 1/25 in peer review, original score: 16.2/17
- 2nd presentation pride (voted by audience)
Yurii Pashchenko: Zero-shot learning capabilities of CLIP model from OpenAILviv Startup Club
Yurii Pashchenko: Zero-shot learning capabilities of CLIP model from OpenAI
AI & BigData Online Day 2021
Website - https://aiconf.com.ua/
Youtube - https://www.youtube.com/startuplviv
FB - https://www.facebook.com/aiconf
Modern Convolutional Neural Network techniques for image segmentationGioele Ciaparrone
Recently, Convolutional Neural Networks have been successfully applied to image segmentation tasks. Here we present some of the most recent techniques that increased the accuracy in such tasks. First we describe the Inception architecture and its evolution, which allowed to increase width and depth of the network without increasing the computational burden. We then show how to adapt classification networks into fully convolutional networks, able to perform pixel-wise classification for segmentation tasks. We finally introduce the hypercolumn technique to further improve state-of-the-art on various fine-grained localization tasks.
Revised presentation slide for NLP-DL, 2016/6/22.
Recent Progress (from 2014) in Recurrent Neural Networks and Natural Language Processing.
Profile http://www.cl.ecei.tohoku.ac.jp/~sosuke.k/
Japanese ver. https://www.slideshare.net/hytae/rnn-63761483
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...Simplilearn
This presentation on TensorFlow will help you understand what is Deep Learning and it's libraries, why use TensorFlow, what is TensorFlow, how to build a computational graph, programming using elements in TensorFlow, what are Recurrent Neural Networks along with a use case implementation on TensorFlow. TensorFlow is a software library developed by Google for the purposes of conducting machine learning and deep neural network research. In this video, you will learn the fundamentals of TensorFlow concepts, functions and operations required to implement deep learning algorithms and leverage data like never before. Now let's get started in mastering the concept of Deep Learning using TensorFlow.
Below topics are explained in this TensorFlow presentation:
1. What is Deep Learning?
2. Top Deep Learning libraries?
3. Why use TensorFlow?
4. What is TensorFlow?
5. Building a computational graph
6. Programming elements in TensorFlow
7. Introducing Recurrent Neural Networks
8. Use case implementation of RNN using TensorFlow
Why Deep Learning?
It is one of the most popular software platforms used for deep learning and contains powerful tools to help you build and implement artificial neural networks. Advancements in deep learning are being seen in smartphone applications, creating efficiencies in the power grid, driving advancements in healthcare, improving agricultural yields, and helping us find solutions to climate change.
You can gain in-depth knowledge of Deep Learning by taking our Deep Learning certification training course. With Simplilearn’s Deep Learning course, you will prepare for a career as a Deep Learning engineer as you master concepts and techniques including supervised and unsupervised learning, mathematical and heuristic aspects, and hands-on modeling to develop algorithms. Those who complete the course will be able to:
1. Understand the concepts of TensorFlow, its main functions, operations and the execution pipeline
2. Implement deep learning algorithms, understand neural networks and traverse the layers of data abstraction which will empower you to understand data like never before
3. Master and comprehend advanced topics such as convolutional neural networks, recurrent neural networks, training deep networks and high-level interfaces
4. Build deep learning models in TensorFlow and interpret the results
5. Understand the language and fundamental concepts of artificial neural networks
6. Troubleshoot and improve deep learning models
7. Build your own deep learning project
8. Differentiate between machine learning, deep learning and artificial intelligence
Learn more at: https://www.simplilearn.com
Final project, Machine Learning Having it Deep and Structured, NTU
- Rank 1/25 in peer review, original score: 16.2/17
- 2nd presentation pride (voted by audience)
Yurii Pashchenko: Zero-shot learning capabilities of CLIP model from OpenAILviv Startup Club
Yurii Pashchenko: Zero-shot learning capabilities of CLIP model from OpenAI
AI & BigData Online Day 2021
Website - https://aiconf.com.ua/
Youtube - https://www.youtube.com/startuplviv
FB - https://www.facebook.com/aiconf
[야생의 땅: 듀랑고]의 식물 생태계를 담당하는 21세기 정원사의 OpenCL 경험담Sumin Byeon
이 발표는 넥슨의 신규 개발 게임인 듀랑고의 생태계에 대한 간략한 소개와 OpenCL 을 이용한 병렬 처리에 관한 전반적인 기술적 내용을 다룹니다. 게임 속의 세계에서 지형과 기후, 지질 조건에 맞게 여러 종류의 식물과 광물들을 알맞은 곳에 배치시키는 것이 생태계 시뮬레이터의 역할인데, 이 시뮬레이터는 방대한 양의 계산을 수행합니다. 초기에 만들어진 프로토타입은 이러한 계산을 수행하는데 30분이 넘게 걸렸지만, 병렬처리, 알고리즘 시간복잡도 개선 등의 여러가지 방법들을 통해 그 시간을 11초까지 단축시켰습니다. 구체적으로 어떤 방법들을 시도했었고, 어떤 방법들이 효과가 있었는지 여러분과 그 경험담을 공유하고자 합니다.
2. Multimedia Signal Processing Laboratory
Index
• Convolution Neural Network
Convolution
Filter
Stride
Padding
Pooling
• Backpropagtion
2
3. Multimedia Signal Processing Laboratory
Convolutional Neural Network
3
• Like Perceptron imitated neural networks, CNN imitated cat
experiments.
• When viewing a particular image, only a portion of the optic
nerve was activated.
6. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• What is convolution
두개의 함수 𝑓와 𝑔가 있을 때 두 함수의 합성곱을 수학 기호로는
𝑓 ∗ 𝑔와 같이 표현한다.
1D Convolution: 𝑓 ∗ 𝑔 𝑡 =
−∞
∞
𝑓 𝑥 𝑔 𝑡 − 𝑥 𝑑𝑥
2D Convolution: 𝑓 ∗ 𝑔 𝑥, 𝑦 =
𝑦=−𝑁
𝑁
𝑥=−𝑁
𝑁
𝑓 𝑥, 𝑦 𝑔(𝑡 − 𝑥, 𝑡 − 𝑦)
-wikipedia
6
7. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• What is convolution
함수 f에 대하여 함수 g가 얼마나 겹치는가
7
8. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• Convolution은 어떤 System
Function에 대해서 입력 Input
Function을 주었을 때, 어떠한
output이 나오는지를 연산해주는 연
산자가 됩니다.
8
10. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• Cross-correlation
Given an Image 𝐼 and a filter (kernel)𝐾 of dimensions 𝑘1 × 𝑘2, the cross-
correlation operation is given by:
𝐼 ⊗ 𝐾 𝑖𝑗 =
𝑚=0
𝑘1−1
𝑛=0
𝑘2−1
𝐼 𝑖 + 𝑚, 𝑗 + 𝑛 𝐾(𝑚, 𝑛) (1)
10
11. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• Convolution
Given an Image 𝐼 and a filter (kernel)𝐾 of dimensions 𝑘1 × 𝑘2, the convolution
operation is given by:
𝐼 ∗ 𝐾 𝑖𝑗 =
𝑚=0
𝑘1−1
𝑛=0
𝑘2−1
𝐼 𝑖 − 𝑚, 𝑗 − 𝑛 𝐾(𝑚, 𝑛) (2)
=
𝑚=0
𝑘1−1
𝑛=0
𝑘2−1
𝐼 𝑖 + 𝑚, 𝑗 + 𝑛 𝐾(−𝑚, −𝑛) (3)
From Eq.3 it is easy to see that convolution is the same as cross-correlation
with a flipped kernel i.e for a kernel 𝐾 where 𝐾 −𝑚, −𝑛 = 𝐾 𝑚, 𝑛
11
13. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• Convolution, cross-correlation
문서에 따라 이 둘을 모두 convolution이라고 칭하는 문서도 많습니다.
뒤의 모든 예제는 correlation으로 forward 할 것입니다.
13
14. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• Image
주위 값들을 반영해 중앙의 값을 변화시킵니다.
Filter ∶
1 0 1
0 1 0
1 0 1
14
15. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• Filter(Kernel)
필터는 그 특징이 데이터에 있는지 없는지를 검출해주는 함수입
니다.
15
18. Multimedia Signal Processing Laboratory
Convolutional Neural Network
18
• 필터와 비슷한 곡선에 대해 convolution을 하면 큰 결과 값을 가집니
다.
19. Multimedia Signal Processing Laboratory
• 필터와 상이한 곳과 convolution을 하면 결과 값이 0과 가까워 집니
다.
Convolutional Neural Network
19
20. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• 새로 생긴 이미지는 원 이미지에서 부분 특징을 뽑아낸 것입니
다.
• 부분 부분에서 특징을 알 수 있기 때문에 전체 이미지에서 특징
을 분석하는 것보다 좋은 학습효과를 낼 수 있습니다.
• 이런 특징들을 잘 뽑아내야 합니다.
20
21. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• 이미지는 여러가지의 특징이 있기 때문에 하나의 필터가 아닌
여러 개의 다중 필터를 적용하게 됩니다.
21
26. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• Padding
필터를 적용한 feature map은 원본 이미지에 비해 크기가 줄어들
게 됩니다.
CNN 네트워크는 여러 단계에 걸쳐서 필터를 적용합니다. 그러면
서 계속 크기가 작아지면 처음에 비해 특징들이 유실 될 수 있습
니다.
이를 방지하기 위해 padding이라는 기법을 사용합니다.
26
27. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• Padding
결과 값이 작아지는 것을 줄이기 위해 입력 이미지 주위로 0 값을
넣어서 입력 이미지의 크기를 인위적으로 키웁니다.
0으로 몇 겹 둘러싸여 있는지가 Padding의 크기가 됩니다.
27
28. Multimedia Signal Processing Laboratory
• 32x32x3 입력 값이 있을 때, 5x5x3필터를 적용하면(stride = 1)
결과 값의 크기는 28x28x3이 되는데 사이즈가 작아지는 것을
막으려면 padding을 2를 주면 됩니다.
Convolutional Neural Network
28
30. Multimedia Signal Processing Laboratory
• Padding
Padding은 결과 값이 작아지는 것을 막아서 특징이 유실 되
는 것을 막는 것 뿐만 아니라 모서리의 정보를 전달합니다.
또한 원래의 데이터에 0이라는 노이즈를 넣음으로써 오버피
팅을 방지할 수 있습니다.
Convolutional Neural Network
30
31. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• Pooling
CNN에서 추출된 특징들은 필요에 따라서 sub sampling과정을
거칩니다.
필요한 특징들이 추출이 되면 고해상도가 아닌 저해상도에서도
판단할 수 있는 원리와 같습니다.
31
32. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• Pooling
보통 max pooling을 가장 많이 사용합니다.(average pooling도 존재)
아래 예제는 4x4 image를 2x2 max pooling filter를 stride 2로 하여
pooling한 결과 입니다.
32
33. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• Pooling
Max pooling은 특징의 값이 큰 값이 다른 값들을 대표한다는 개
념을 기반으로 합니다.
데이터의 사이즈를 줄임으로서 네트워크 연산 속도가 빨라집니다.
데이터의 크기를 줄이면서 소실이 발생하기 때문에 오버피팅이
줄어듭니다.
33
34. Multimedia Signal Processing Laboratory
Convolutional Neural Network
FC = fully connected layer, ReLU = Rectified Linear Unit 34
35. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• ReLU(Rectified Linear Function)
𝑓 𝑥 = max(0, 𝑥)
자세한 것은 gradient vanishing problem을 설명할 때 하도록 하겠습니다.
35
36. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• Summary
CNN에서는 MLP와 달리 weight들을 공유
공유되는 weight들로 convolution filter연산을 한다
Pooling으로 down sampling을 하여서 공간의 크기를 줄여 연산의 양과
파라미터 개수를 줄인다
Convolution layer와 pooling layer사이에는 activation layer가 있고
Convolution activation pooling layer를 계속 거치면 이미지의 사이즈는
줄어들고 복잡한 feature들이 추출됨
36
43. Multimedia Signal Processing Laboratory
Convolutional Neural Network
15 x 15
Max pooling
6 x 6
12 x 12
4x4
2x2
4x4
kernel
2x2
Input layer
3x3
kernel
Max pooling
2x2
3
x
1
4x3
weight
Conv layer pooling layer Conv layer pooling layer FC layer
Picture (1)
44. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• Notation
1. All of index start with 0
2. 𝑙 is the 𝑙 𝑡ℎ
layer where 𝑙 = 1 is the first layer and 𝑙 = 𝐿 is the last layer
3. 𝐸 is the loss function
𝐸 =
1
2
𝑟
𝑡 𝑟 − 𝑦𝑟
2
4. 𝑤𝑖,𝑗
𝑙
is the weight element connecting neurons of layer 𝑙 with neurons of layer 𝑙 − 1
5. 𝑏 𝑙
is the bias unit at layer 𝑙
6. 𝑥𝑖,𝑗
𝑙
is the weighted sum at layer 𝑙 plus the bias represented as
𝑥𝑖,𝑗
𝑙
=
𝑚 𝑛
𝑤 𝑚,𝑛
𝑙
𝑜𝑖+𝑚,𝑗+𝑛
𝑙−1
+ 𝑏 𝑙
7. 𝑜𝑖,𝑗
𝑙
is the output vector at layer 𝑙 given by
𝑜𝑖,𝑗
𝑙
= 𝑓(𝑥𝑖,𝑗
𝑙
)
8. 𝑓(∙) is the activation function. Application of the activation layer to the convolved input vector at
layer 𝑙 is given by 𝑓(𝑥𝑖,𝑗
𝑙
)
44
46. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• 아래의 식은 CNN에서 𝑙번째 convolution 층에서 가중 합 결과 입니다.
𝑥𝑖,𝑗
𝑙
=
𝑚 𝑛
𝑤 𝑚,𝑛
𝑙 𝑜𝑖+𝑚,𝑗+𝑛
𝑙−1
+ 𝑏 𝑙
• 마지막 FC층에서의 가중 합은 아래와 같습니다.
𝑥𝑗
𝐿
=
𝑖
𝑤𝑖,𝑗
𝐿−1
𝑜𝑖
𝐿−2
46
(1)
(2)
47. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• 식(1)을 사용해서 네트워크 전체를 forwarding 하고 마지막 FC layer는 식(2)를 사
용합니다.
• 마지막 출력층의 𝛿 𝐿
을 (BP1)을 통하여 구합니다. CNN에서의 출력층은 MLP와 같
은 모델이기 때문에 기존 식과 달라질 것이 없습니다.
𝛿𝑗
𝐿
=
𝜕𝐸
𝜕𝑓(𝑥𝑗
𝐿
)
𝜕𝑓(𝑥𝑗
𝐿
)
𝜕𝑥𝑗
𝐿 =
𝜕𝐸
𝜕𝑓(𝑥𝑗
𝐿
)
𝑓′
𝑥𝑗
𝐿
(CBP1)
47
48. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• FC layer의 bias는 𝑤0로 표현할 것이기 때문에 weight에 대한 편미분만 계산하면
됩니다. 여기서 𝑙은 FC layer의 𝑙번 째 층입니다.
𝜕𝐸
𝜕𝑤𝑖𝑗
𝑙 = 𝛿𝑗
𝑙
𝑜𝑖
𝑙−1
(3)
• Picture(1)에서의 출력층에 대한 𝛿𝑗
𝐿
는 (CBP1)을 통해서 구하였고 𝑥𝑖
𝑙−1
또한
forward 과정으로 이미 알고 있는 값이다.
• Picture(1)의 마지막 Convolution layer의 2x2의 출력 값을 1x4로 바꿔야 하는데
그 공식은 다음과 같다.
𝑖 = 𝑛′
𝑀 + 𝑚′
48
0,0 0,1
1,0 1,1 0 1 2 3
𝑚′
𝑛′ 𝑖
49. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• 이제 convolution layer의 𝛿 𝑙을 구할 차례입니다. Convolution layer는 FC layer 연
결이 다르기 때문에
𝜕𝐸
𝜕𝑊
를 먼저 유도하여 풀도록 하겠습니다.
• NxN의 크기를 가지는 𝑙 − 1 번 째 층의 결과는 𝑙번 째 층의 입력이 되고 mxm 크기
의 kernel w를 적용하여 (N-m+1)x(N-m+1)크기의 출력층을 만드는 convolution
layer에 대한 식입니다.
𝑥𝑖,𝑗
𝑙
=
𝑎=0
𝑚−1
𝑏=0
𝑚−1
𝑤 𝑎𝑏
𝑙
𝑜𝑖+𝑎,𝑗+𝑏
𝑙−1
+ 𝑏 𝑙 (4)
𝜕𝐸
𝜕𝑏 𝑙
=
𝑖=0
𝑁−𝑚
𝑗=0
𝑁−𝑚
𝜕𝐸
𝜕𝑥𝑖𝑗
𝑙
𝜕𝑥𝑖𝑗
𝑙
𝜕𝑏 𝑙
(5)
49
50. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• 식(5)에서
𝜕𝑥 𝑖𝑗
𝑙
𝜕𝑏 𝑙 은 1인 것을 식 (4)를 통해 확인 할 수 있습니다.
𝜕𝐸
𝜕𝑏 𝑙
=
𝑖=0
𝑁−𝑚
𝑗=0
𝑁−𝑚
𝜕𝐸
𝜕𝑥𝑖𝑗
𝑙
𝜕𝑥𝑖𝑗
𝑙
𝜕𝑏 𝑙
=
𝑖=0
𝑁−𝑚
𝑗=0
𝑁−𝑚
𝛿𝑖𝑗
𝑙
𝜕𝑥𝑖𝑗
𝑙
𝜕𝑏 𝑙
=
𝑖=0
𝑁−𝑚
𝑗=0
𝑁−𝑚
𝛿𝑖𝑗
𝑙
(6)
• Convolution layer에서
𝜕𝐸
𝜕𝑏 𝑙는 모든 𝛿를 더하는 것과 같습니다.
𝜕𝐸
𝜕𝑏 𝑙 =
𝑖=0
𝑁−𝑚
𝑗=0
𝑁−𝑚
𝛿𝑖𝑗
𝑙
(CBP3)
50
51. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• 이제
𝜕𝐸
𝜕𝑤 𝑎𝑏
𝑙 를 구할 차례입니다. 이 역시 chain rule을 통하여 나타낼 수 있습니다.
𝜕𝐸
𝜕𝑤 𝑎𝑏
𝑙 =
𝑖=0
𝑁−𝑚
𝑗=0
𝑁−𝑚
𝜕𝐸
𝜕𝑥𝑖𝑗
𝑙
𝜕𝑥𝑖𝑗
𝑙
𝜕𝑤 𝑎𝑏
𝑙 (7)
• 식(7)에서의
𝜕𝑥 𝑖𝑗
𝑙
𝜕𝑤 𝑎𝑏
𝑙 는 식(4)에 의해 식(8)이 됩니다.
𝜕𝐸
𝜕𝑤 𝑎𝑏
𝑙 = 𝑜𝑖+𝑎,𝑗+𝑏
𝑙−1
(8)
• 식(7)을 다시 정리하면
𝜕𝐸
𝜕𝑤 𝑎𝑏
𝑙 =
𝑖=0
𝑁−𝑚
𝑗=0
𝑁−𝑚
𝜕𝐸
𝜕𝑥𝑖𝑗
𝑙 𝑜𝑖+𝑎,𝑗+𝑏
𝑙−1
=
𝑖=0
𝑁−𝑚
𝑗=0
𝑁−𝑚
𝛿𝑖𝑗
𝑙
𝑜𝑖+𝑎,𝑗+𝑏
𝑙−1
(9)
51
52. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• 식(9)는 바로 𝑙 − 1 번 째 층의 활성 값 𝑥 𝑙−1
과 𝛿 𝑙
을 correlation한 값입니다. MLP의
(BP4)와 비교해보면 (BP4)는 x와 𝛿를 행렬곱한 식이고 convolution층에서는 x와 𝛿
를 correlation한 것입니다. 따라서 (CBP4)는 다음과 같습니다.
𝜕𝐸
𝜕𝑤 𝑎𝑏
𝑙 =
𝑖=0
𝑁−𝑚
𝑗=0
𝑁−𝑚
𝛿𝑖𝑗
𝑙
𝑜𝑖+𝑎,𝑗+𝑏
𝑙−1
(CBP4)
52
53. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• 이제 convolution layer에서의 𝛿 𝑙
만 구하면 (CBP3),(CBP4)를 통해
𝜕𝐸
𝜕𝑏 𝑙 ,
𝜕𝐸
𝜕𝑤 𝑎𝑏
𝑙 를 구할
수 있습니다.
𝛿𝑖𝑗
𝑙
=
𝜕𝐸
𝜕𝑥𝑖𝑗
𝑙
=
𝑟 𝑖′ 𝑗′
𝜕E
𝜕𝑥 𝑟
𝑙+1
𝜕𝑥 𝑟
𝑙+1
𝜕𝑜𝑖′ 𝑗′
𝑙
𝜕𝑜𝑖′ 𝑗′
𝑙
𝜕𝑜𝑖𝑗
𝑙
𝜕𝑜𝑖𝑗
𝑙
𝜕𝑥𝑖𝑗
𝑙 (10)
위 식에서 𝑖′, 𝑗′은 convolution layer다음 max pooling layer의 index
53
57. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• 식(11)에서 𝑥 𝑝
𝑙+1
은 다음과 같습니다.
𝑥 𝑟
𝑙+1 =
𝑟
𝑤 𝑞𝑟
𝑙+1 𝑜 𝑞
𝑙 + 𝑏 𝑟
𝑙+1 (12)
• 식 (12)에 의해 식(10)의
𝜕𝑥 𝑟
𝑙+1
𝜕𝑜𝑖′ 𝑗′
𝑙 는 인덱스 𝑖′
, 𝑗′
가 𝑞가 될 때를 제외하고는 모두 0입니
다. 따라서 다음과 같이 나타낼 수 있습니다.
𝜕𝑥 𝑟
𝑙+1
𝜕𝑜𝑖′ 𝑗′
𝑙 =
𝜕 𝑟 𝑤 𝑞𝑟
𝑙+1
𝑜 𝑞
𝑙
+ 𝑏 𝑟
𝑙+1
𝜕𝑜𝑖′ 𝑗′
𝑙 = 𝑤 𝑞𝑟
𝑙+1
(13)
57
58. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• 식(13)과 𝛿의 정의를 이용해서 식(10)을 다시 정리해보면 다음과 같습니다.
𝛿𝑖𝑗
𝑙
=
𝑟 𝑖′ 𝑗′
𝛿 𝑟
𝑙+1 𝑤 𝑞𝑟
𝑙+1
𝜕𝑜𝑖′ 𝑗′
𝑙
𝜕𝑜𝑖𝑗
𝑙
𝑓′(𝑥𝑖𝑗
𝑙
) 14
• Index 𝑞는 𝑖′, j′으로 이루어져 있기 때문에 문제가 되지 않습니다.
• (BP2)와 비교해 보면
𝜕𝑜
𝑖′ 𝑗′
𝑙
𝜕𝑜𝑖𝑗
𝑙 항이 새로 생긴 것을 확인할 수 있습니다.
𝛿𝑗
𝑙
=
𝑘
𝑤 𝑘,𝑗
𝑙+1
𝛿 𝑘
𝑙+1
𝑓′(𝑥𝑗
𝑙
)
58
59. Multimedia Signal Processing Laboratory
Convolutional Neural Network
•
𝜕𝑜
𝑖′ 𝑗′
𝑙
𝜕𝑜𝑖𝑗
𝑙 항이 무엇인지 확인하기 앞서 Max pooling의 경우를 놓고 생각해보도록 하
겠습니다. 그림으로 나타내면 아래와 같습니다.
• 2x2 Max pooling이고 색이 진한 부분이 같은 색의 영역에서 가장 큰 값입니다.
59
60. Multimedia Signal Processing Laboratory
Convolutional Neural Network
•
𝜕𝑜
𝑖′ 𝑗′
𝑙
𝜕𝑜𝑖𝑗
𝑙 항은 max 함수를 미분한 것과 같습니다. 𝑜𝑖′ 𝑗′
𝑙
는 𝑜𝑖𝑗
𝑙
를 max pooling 한 것이
기 때문입니다. 수식으로 표현하면 다음과 같습니다.
𝑜𝑖′ 𝑗′
𝑙
= max nb(𝑜𝑖𝑗
𝑙
) (15)
60
61. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• 식에서 nb(𝑜𝑖𝑗
𝑙
)는 주어진 𝑜𝑖𝑗
𝑙
와 함께 pooling되는 이웃들을 나타냅니다. 2x2
pooling의 nb(𝑜11
𝑙
)는 𝑜00
𝑙
. 𝑜01
𝑙
. 𝑜10
𝑙
. 𝑜11
𝑙
이 됩니다. 그럼
𝜕𝑜
𝑖′ 𝑗′
𝑙
𝜕𝑜𝑖𝑗
𝑙 항에서 분모의 이웃들
이 분자와 아무런 관계가 없다면 0이 됩니다. 예를 들어
𝜕𝑜
0′0′
𝑙
𝜕𝑜02
𝑙 은 0입니다. 이런 식
으로 식(14)는 대부분의 경우 0이 되고 인덱스 𝑖, 𝑗와 관련 있는 𝑖′
, 𝑗′에 대해서만
생각하면 됩니다.여기에 수식을 입력하십시오.
𝑜′
= 𝑜/2 , 𝑝′
= 𝑝/2
61
62. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• ∙ 은 바닥 함수입니다. 정의는 다음과 같습니다.
𝑥 = max 𝑛 ≤ 𝑥 , floor 𝑥 , 𝑖𝑛𝑡(𝑥)
5.2 = 5, −5.2 = −6, 3 = 3
62
63. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• 식(14)는 식(16)으로 나타낼 수 있습니다.
𝛿𝑖𝑗
𝑙
=
𝑟
(𝑤
𝑟,
𝑖
𝑠
𝐽+
𝑗
𝑠
𝑙+1
𝛿 𝑟
𝑙+1)
𝜕𝑜 𝑖
𝑠
𝑗
𝑠
𝑙
𝜕𝑜𝑖𝑗
𝑙 𝑓′ 𝑥𝑖𝑗
𝑙
(16)
• 이제 식(16)은 좌변과 우변 모두 인덱스 𝑖, 𝑗만 남게 되었습니다(𝑟은 시그마에 의해
서 사라집니다.). 즉 식(16)에 𝑖, 𝑗만 넣으면 𝛿𝑖𝑗
𝑙
를 구할 수 있습니다.
63
64. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• 이제
𝜕𝑜 𝑖
2
𝑗
2
𝑙
𝜕𝑜𝑖𝑗
𝑙 항만 처리를 하면 됩니다.
𝜕𝑜 𝑖
2
𝑗
2
𝑙
𝜕𝑜𝑖𝑗
𝑙 항의 의미는 max 함수에 대한 미분이
고 max와 mean을 미분하면 다음과 같습니다.
𝑔 𝑥 = max 𝑥 ,
𝜕𝑔
𝜕𝑥
=
1, if 𝑥𝑖 = max(𝑥)
0, otherwise
(17)
𝑔 𝑥 =
𝑘=1
𝑚
𝑥 𝑘
𝑚
,
𝜕𝑔
𝜕𝑥
=
1
𝑚
(18)
64
65. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• 다시 한 번 backpropagation 관점에서 식(10)과 식(16)을 보면
𝛿𝑖𝑗
𝑙
=
𝑟 𝑖′ 𝑗′
𝜕E
𝜕𝑥 𝑟
𝑙+1
𝜕𝑥 𝑟
𝑙+1
𝜕𝑜𝑖′ 𝑗′
𝑙
𝜕𝑜𝑖′ 𝑗′
𝑙
𝜕𝑜𝑖𝑗
𝑙
𝜕𝑜𝑖𝑗
𝑙
𝜕𝑥𝑖𝑗
𝑙
𝛿𝑖𝑗
𝑙
=
𝑟
(𝑤
𝑟,(
𝑖
2 𝐽+
𝑗
2 )
𝑙+1
𝛿 𝑟
𝑙+1
)
𝜕𝑜 𝑖
2
𝑗
2
𝑙
𝜕𝑜𝑖𝑗
𝑙 𝑓′
𝑥𝑖𝑗
𝑙
65
Pooling layer 앞 까지의 gradient Pooling layer의 max 함수 미분
66. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• 아래의 그림에서 𝑟 𝑤 𝑞𝑟
𝑙+1
𝛿 𝑟
𝑙+1
은 모두 계산이 된 상태입니다. Max 함수를 미분하
면 입력된 값이 최대일 경우는 1, 나머지는 0이 됩니다.
66
0 0
0 0 0
0
0
0
0
0
0 0
𝑟
(𝑤0,𝑟
𝑙+1
𝛿 𝑟
𝑙+1)
𝑟
(𝑤1,𝑟
𝑙+1
𝛿 𝑟
𝑙+1)
𝑟
(𝑤2,𝑟
𝑙+1
𝛿 𝑟
𝑙+1)
𝑟
(𝑤3,𝑟
𝑙+1
𝛿 𝑟
𝑙+1)
𝑟
(𝑤1,𝑟
𝑙+1
𝛿 𝑟
𝑙+1)
𝑟
(𝑤0,𝑟
𝑙+1
𝛿 𝑟
𝑙+1)
𝑟
(𝑤2,𝑟
𝑙+1
𝛿 𝑟
𝑙+1)
𝑟
(𝑤3,𝑟
𝑙+1
𝛿 𝑟
𝑙+1)
70. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• 예를 들어 𝑜21
𝑙
에 대한 nb 𝑜21
𝑙
은 𝑅1 = 2,3 , 𝑅2 = [0,1]이므로 𝑜20
𝑙
, 𝑜21
𝑙
, 𝑜30
𝑙
, 𝑜31
𝑙
이
되고 이들은 𝑜21
𝑙
과 함께 pooling되는 곳임을 알 수 있습니다. 이제 𝛿𝑖𝑗
𝑙
를 완전히
구했으므로 (CBP3),(CBP4)를 통해
𝜕𝐸
𝜕𝑏 𝑙,
𝜕𝐸
𝜕𝑤 𝑎𝑏
𝑙 를 구할 수 있습니다.
𝜕𝐸
𝜕𝑏 𝑙
=
𝑖=0
𝑁−𝑚
𝑗=0
𝑁−𝑚
𝛿𝑖𝑗
𝑙
(CBP3)
𝜕𝐸
𝜕𝑤 𝑎𝑏
𝑙 =
𝑖=0
𝑁−𝑚
𝑗=0
𝑁−𝑚
𝛿𝑖𝑗
𝑙
𝑜𝑖+𝑎,𝑗+𝑏
𝑙−1
(CBP4)
70
71. Multimedia Signal Processing Laboratory
Convolutional Neural Network
• 지금까지 구한 𝛿𝑖𝑗
𝑙
은 𝑙번 째 층의 pooling 다음 layer가 FC layer일 때 입니다. 그
럼 pooling 다음이 convolution layer일 때도 계산해 보도록 합시다. 𝛿𝑖𝑗
𝑙
는 다음식
과 같이 변합니다.
𝛿𝑖𝑗
𝑙
=
𝜕𝐸
𝜕𝑥𝑖𝑗
𝑙 =
𝑖′ 𝑗′ 𝑚 𝑛
𝜕E
𝜕𝑥 𝑚𝑛
𝑙+1
𝜕𝑥 𝑚𝑛
𝑙+1
𝜕𝑜𝑖′ 𝑗′
𝑙
𝜕𝑜𝑖′ 𝑗′
𝑙
𝜕𝑜𝑖𝑗
𝑙
𝜕𝑜𝑖𝑗
𝑙
𝜕𝑥𝑖𝑗
𝑙 (21)
71