Convolutional Neural Networks (CNN)
BY: ABDULRAZAK ZAKIEH
ARTIFICIAL INTELLIGENCE CLASS, 2020-2021
LECTURER: PROF. ÖZLEM AKTAŞ
Content
CNNs Applications
Neural Networks (revision)
Convolution Neural Network
Padding
Stride Convolution
Convolution Over Volume
Layer Types in CNN
CNN Examples
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 2
Content
CNNs Applications
Neural Networks (revision)
Convolution Neural Network
Padding
Stride Convolution
Convolution Over Volume
Layer Types in CNN
CNN Examples
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 3
CNNs
Applicatios
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 4
level 2 autonomous driving assistance
TOGG
COVID-19 Artificial Intelligence Diagnosis
using only Cough Recordings
Jordi Laguarta, Ferran Hueto, Brian Subirana 30 SEP 2020
Content
CNNs Applications
Neural Networks (revision)
Convolution Neural Network
Padding
Stride Convolution
Convolution Over Volume
Layer Types in CNN
CNN Examples
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 5
Neural Networks (revision)
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 6
Y
output
Neural Networks (revision)
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 7
Fully Connected Fully Connected
Neural Networks (revision)
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 8
Neural Networks (revision)
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 9
???????
Neural Networks (revision)
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 10
???????
Neural Networks (revision)
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 11
???????
Does not capture the “natural” invariances
we expect in images (translation, scale)
Neural Networks (revision)
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 12
256 * 256 RGB image – 10 outputs – 1,966,080 Weights
Over fitting the data
Content
CNNs Applications
Neural Networks (revision)
Convolution Neural Network
Padding
Stride Convolution
Convolution Over Volume
Layer Types in CNN
CNN Examples
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 13
Filters – Horizontal Edges Detector
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 15
120 14 124 10 24
41 12 53 13 53
11 51 79 120 86
68 13 53 134 15
45 23 126 12 12
*
5 × 5
3 × 3
1 1 1
0 0 0
-1 -1 -1
Filters – Horizontal Edges Detector
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 16
1 1 1
0 0 0
-1 -1 -1
10 80 90 10 24
41 12 53 13 53
11 51 79 120 86
68 13 53 10 15
45 23 126 12 12
1 1 1
000
-1-1-1
39
1 1 1
000
-1-1-1
39 -70
1 1 1
000
-1-1-1
1 1 1
000
-1-1-1
1 1 1
000
-1-1-1
39 -70 -16139 -70 -161
-28
39 -70 -161
-28 2
1 1 1
000
-1-1-1
39 -70 -161
-28 2 41
1 1 1
000
-1-1-1
39 -70 -161
-28 2 41
-53
1 1 1
000
-1-1-1
39 -70 -161
-28 2 41
-53 89
1 1 1
000
-1-1-1
39 -70 -161
-28 2 41
-53 89 135
* =
5 × 5
3 × 3 3 × 3
Filters – Vertical Edges Detector
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 17
-1 0 1
-1 0 1
-1 0 1
10 80 90 10 24
41 12 53 13 53
11 51 79 120 86
68 13 53 10 15
45 23 126 12 12
1 1 1
000
-1-1-1
160
1 1 1
000
-1-1-1
160 0
1 1 1
000
-1-1-1
1 1 1
000
-1-1-1
1 1 1
000
-1-1-1
160 0 -59160 0 -59
65
160 0 -59
65 67
1 1 1
000
-1-1-1
160 0 -59
65 67 -31
1 1 1
000
-1-1-1
160 0 -59
65 67 -31
-134
1 1 1
000
-1-1-1
160 0 -59
65 67 -31
-134 55
1 1 1
000
-1-1-1
160 0 -59
65 67 -31
134 55 -39
* =
5 × 5
3 × 3 3 × 3
Filters
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 18
Convolutional Neural Networks (CNN)
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 19
Which filter to use?
Convolutional Neural Networks (CNN)
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 20
y = z * w
Convolutional Neural Networks (CNN)
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 21
“learn” the right filter(s) for the specified task
Content
CNN Applications
Neural Networks (revision)
Convolution Neural Network
Padding
Stride Convolution
Convolution Over Volume
Layer Types in CNN
CNN Examples
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 22
Padding
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 23
-1 0 1
-1 0 1
-1 0 1
10 80 90 10 24
41 12 53 13 53
11 51 79 120 86
68 13 53 10 15
45 23 126 12 12
160 0 -59
65 67 -31
134 55 -39
* =
5 × 5
3 × 33 × 3
Padding
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 24
“zero pad” the input image
Padding
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 25
-1 0 1
-1 0 1
-1 0 1
0 0 0 0 0 0 0
0 10 80 90 10 24 0
0 41 12 53 13 53 0
0 11 51 79 120 86 0
0 68 13 53 10 15 0
0 45 23 126 12 12 0
0 0 0 0 0 0 0
92 92 -79 -66 -23
143 160 0 -59 -143
76 65 67 -31 -143
87 134 55 -39 -142
36 66 -14 -152 -22
* =
5 × 5 5 × 5
3 × 3
7 × 7
10 80 90 10 24
41 12 53 13 53
11 51 79 120 86
68 13 53 10 15
45 23 126 12 12
Content
CNNs Applications
Neural Networks (revision)
Convolution Neural Network
Padding
Stride Convolution
Convolution Over Volume
Layer Types in CNN
CNN Examples
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 26
Stride Convolution
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 27
1 1 1
0 0 0
-1 -1 -1
10 80 90 10 24 23 73
41 12 53 13 53 12 82
11 51 79 120 86 57 23
68 13 53 10 15 12 64
45 23 126 12 12 86 12
72 82 45 65 95 81 51
46 97 71 123 69 8 62
1 1 1
000
-1-1-1
39
1 1 1
000
-1-1-1
39 -70
1 1 1
000
-1-1-11 1 1
000
-1-1-1
1 1 1
000
-1-1-1
39 -70 -16139 -70 -161
-28
39 -70 -161
-28 2
1 1 1
000
-1-1-1
39 -70 -161
-28 2 41
1 1 1
000
-1-1-1
39 -70 -161
-28 2 41
-53
1 1 1
000
-1-1-1
39 -70 -161
-28 2 41
-53 891 1 1
000
-1-1-1
39 -70 -161
-28 2 41
-53 89 135
* =
7 × 7
3 × 3 3 × 3
Stride = 2
Width and Height of the Output
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 28
Filter Size: f × f
Padding: p
Stride: s
Input width: 𝑛 𝑤
Input height: 𝑛ℎ
[
𝑛 𝑤 + 2𝑝 − 𝑓
𝑠
+ 1 ,
𝑛ℎ + 2𝑝 − 𝑓
𝑠
+ 1]
Valid and Same Convolution
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 29
Same Valid
50 * 50
n * n
SameCONV
s =1
p=(f –1) / 2
50 * 50 50 * 50
CONV
30 * 30
Content
CNNs Applications
Neural Networks (revision)
Convolution Neural Network
Padding
Stride Convolution
Convolution Over Volume
Layer Types in CNN
CNN Example
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 30
Convolution over Volume
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 31
1 1 1
0 0 0
-1 -1 -1
120 14 124 10 24
41 12 53 13 53
11 51 79 120 86
68 13 53 134 15
45 23 126 12 12
*
120 14 124 10 24
41 12 53 13 53
11 51 79 120 86
68 13 53 134 15
45 23 126 12 12
120 14 124 10 24
41 12 53 13 53
11 51 79 120 86
68 13 53 134 15
45 23 126 12 12
1 1 1
0 0 0
-1 -1 -1
1 1 1
0 0 0
-1 -1 -1
5 × 5 × 3
3 × 3 × 3
=
3939 -7039 -70 -16139 -70 -161
-28
39 -70 -161
-28 2
39 -70 -161
-28 2 41
39 -70 -161
-28 2 41
-53
39 -70 -161
-28 2 41
-53 89
39 -70 -161
-28 2 41
-53 89 135
R-G-B
𝒏 𝒘 × 𝒏 𝒉 × 𝒏 𝒄
𝒇 𝒉 × 𝒇 𝒘 × 𝒏 𝒄 𝒏 𝒘 𝟏 × 𝒏 𝒉 𝟏
3 × 3
Convolution over Volume
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 32
1 1 1
0 0 0
-1 -1 -1
120 14 124 10 24
41 12 53 13 53
11 51 79 120 86
68 13 53 134 15
45 23 126 12 12
*
120 14 124 10 24
41 12 53 13 53
11 51 79 120 86
68 13 53 134 15
45 23 126 12 12
120 14 124 10 24
41 12 53 13 53
11 51 79 120 86
68 13 53 134 15
45 23 126 12 12
1 1 1
0 0 0
-1 -1 -1
1 1 1
0 0 0
-1 -1 -1
R-G-B
5 × 5 × 3
3 × 3 × 3
=
39 -70 -161
-28 2 41
-53 89 135
-1 0 1
-1 0 1
-1 0 1
*
-1 0 1
-1 0 1
-1 0 1
-1 0 1
-1 0 1
-1 0 1
3 × 3 × 3
12 53 10
81 24 -11
61 -12 -53
39 -70 -161
-28 2 41
-53 89 135
12 53 10
81 24 -11
61 -12 -53
3 × 3
3 × 3
3 × 3 × 2
Convolution over Volume
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 33
1 1 1
0 0 0
-1 -1 -1
120 14 124 10 24
41 12 53 13 53
11 51 79 120 86
68 13 53 134 15
45 23 126 12 12
*
120 14 124 10 24
41 12 53 13 53
11 51 79 120 86
68 13 53 134 15
45 23 126 12 12
120 14 124 10 24
41 12 53 13 53
11 51 79 120 86
68 13 53 134 15
45 23 126 12 12
1 1 1
0 0 0
-1 -1 -1
1 1 1
0 0 0
-1 -1 -1
=
-1 0 1
-1 0 1
-1 0 1
-1 0 1
-1 0 1
-1 0 1
-1 0 1
-1 0 1
-1 0 1
39 -70 -161
-28 2 41
-53 89 135
12 53 10
81 24 -11
61 -12 -53
CONV
3 × 3 × 3
#2
5 × 5 × 3
3 × 3 × 2
CONV
f = 3
5 × 5 × 3
3 × 3 × 2
Convolution over Volume
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 34
Number of channels for each filter? 3, 4, 5
Number of filter? 3, 4, 5
Convolutional Neural Networks (CNN)
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 35
Mathematical: It’s correlation, not convolution
Content
CNNs Applications
Neural Networks (revision)
Convolution Neural Network
Padding
Stride Convolution
Convolution Over Volume
Layer Types in CNN
CNN Example
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 36
Layer Types in CNN
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 37
Max-PoolingCONV Fully Connected
Layer Types in CNN
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 38
Max-PoolingCONV Fully Connected
𝑧𝑖+1 = 𝑧𝑖 ∗ 𝑊𝑖
Layer Types in CNN
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 39
Max-PoolingCONV
𝑧𝑖+1 = 𝑧𝑖 ∗ 𝑊𝑖
10 80 90 10 24
41 12 53 13 53
11 51 79 120 86
68 13 53 10 15
45 23 126 12 12
9090 12090 120 12090 120 120
79
90 120 120
79 120
90 120 120
79 120 120
90 120 120
79 120 120
126
90 120 120
79 120 120
126 126
90 120 120
79 120 120
126 126 126
𝑓 = 3
S = 1
Layer Types in CNN
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 40
Max-Pooling
10 80 90 24
41 12 53 53
11 51 79 86
68 13 53 15
8080 9080 90
68
80 90
68 86
𝑓 = 2
S = 2
74 67
82 97
74 14 17 12
66 27 42 67
82 34 75 6
17 78 63 97
Layer Types in CNN
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 41
Max-Pooling
10 80 90 24
41 12 53 53
11 51 79 86
68 13 53 15
80 90
68 86
𝑓 = 2
S = 2
𝑀𝐴𝑋 𝑃𝑂𝑂𝐿
74 67
82 97
74 14 17 12
66 27 42 67
82 34 75 6
17 78 63 97
Layer Types in CNN
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 42
Max-Pooling
10 80 90 24
41 12 53 53
11 51 79 86
68 13 53 15
80 90
68 86
𝑓 = 2
S = 2
𝑀𝐴𝑋 𝑃𝑂𝑂𝐿
Fully Connected
Content
CNNs Applications
Neural Networks (revision)
Convolution Neural Network
Padding
Stride Convolution
Convolution Over Volume
Layer Types in CNN
CNN Examples
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 43
CNN Examples
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 44
LeNet-5
~ 60𝐾
CNN Examples
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 45
AlexNet [Krizhevskyet al., 2012. ImageNet Classification with Deep Convolutional Neural Networks]
AlexNet
~ 60𝑀
CNN Examples
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 46
AlexNet [Krizhevskyet al., 2012. ImageNet Classification with Deep Convolutional Neural Networks]
AlexNet
CNN Examples
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 47
AlexNet [Krizhevskyet al., 2012. ImageNet Classification with Deep Convolutional Neural Networks]
AlexNet
CNN Examples
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 48
Simonyon & Zisserman 2015 (~138 M)
VGG - 16
CNN Examples
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 49
Deep Residual Learningfor ImageRecognition (He.K et al. 2015)
ResNet
CNN Examples
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 50
Going Deeper with Convolutions (Christian Szegedy et. al. 2015)
GoogLeNet
Thanks for listening
ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 51

Convolutional Neural Network (CNN)

  • 1.
    Convolutional Neural Networks(CNN) BY: ABDULRAZAK ZAKIEH ARTIFICIAL INTELLIGENCE CLASS, 2020-2021 LECTURER: PROF. ÖZLEM AKTAŞ
  • 2.
    Content CNNs Applications Neural Networks(revision) Convolution Neural Network Padding Stride Convolution Convolution Over Volume Layer Types in CNN CNN Examples ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 2
  • 3.
    Content CNNs Applications Neural Networks(revision) Convolution Neural Network Padding Stride Convolution Convolution Over Volume Layer Types in CNN CNN Examples ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 3
  • 4.
    CNNs Applicatios ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM)4 level 2 autonomous driving assistance TOGG COVID-19 Artificial Intelligence Diagnosis using only Cough Recordings Jordi Laguarta, Ferran Hueto, Brian Subirana 30 SEP 2020
  • 5.
    Content CNNs Applications Neural Networks(revision) Convolution Neural Network Padding Stride Convolution Convolution Over Volume Layer Types in CNN CNN Examples ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 5
  • 6.
    Neural Networks (revision) ABDULRAZAKZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 6 Y output
  • 7.
    Neural Networks (revision) ABDULRAZAKZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 7 Fully Connected Fully Connected
  • 8.
    Neural Networks (revision) ABDULRAZAKZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 8
  • 9.
    Neural Networks (revision) ABDULRAZAKZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 9 ???????
  • 10.
    Neural Networks (revision) ABDULRAZAKZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 10 ???????
  • 11.
    Neural Networks (revision) ABDULRAZAKZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 11 ??????? Does not capture the “natural” invariances we expect in images (translation, scale)
  • 12.
    Neural Networks (revision) ABDULRAZAKZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 12 256 * 256 RGB image – 10 outputs – 1,966,080 Weights Over fitting the data
  • 13.
    Content CNNs Applications Neural Networks(revision) Convolution Neural Network Padding Stride Convolution Convolution Over Volume Layer Types in CNN CNN Examples ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 13
  • 14.
    Filters – HorizontalEdges Detector ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 15 120 14 124 10 24 41 12 53 13 53 11 51 79 120 86 68 13 53 134 15 45 23 126 12 12 * 5 × 5 3 × 3 1 1 1 0 0 0 -1 -1 -1
  • 15.
    Filters – HorizontalEdges Detector ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 16 1 1 1 0 0 0 -1 -1 -1 10 80 90 10 24 41 12 53 13 53 11 51 79 120 86 68 13 53 10 15 45 23 126 12 12 1 1 1 000 -1-1-1 39 1 1 1 000 -1-1-1 39 -70 1 1 1 000 -1-1-1 1 1 1 000 -1-1-1 1 1 1 000 -1-1-1 39 -70 -16139 -70 -161 -28 39 -70 -161 -28 2 1 1 1 000 -1-1-1 39 -70 -161 -28 2 41 1 1 1 000 -1-1-1 39 -70 -161 -28 2 41 -53 1 1 1 000 -1-1-1 39 -70 -161 -28 2 41 -53 89 1 1 1 000 -1-1-1 39 -70 -161 -28 2 41 -53 89 135 * = 5 × 5 3 × 3 3 × 3
  • 16.
    Filters – VerticalEdges Detector ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 17 -1 0 1 -1 0 1 -1 0 1 10 80 90 10 24 41 12 53 13 53 11 51 79 120 86 68 13 53 10 15 45 23 126 12 12 1 1 1 000 -1-1-1 160 1 1 1 000 -1-1-1 160 0 1 1 1 000 -1-1-1 1 1 1 000 -1-1-1 1 1 1 000 -1-1-1 160 0 -59160 0 -59 65 160 0 -59 65 67 1 1 1 000 -1-1-1 160 0 -59 65 67 -31 1 1 1 000 -1-1-1 160 0 -59 65 67 -31 -134 1 1 1 000 -1-1-1 160 0 -59 65 67 -31 -134 55 1 1 1 000 -1-1-1 160 0 -59 65 67 -31 134 55 -39 * = 5 × 5 3 × 3 3 × 3
  • 17.
  • 18.
    Convolutional Neural Networks(CNN) ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 19 Which filter to use?
  • 19.
    Convolutional Neural Networks(CNN) ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 20 y = z * w
  • 20.
    Convolutional Neural Networks(CNN) ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 21 “learn” the right filter(s) for the specified task
  • 21.
    Content CNN Applications Neural Networks(revision) Convolution Neural Network Padding Stride Convolution Convolution Over Volume Layer Types in CNN CNN Examples ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 22
  • 22.
    Padding ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM)23 -1 0 1 -1 0 1 -1 0 1 10 80 90 10 24 41 12 53 13 53 11 51 79 120 86 68 13 53 10 15 45 23 126 12 12 160 0 -59 65 67 -31 134 55 -39 * = 5 × 5 3 × 33 × 3
  • 23.
    Padding ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM)24 “zero pad” the input image
  • 24.
    Padding ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM)25 -1 0 1 -1 0 1 -1 0 1 0 0 0 0 0 0 0 0 10 80 90 10 24 0 0 41 12 53 13 53 0 0 11 51 79 120 86 0 0 68 13 53 10 15 0 0 45 23 126 12 12 0 0 0 0 0 0 0 0 92 92 -79 -66 -23 143 160 0 -59 -143 76 65 67 -31 -143 87 134 55 -39 -142 36 66 -14 -152 -22 * = 5 × 5 5 × 5 3 × 3 7 × 7 10 80 90 10 24 41 12 53 13 53 11 51 79 120 86 68 13 53 10 15 45 23 126 12 12
  • 25.
    Content CNNs Applications Neural Networks(revision) Convolution Neural Network Padding Stride Convolution Convolution Over Volume Layer Types in CNN CNN Examples ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 26
  • 26.
    Stride Convolution ABDULRAZAK ZAKIEH(ABDLARZAK.ZK@GMAIL.COM) 27 1 1 1 0 0 0 -1 -1 -1 10 80 90 10 24 23 73 41 12 53 13 53 12 82 11 51 79 120 86 57 23 68 13 53 10 15 12 64 45 23 126 12 12 86 12 72 82 45 65 95 81 51 46 97 71 123 69 8 62 1 1 1 000 -1-1-1 39 1 1 1 000 -1-1-1 39 -70 1 1 1 000 -1-1-11 1 1 000 -1-1-1 1 1 1 000 -1-1-1 39 -70 -16139 -70 -161 -28 39 -70 -161 -28 2 1 1 1 000 -1-1-1 39 -70 -161 -28 2 41 1 1 1 000 -1-1-1 39 -70 -161 -28 2 41 -53 1 1 1 000 -1-1-1 39 -70 -161 -28 2 41 -53 891 1 1 000 -1-1-1 39 -70 -161 -28 2 41 -53 89 135 * = 7 × 7 3 × 3 3 × 3 Stride = 2
  • 27.
    Width and Heightof the Output ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 28 Filter Size: f × f Padding: p Stride: s Input width: 𝑛 𝑤 Input height: 𝑛ℎ [ 𝑛 𝑤 + 2𝑝 − 𝑓 𝑠 + 1 , 𝑛ℎ + 2𝑝 − 𝑓 𝑠 + 1]
  • 28.
    Valid and SameConvolution ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 29 Same Valid 50 * 50 n * n SameCONV s =1 p=(f –1) / 2 50 * 50 50 * 50 CONV 30 * 30
  • 29.
    Content CNNs Applications Neural Networks(revision) Convolution Neural Network Padding Stride Convolution Convolution Over Volume Layer Types in CNN CNN Example ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 30
  • 30.
    Convolution over Volume ABDULRAZAKZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 31 1 1 1 0 0 0 -1 -1 -1 120 14 124 10 24 41 12 53 13 53 11 51 79 120 86 68 13 53 134 15 45 23 126 12 12 * 120 14 124 10 24 41 12 53 13 53 11 51 79 120 86 68 13 53 134 15 45 23 126 12 12 120 14 124 10 24 41 12 53 13 53 11 51 79 120 86 68 13 53 134 15 45 23 126 12 12 1 1 1 0 0 0 -1 -1 -1 1 1 1 0 0 0 -1 -1 -1 5 × 5 × 3 3 × 3 × 3 = 3939 -7039 -70 -16139 -70 -161 -28 39 -70 -161 -28 2 39 -70 -161 -28 2 41 39 -70 -161 -28 2 41 -53 39 -70 -161 -28 2 41 -53 89 39 -70 -161 -28 2 41 -53 89 135 R-G-B 𝒏 𝒘 × 𝒏 𝒉 × 𝒏 𝒄 𝒇 𝒉 × 𝒇 𝒘 × 𝒏 𝒄 𝒏 𝒘 𝟏 × 𝒏 𝒉 𝟏 3 × 3
  • 31.
    Convolution over Volume ABDULRAZAKZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 32 1 1 1 0 0 0 -1 -1 -1 120 14 124 10 24 41 12 53 13 53 11 51 79 120 86 68 13 53 134 15 45 23 126 12 12 * 120 14 124 10 24 41 12 53 13 53 11 51 79 120 86 68 13 53 134 15 45 23 126 12 12 120 14 124 10 24 41 12 53 13 53 11 51 79 120 86 68 13 53 134 15 45 23 126 12 12 1 1 1 0 0 0 -1 -1 -1 1 1 1 0 0 0 -1 -1 -1 R-G-B 5 × 5 × 3 3 × 3 × 3 = 39 -70 -161 -28 2 41 -53 89 135 -1 0 1 -1 0 1 -1 0 1 * -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 3 × 3 × 3 12 53 10 81 24 -11 61 -12 -53 39 -70 -161 -28 2 41 -53 89 135 12 53 10 81 24 -11 61 -12 -53 3 × 3 3 × 3 3 × 3 × 2
  • 32.
    Convolution over Volume ABDULRAZAKZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 33 1 1 1 0 0 0 -1 -1 -1 120 14 124 10 24 41 12 53 13 53 11 51 79 120 86 68 13 53 134 15 45 23 126 12 12 * 120 14 124 10 24 41 12 53 13 53 11 51 79 120 86 68 13 53 134 15 45 23 126 12 12 120 14 124 10 24 41 12 53 13 53 11 51 79 120 86 68 13 53 134 15 45 23 126 12 12 1 1 1 0 0 0 -1 -1 -1 1 1 1 0 0 0 -1 -1 -1 = -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 39 -70 -161 -28 2 41 -53 89 135 12 53 10 81 24 -11 61 -12 -53 CONV 3 × 3 × 3 #2 5 × 5 × 3 3 × 3 × 2 CONV f = 3 5 × 5 × 3 3 × 3 × 2
  • 33.
    Convolution over Volume ABDULRAZAKZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 34 Number of channels for each filter? 3, 4, 5 Number of filter? 3, 4, 5
  • 34.
    Convolutional Neural Networks(CNN) ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 35 Mathematical: It’s correlation, not convolution
  • 35.
    Content CNNs Applications Neural Networks(revision) Convolution Neural Network Padding Stride Convolution Convolution Over Volume Layer Types in CNN CNN Example ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 36
  • 36.
    Layer Types inCNN ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 37 Max-PoolingCONV Fully Connected
  • 37.
    Layer Types inCNN ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 38 Max-PoolingCONV Fully Connected 𝑧𝑖+1 = 𝑧𝑖 ∗ 𝑊𝑖
  • 38.
    Layer Types inCNN ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 39 Max-PoolingCONV 𝑧𝑖+1 = 𝑧𝑖 ∗ 𝑊𝑖 10 80 90 10 24 41 12 53 13 53 11 51 79 120 86 68 13 53 10 15 45 23 126 12 12 9090 12090 120 12090 120 120 79 90 120 120 79 120 90 120 120 79 120 120 90 120 120 79 120 120 126 90 120 120 79 120 120 126 126 90 120 120 79 120 120 126 126 126 𝑓 = 3 S = 1
  • 39.
    Layer Types inCNN ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 40 Max-Pooling 10 80 90 24 41 12 53 53 11 51 79 86 68 13 53 15 8080 9080 90 68 80 90 68 86 𝑓 = 2 S = 2
  • 40.
    74 67 82 97 7414 17 12 66 27 42 67 82 34 75 6 17 78 63 97 Layer Types in CNN ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 41 Max-Pooling 10 80 90 24 41 12 53 53 11 51 79 86 68 13 53 15 80 90 68 86 𝑓 = 2 S = 2 𝑀𝐴𝑋 𝑃𝑂𝑂𝐿
  • 41.
    74 67 82 97 7414 17 12 66 27 42 67 82 34 75 6 17 78 63 97 Layer Types in CNN ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 42 Max-Pooling 10 80 90 24 41 12 53 53 11 51 79 86 68 13 53 15 80 90 68 86 𝑓 = 2 S = 2 𝑀𝐴𝑋 𝑃𝑂𝑂𝐿 Fully Connected
  • 42.
    Content CNNs Applications Neural Networks(revision) Convolution Neural Network Padding Stride Convolution Convolution Over Volume Layer Types in CNN CNN Examples ABDULRAZAK ZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 43
  • 43.
    CNN Examples ABDULRAZAK ZAKIEH(ABDLARZAK.ZK@GMAIL.COM) 44 LeNet-5 ~ 60𝐾
  • 44.
    CNN Examples ABDULRAZAK ZAKIEH(ABDLARZAK.ZK@GMAIL.COM) 45 AlexNet [Krizhevskyet al., 2012. ImageNet Classification with Deep Convolutional Neural Networks] AlexNet ~ 60𝑀
  • 45.
    CNN Examples ABDULRAZAK ZAKIEH(ABDLARZAK.ZK@GMAIL.COM) 46 AlexNet [Krizhevskyet al., 2012. ImageNet Classification with Deep Convolutional Neural Networks] AlexNet
  • 46.
    CNN Examples ABDULRAZAK ZAKIEH(ABDLARZAK.ZK@GMAIL.COM) 47 AlexNet [Krizhevskyet al., 2012. ImageNet Classification with Deep Convolutional Neural Networks] AlexNet
  • 47.
    CNN Examples ABDULRAZAK ZAKIEH(ABDLARZAK.ZK@GMAIL.COM) 48 Simonyon & Zisserman 2015 (~138 M) VGG - 16
  • 48.
    CNN Examples ABDULRAZAK ZAKIEH(ABDLARZAK.ZK@GMAIL.COM) 49 Deep Residual Learningfor ImageRecognition (He.K et al. 2015) ResNet
  • 49.
    CNN Examples ABDULRAZAK ZAKIEH(ABDLARZAK.ZK@GMAIL.COM) 50 Going Deeper with Convolutions (Christian Szegedy et. al. 2015) GoogLeNet
  • 50.
    Thanks for listening ABDULRAZAKZAKIEH (ABDLARZAK.ZK@GMAIL.COM) 51