SlideShare a Scribd company logo
1 of 138
Topik 8
Pengantar Deep Learning
Dr. Sunu Wibirama
Modul Kuliah Kecerdasan Buatan
Kode mata kuliah: UGMx 001001132012
July 4, 2022
July 4, 2022
1 Capaian Pembelajaran Mata Kuliah
Topik ini akan memenuhi CPMK 5, yakni mampu mendefinisikan beberapa teknik ma-
chine learning klasik (linear regression, rule-based machine learning, probabilistic machine
learning, clustering) dan konsep dasar deep learning serta implementasinya dalam penge-
nalan citra (convolutional neural network).
Adapun indikator tercapainya CPMK tersebut adalah mengetahui sejarah singkat dan
aplikasi deep learning, mengerti dan memahami konsep backpropagation, perceptron, mema-
hami cara kerja convolutional neural network.
2 Cakupan Materi
Cakupan materi dalam topik ini sebagai berikut:
a) Artificial intelligence and deep learning: materi ini membahas sejarah dan perkem-
bangan riset jaringan syaraf tiruan (neural network) sebagai salah satu cikal bakal
dari teknologi kecerdasan buatan. Pada materi ini dibahas juga penemuan perceptron,
kelemahan perceptron yang tidak bisa menyelesaikan persamaan non-linear sederhana,
penemuan metode backpropagation, sampai dengan penggunaan deep learning hari
ini. Pada materi ini juga dibahas hal-hal yang mendasari pesatnya perkembangan
teknologi deep learning—perangkat keras, big data, dan perangkat lunak.
b) Visualizing deep learning: materi membahas cara kerja deep learning secara visual,
dengan ilustrasi yang mudah dipahami. Konsep-konsep dasar yang dijelaskan dalam
materi ini adalah proses training dalam jaringan syaraf tiruan, bagaimana jaringan
syaraf tiruan mengelola masukan, konsep bobot, konsep fungsi aktivasi, dan konsep
dasar feed forward neural network.
c) Deep learning essentials: materi ini membahas secara detail konsep dasar deep learn-
ing, yakni perceptron, stacking perceptron to form neural networks, optimization through
backpropagation, dan adaptive learning. Konsep loss function juga akan dibahas se-
cara detail dalam materi ini, meliputi binary cross entropy, mean squared error, dan
empirical loss.
d) Convolutional neural network: materi ini akan membahas secara detail konsep feature
engineering dengan konvolusi, konsep pooling, konsep normalization, dan konsep dense
network dalam sebuah arsitektur deep learning—convolutional neural network. Selain
itu, materi ini juga akan membahas kelebihan dan kekurangan convolutional neural
network, serta berbagai macam implementasinya.
1
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1
Sunu Wibirama
sunu@ugm.ac.id
Department of Electrical and Information Engineering
Faculty of Engineering
Universitas Gadjah Mada
INDONESIA
Introduction to Deep Learning (Part 01)
Kecerdasan Buatan | Artificial Intelligence
Version: January 2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2
Source: A. Amini (6.S191 Introduction to Deep Learning | MIT, 2019)
The rise of deep learning
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3
https://www.mygreatlearning.com/blog/deep-learning-applications/
Deep learning applications
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4
Source: A. Amini (6.S191 Introduction to Deep Learning | MIT, 2019)
What is deep learning?
Artificial intelligence and deep learning
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5
Neural networks vs. deep neural networks
Source: https://www.pnas.org/content/pnas/116/4/1074/F2.large.jpg
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6
http://beamandrew.github.io/deeplearning/2017/02/23/deep_learning_101_part1.html
Milestones in the development of neural networks
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7
7
End of File
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1
Sunu Wibirama
sunu@ugm.ac.id
Department of Electrical and Information Engineering
Faculty of Engineering
Universitas Gadjah Mada
INDONESIA
Introduction to Deep Learning (Part 02)
Kecerdasan Buatan | Artificial Intelligence
Version: January 2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2
Early version of neural networks
(Andrew Beam, 2017)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3
(Andrew Beam, 2017)
The first AI Winter (1969)
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4
Early perceptron was not able
to classify simple non linear function such as XOR function
XOR problem in early perceptron
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5
(Andrew Beam, 2017)
The emergence of backpropagandists (1986)
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6
Neural networks was used to recognize hand writing in
a bank check (LeCun,1999)
(Andrew Beam, 2017)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7
The rise of deep learning in Silicon Valley (2012)
• 2012 was the first year that neural nets grew to prominence
• Alex Krizhevsky, Ilya Sutskever, and Geoffrey Hinton used
them to win that year’s ImageNet competition (it is the
annual olympics of computer vision)
• They dropped the classification error record from 26.2% to
15.3%, a remarkable improvement at the time.
• Ever since then, a host of companies have been using
deep learning at the core of their services:
• Facebook uses neural nets for their automatic tagging
algorithms
• Google for their photo search
• Amazon for their product recommendations
• Pinterest for their home feed personalization
• Instagram for their search infrastructure.
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8
(Andrew Beam, 2017)
Deep learning has mastered GO (2016)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9
Playing video game with deep learning
(Andrew Beam, 2017)
Playing game with deep learning
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10
https://towardsdatascience.com/machine-learning-methods-to-aid-in-coronavirus-response-70df8bfc7861
Using deep learning to investigate probability
of Covid-19 infection through classification of CT scan images (2020)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11
Source: A. Amini (6.S191 Introduction to Deep Learning | MIT, 2019)
What was behind the emergence of deep learning?
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12
12
End of File
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1
Sunu Wibirama
sunu@ugm.ac.id
Department of Electrical and Information Engineering
Faculty of Engineering
Universitas Gadjah Mada
INDONESIA
Introduction to Deep Learning (Part 03)
Kecerdasan Buatan | Artificial Intelligence
Version: January 2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2
Workflow of Traditional Machine Learning
Most machine learning research works try
to develop novel features for more accurate performance
Workflow of traditional machine learning
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6
Deep learning
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10
Pros and cons
Source: Introducing Deep Learning with Matlab (Mathworks, 2018)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11
Where to start learning deep learning?
John D. Kelleher,
“Deep Learning”, MIT Press, 2019
Jon Krohn, Grant Beyleveld, Aglae Bassens
“Deep Learning Illustrated”, Pearson, 2019
Ian Goodfellow, Yoshua Bengio, Aaron Courville
“Deep Learning”, MIT Press, 2016
Easy Medium Hard
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12
MIT 6.S191 – Introduction to Deep Learning
http://introtodeeplearning.com
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13
Deep Learning Course @ NYU Center for Data Science
https://cds.nyu.edu/deep-learning/
https://atcold.github.io/pytorch-Deep-Learning/
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15
15
End of File
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1
Sunu Wibirama
sunu@ugm.ac.id
Introduction to Deep Learning (Part 04)
Department of Electrical and Information Engineering
Faculty of Engineering
Universitas Gadjah Mada
Kecerdasan Buatan | Artificial Intelligence
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2
1986 2015
Read these papers for detailed explanation
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3
Basic concept of deep learning
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4
The Perceptron: forward propagation
Source: A. Amini (6.S191 Introduction to Deep Learning | MIT, 2019)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5
Source: A. Amini (6.S191 Introduction to Deep Learning | MIT, 2019)
Common activation functions
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6
Source: A. Amini (6.S191 Introduction to Deep Learning | MIT, 2019)
Importance of activation functions
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7
Now, let’s go to the simplest one. We
have a camera with 2 x 2 pixels of
resolution.
The following slides are based on Brandon Rohrer’s lecture (2017), crowned as the best Deep Learning lecture in KDDNuggets
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8
A four pixel camera
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9
Categorize images solid
vertical
diagonal
horizontal
If we have a picture, can we ask our computer to
decide: what type of image it is?
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10
Categorize images solid
vertical
diagonal
horizontal
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11
Categorize images solid
vertical
diagonal
horizontal
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12
Categorize images solid
vertical
diagonal
horizontal
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13
solid
vertical
diagonal
horizontal
Categorize images
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14
However, if you have so many possible combination,
simple rules can’t do it solid
vertical
diagonal
horizontal
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15
Instead of coding by yourself, we use
neural networks
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 16
16
End of File
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1
Sunu Wibirama
sunu@ugm.ac.id
Introduction to Deep Learning (Part 05)
Department of Electrical and Information Engineering
Faculty of Engineering
Universitas Gadjah Mada
Kecerdasan Buatan | Artificial Intelligence
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2
dendrites
soma
axon
Drawing of
Purkinje cells (A) and
granule cells (B) from
pigeon cerebellum by
Santiago Ramón y
Cajal,
1899; Instituto Cajal,
Madrid, Spain
B
A
Diagrams of neurons
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3
Diagrams of neurons
• Axons can connect to dendrites strongly, weakly, or
somewhere in between.
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4
Diagrams of neurons
• Medium connection (.6)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5
Diagrams of neurons
• Strong connection (1.0)
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6
Diagrams of neurons
• Weak connection (.2)
• No connection is a 0.
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7
Diagrams of neurons
• Lots of axons connect with the dendrites of one neuron.
• Each has its own connection strength.
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8
Redrawing and simplifying …
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9
Adding quantitative weight
.8 .9
.2
.3
.5
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10
Back to our 2 x 2 image…
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11
Input neurons
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12
Pixel brightness
-.75 -.50 -.25 0.0 +.25 +.50 +.75 +1.0
We quantify the brightness with a scaled range
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13
.75
-.75
0.0
.50
Input vector
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14
Receptive fields
Each input neuron will only consider pixel value
at a particular position, regardless of pixel value
at the other positions
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15
A neuron
+
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 16
Sum all the inputs
+
.75
-.75
0.0
.50
.50
.50
0.00
-.75
+ .75
.50
+
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 17
Weights
+
.75
-.75
0.0
.50
.50
1.0
1.0
1.0
1.0
.50
0.00
-.75
+ .75
.50
x 1.0
x 1.0
x 1.0
x 1.0
The art of neural networks lay in the
strength of each neuron. Hence, weight of
neuron.
+
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 18
Weights
+
.75
-.75
0.0
.50
-1.075
-.2
0.0
.8
-.5
.50
0.00
-.75
+ .75
-1.075
-.2
0.0
.8
-.5
x
x
x
x
The art of neural networks lay in the
strength of each neuron. Hence, weight of
neuron
+
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 19
Weights
+
.75
-.75
0.0
.50
-1.075
-.2
0.0
.8
-.5
.50
0.00
-.75
+ .75
-1.075
-.2
0.0
.8
-.5
x
x
x
x
Now, we represent the weight as:
Black : negative
Missing: zero
Orange: positive
+
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 20
Squash the result
+
.75
-.75
0.0
.50
-1.075 -0.746
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 21
Sigmoid squashing function
1.0
.5
-1.0
-.5
1.0
.5 1.5 2.0
-1.0 -.5
-1.5
-2.0
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 22
Sigmoid squashing function
1.0
.5
-1.0
-.5
1.0
.5 1.5 2.0
-1.0 -.5
-1.5
-2.0
Your number goes in here
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 23
Sigmoid squashing function
1.0
.5
-1.0
-.5
1.0
.5 1.5 2.0
-1.0 -.5
-1.5
-2.0
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 24
Sigmoid squashing function
1.0
.5
-1.0
-.5
1.0
.5 1.5 2.0
-1.0 -.5
-1.5
-2.0
The squashed version
comes out here
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 25
Sigmoid squashing function
1.0
.5
-1.0
-.5
1.0
.5 1.5 2.0
-1.0 -.5
-1.5
-2.0
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 26
Sigmoid squashing function
1.0
.5
-1.0
-.5
1.0
.5 1.5 2.0
-1.0 -.5
-1.5
-2.0
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 27
No matter what you start with,
the answer stays between -1 and 1.
1.0
.5
-1.0
-.5
1.0
.5 1.5 2.0
-1.0 -.5
-1.5
-2.0
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 28
28
End of File
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1
Sunu Wibirama
sunu@ugm.ac.id
Introduction to Deep Learning (Part 06)
Department of Electrical and Information Engineering
Faculty of Engineering
Universitas Gadjah Mada
Kecerdasan Buatan | Artificial Intelligence
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2
Squash the result
+
.75
-.75
0.0
.50
-1.075 -0.746
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3
Weighted sum-and-squash neuron
.75
-.75
0.0
.50
-0.746
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4
Make lots of neurons, identical except for weights
To keep our picture clear, weights
will either be
1.0 (orange)
-1.0 (black) or
0.0 (missing)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5
Receptive fields get more complex
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6
Repeat for additional layers
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7
Receptive fields get still more complex
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8
Repeat with a variation
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9
Rectified linear units (ReLUs)
1.0
.5
-1.0
-.5
1.0
.5 1.5 2.0
-1.0 -.5
-1.5
-2.0
If your number is positive, keep it.
Otherwise you get a zero.
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10
Positive: solid white
Negative: solid black
Positive: left vertical
Negative: right vertical
Positive: right diagonal
Negative: left diagonal
Positive: bottom horizontal
Negative: top horizontal
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11
Add an output layer
solid
vertical
diagonal
horizontal
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12
solid
vertical
diagonal
horizontal
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13
Remember the big picture?
If we have more pixels, we can represent more complex receptive fields
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14
solid
vertical
diagonal
horizontal
Now, let’s set the receptive fields according to the input
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15
solid
vertical
diagonal
horizontal
Now, let’s set the receptive fields according to the input
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 16
solid
vertical
diagonal
horizontal
Now, let’s set the receptive fields according to the input
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 17
solid
vertical
diagonal
horizontal
Now, let’s set the receptive fields according to the input
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 18
solid
vertical
diagonal
horizontal
Now, let’s set the receptive fields according to the input
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 19
solid
vertical
diagonal
Now, let’s set the receptive fields according to the input
horizontal
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 20
Summary?
• Traditional machine learning research focuses on finding
a novel features. Good for small training datasets, but
requires domain knowledge.
• Deep learning is a type of neural networks with enormous
hidden layers and new type of training method.
• So far, we have learned basic concepts of:
– Perceptron
– Activation function in neural networks
– Feed forward architecture
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 21
21
End of File
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1
Sunu Wibirama
sunu@ugm.ac.id
Deep Learning Essentials (Part 01)
Department of Electrical and Information Engineering
Faculty of Engineering
Universitas Gadjah Mada
Kecerdasan Buatan | Artificial Intelligence
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2
Core components of deep learning
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3
Core components of deep learning
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
The Perceptron: forward propagation
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
The Perceptron: forward propagation
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6
The Perceptron: forward propagation
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7
e = 2.718..
(Euler
number)
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
The Perceptron: forward propagation
z
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8
Common activation functions
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Importance of activation functions
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10
Importance of activation functions
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Importance of activation functions
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
The Perceptron: example
z
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
The Perceptron: example
z
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
The Perceptron: example
z
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
The Perceptron: example
z
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 16
16
End of File
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1
Sunu Wibirama
sunu@ugm.ac.id
Deep Learning Essentials (Part 02)
Department of Electrical and Information Engineering
Faculty of Engineering
Universitas Gadjah Mada
Kecerdasan Buatan | Artificial Intelligence
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2
Core components of deep learning
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3
Core components of deep learning
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
From perceptron to feed forward networks
Perceptron: simplified
Note: for simplicity,
we remove the drawing of bias
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5
From perceptron to feed forward networks
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Multi outputs Perceptron
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6
From perceptron to feed forward networks
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Single layer neural networks
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7
w
w
w
From perceptron to feed forward networks
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Single layer neural networks
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8
From perceptron to feed forward networks
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Multi output perceptron
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9
From perceptron to feed forward networks
Deep feed forward networks
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Example problem
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Example problem: Will I pass this class?
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Example problem: Will I pass this class?
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Example problem: Will I pass this class?
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Example problem: Will I pass this class?
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Quantifying loss
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 16
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Empirical loss
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 17
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Binary cross entropy loss
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 18
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Mean squared error loss
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 19
19
End of File
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1
Sunu Wibirama
sunu@ugm.ac.id
Deep Learning Essentials (Part 03)
Department of Electrical and Information Engineering
Faculty of Engineering
Universitas Gadjah Mada
Kecerdasan Buatan | Artificial Intelligence
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2
Core components of deep learning
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3
Core components of deep learning
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4
Core maths in deep learning
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5
Core maths in deep learning
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6
Chain rules
Composite function refers to the composition of two
functions: one function takes the output of the
other as input.
Consider = and = 2 . You can
compose these functions as
= 2 = 2
To calculate derivatives of composite functions,
you need to use the chain rule:
Note:
The chain rule is important to understand concept of deep neural networks: to
update the network parameters, the chain rule is used to calculate the derivative of
the cost function and update the parameters accordingly (backpropagation).
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7
Chain rules
Again, consider = and = 2 .
Based on basic functions of derivatives, we have:
( )
( )
= 2 and
( )
( )
= 2 .
Using chain rules, let’s calculate the derivative of ℎ( ):
(ℎ )
( )
=
( )
( )
( )
( )
Because = ( ) , we have ′ = 2 ( ).
In addition, we also have = 2.
Thus: ℎ = ′
= 2 ( ) 2
= 2 2x 2 = 8x
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8
Partial derivatives and gradient
• You can use the stylized cursive letter d, ∂, that
can be called “curly d”, to refer to partial
derivatives.
• Let’s take the following function as a first example:
The function takes the two variables and
as input.
• Partial derivatives of , = + are
derivatives with respect to each independent
variable ( and ).
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9
Partial derivatives and gradient
The partial derivative of , with
respect to (considering as a constant)
Likewise, the partial derivative of ,
with respect to (considering as a
constant)
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10
Partial derivatives and gradient
• Suppose you calculate the derivative with
respect to each variable of a function
( , , , … , ) and store all these partial
derivatives in a vector named with the symbol ∇
(“nabla”).
• It is the gradient of f: ∇f is pronounced here
gradient of f, grad f or del f, and contains the
partial derivatives of the function with respect
to each variable:
http://www.claudiobellei.com/2018/01/06/backprop-word2vec/
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Learning: loss optimization
In deep learning, the way to adjust weights is to optimize to loss function
Thus, learning means automatically finding appropriate weights that optimize loss function
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12
Find elements of vector (consists of several weights)
that minimizes ( )
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Loss optimization
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13
for all layers
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Loss optimization
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Loss optimization
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Loss optimization
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 16
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Loss optimization
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 17
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Loss optimization
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 18
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Gradient descent
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 19
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Gradient descent
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 20
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Gradient descent
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 21
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Computing gradient: backpropagation
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 22
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Computing gradient: backpropagation
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 23
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Computing gradient: backpropagation
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 24
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Computing gradient: backpropagation
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 25
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Computing gradient: backpropagation
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 26
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Computing gradient: backpropagation
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 27
(Alexander Amini, 2019)
Training deep neural networks is difficult
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 28
Lost functions can be difficult to optimize
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 29
Lost functions can be difficult to optimize
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 30
Source: https://www.jeremyjordan.me/nn-learning-rate/
Setting the learning rate
( )
( )
( )
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 31
Adaptive learning rates
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 32
Adaptive learning rates
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 33
Review: core components of deep learning
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 34
34
End of File
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1
Sunu Wibirama
sunu@ugm.ac.id
Convolutional Neural Network (Part 01)
Department of Electrical and Information Engineering
Faculty of Engineering
Universitas Gadjah Mada
Kecerdasan Buatan | Artificial Intelligence
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2
What is Convolutional Neural Network?
• Directly using the original image for recognition (as in the
previous lecture) leads to poor accuracy. Hence, CNN is
developed.
• CNN is one of the most popular deep learning architectures
• Very good deep learning architecture for computer vision task:
object recognition / object classification
• It implements “convolution” to extract features inside the training
set before sending features value to neural network layers
• Used by Alex Krizhevsky, Ilya Sutskever, and Geoffrey Hinton to
win ImageNet Competition (dropping classification error from
26.2% to 15.3%).
• Used in autonomous car of Nvidia.
How can you differentiate
cat vs. dog?
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3
Proposed method
Top-5 error rate: 15.3%
What is Convolutional Neural Network?
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4
How self-driving car works?
https://devblogs.nvidia.com/deep-learning-self-driving-cars/
Training the neural network.
The trained network is used to generate steering
commands from a single front-facing center camera.
High-level view of the data collection system. Input
Input
Actual output by
human driver
Actual output by
human driver
Computed
output
Computed
output
Input
Input Computed output
Computed output
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5
CNN architecture
Feature extraction network Classifier network
Source: https://adeshpande3.github.io/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks/
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6
CNN architecture
Feature extraction network Classifier network
Source: https://adeshpande3.github.io/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks/
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7
Feature extraction network: convolution
Convolution
ReLU
Pooling
Convolution
ReLU
Convolution
ReLU
Pooling
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8
How can you differentiate a Samoyed dog and a Wolf?
The computer should be robust from small variations of similar object (e.g.: images of Samoyed dog
taken from different point of views)but sensitive enough to recognize different objects with almost
similar appearance (Samoyed dog vs. Wolf)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9
A toy CNN: X’s (SamoyedDog) and O’s (Wolf)
Says whether a picture is of an X or an O
X or O
CNN
A two-dimensional
array of pixels
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10
For example
CNN
X
CNN
O
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11
Trickier cases: variations of similar object
CNN
X
CNN
O
translation scaling weight
rotation
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12
Deciding is hard
=
?
What do you think? Is it the same “X” ?
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13
What computers see
=
?
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14
What computers see
Some parts match with original image, some parts don’t
Original image Rotated image
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15
Computers are literal
=
x
Computers will say, “Uncertain, I don’t know whether this image matches with another”
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 16
CNN match pieces of the image
=
=
=
Rather than matching the whole thing, we match parts of image
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 17
Features match pieces of the image
• Rather than matching the whole thing, we match parts of
image
• We provide convolutional filters for this. Note that the
values of the filter are trained using backpropagation
algorithm.
• Therefore, these values are continuously trained
throughout the training process. This aspect is similar to
the updating process of the connection weights of the
ordinary neural network.
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 18
Features match pieces of the image
Diagonal line
(downward left to right)
Diagonal line
(Downward right to left)
Little “X”
Three different convolutional filters (kernels)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 19
Notes about convolutional kernel
In this example, the pixel values of the kernel
are fixed, for the sake of simplicity.
However in real world CNN, the kernel’s
values are initialized with random values,
and then learned and optimized through
backpropagation (just like weights in deep
neural network)
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 20
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 21
21
End of File
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1
Sunu Wibirama
sunu@ugm.ac.id
Convolutional Neural Network (Part 02)
Department of Electrical and Information Engineering
Faculty of Engineering
Universitas Gadjah Mada
Kecerdasan Buatan | Artificial Intelligence
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2
CNN architecture
Feature extraction network Classifier network
Source: https://adeshpande3.github.io/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks/
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3
Features match pieces of the image
Diagonal line
(downward left to right)
Diagonal line
(Downward right to left)
Little “X”
Three different convolutional filters (kernels)
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4
Those features match the image exactly
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5
Those features match the image exactly
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6
Those features match the image exactly
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7
Those features match the image exactly
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8
Those features match the image exactly
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9
Filtering: the math behind the match
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10
Filtering: the math behind the match
1. Line up the feature and the image patch.
2. Multiply each image pixel by the corresponding
feature pixel.
3. Stride / slide the filter (usually one or two pixels)
4. Add them up.
5. Divide by the total number of pixels in the feature.
Note: stride is the number of pixels with which we slide our filter
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11
1 x 1 = 1
Filtering: the math behind the match
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12
1 x 1 = 1
Filtering: the math behind the match
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13
Filtering: the math behind the match
-1 x -1 = 1
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14
Filtering: the math behind the match
-1 x -1 = 1
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15
Filtering: the math behind the match
-1 x -1 = 1
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 16
Filtering: the math behind the match
1 x 1 = 1
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 17
Filtering: the math behind the match
-1 x -1 = 1
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 18
Filtering: the math behind the match
-1 x -1 = 1
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 19
Filtering: the math behind the match
-1 x -1 = 1
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 20
Filtering: the math behind the match
1 x 1 = 1
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 21
Filtering: the math behind the match
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 22
Filtering: the math behind the match
1 x 1 = 1
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 23
Filtering: the math behind the match
-1 x 1 = -1
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 24
Filtering: the math behind the match
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 25
Filtering: the math behind the match
.55
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 26
Convolution: trying every possible match
Move the filter on the whole pixels,
we get the following map
9 X 9 (n x n) 9 - (m-1) x 9 - (m-1)
= 7 X 7
3 X 3
(m x m)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 27
Convolution: trying every possible match
=
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 28
=
=
=
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 29
Convolution layer
One image becomes a stack of filtered images
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 30
Convolution layer
One image becomes a stack of filtered images
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 31
Feature extraction network: ReLU
Convolution
ReLU
Pooling
Convolution
ReLU
Convolution
ReLU
Pooling
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 32
Normalization
• Keep the math from breaking
by tweaking each of the
values just a bit.
• Change everything negative
to zero.
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 33
Rectified Linear Units (ReLUs)
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 34
Rectified Linear Units (ReLUs)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 35
Rectified Linear Units (ReLUs)
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 36
Rectified Linear Units (ReLUs)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 37
ReLU layer
A stack of images becomes a stack of images with
no negative values.
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 38
Feature extraction network: Pooling
Convolution
ReLU
Pooling
Convolution
ReLU
Convolution
ReLU
Pooling
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 39
Pooling: Shrinking the image stack
1. Pick a window size (usually 2 or 3).
2. Decide a stride (moving step, usually 2)
3. Walk your window across your filtered images.
4. From each window, take the maximum value.
Note: stride is the number of pixels with which we slide our filter
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 40
Pooling
maximum
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 41
Pooling
maximum
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 42
Pooling
maximum
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 43
Pooling
maximum
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 44
Pooling
maximum
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 45
Pooling
max pooling
We get similar patter with
the original map, but smaller
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 46
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 47
Pooling layer
A stack of images becomes a stack of smaller images.
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 48
Layers get stacked
The output of one becomes the input of the next
Convolution
ReLU
Pooling
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 49
Deep stacking
Layers can be repeated several (or many) times
Convolution
ReLU
Pooling
Convolution
ReLU
Convolution
ReLU
Pooling
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 50
50
End of File
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1
Sunu Wibirama
sunu@ugm.ac.id
Convolutional Neural Network (Part 03)
Department of Electrical and Information Engineering
Faculty of Engineering
Universitas Gadjah Mada
Kecerdasan Buatan | Artificial Intelligence
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2
CNN architecture
Feature extraction network Classifier network
Source: https://adeshpande3.github.io/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks/
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3
CNN architecture
Feature extraction network Classifier network
Source: https://adeshpande3.github.io/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks/
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4
Fully connected layer
The outputs are stacked into one layer
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5
Fully connected layer
Vote depends on how strongly a value predicts X or O
X
O
Some pixels of
this stacked layer
(we call it extracted feature)
will have large values for
a certain input (whether it is
X or O)
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6
Fully connected layer
Vote depends on how strongly a value predicts X or O
X
O
Some pixels of
this stacked layer
(we call it extracted feature)
will have large values for
a certain input (whether it is
X or O)
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7
Fully connected layer
Future values vote on X or O
X
O
These pixels decide the label
of an unseen new input.
Pixel #1, 4, 5, 10, 11
are used for voting class X
Pixel #2, 3, 9, 12 are used
for voting class O
1
2
3
4
5
6
7
8
9
10
11
12
1
2
3
4
5
6
7
8
9
10
11
12
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8
Fully connected layer
Future values vote on X or O
X
O
Suppose we have
a new unseen input.
We want to decide
whether this is a Samoyed
dog or Wolf
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9
Fully connected layer
Future values vote on X or O
X
O
.92
Suppose we have
a new unseen input.
We want to decide
whether this is a Samoyed
dog or Wolf
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10
Fully connected layer
X
O
.92
Suppose we have
a new unseen input.
We want to decide
whether this is a Samoyed
dog or Wolf
Future values vote on X or O
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11
Fully connected layer
X
O
.92
.51
Suppose we have
a new unseen input.
We want to decide
whether this is a Samoyed
dog or Wolf
Future values vote on X or O
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12
Fully connected layer
X
O
.92
.51
Suppose we have
a new unseen input.
We want to decide
whether this is a Samoyed
dog or Wolf
OK, so this is
a dog, according
to your AI system
Future values vote on X or O
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13
Fully connected layer
A list of feature values becomes a list of votes
X
O
These features become input
for a deep neural network
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14
Fully connected layer
These can also be stacked
X
O
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15
Putting it all together
A set of pixels becomes a set of votes.
Convolution
ReLU
Pooling
Convolution
ReLU
Convolution
ReLU
Pooling
Fully
connected
Fully
connected
X
O
.92
.51
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 16
Backpropagation
Error = right answer – actual answer
Convolution
ReLU
Pooling
Convolution
ReLU
Convolution
ReLU
Pooling
Fully
connected
Fully
connected
X
O
.92
.51
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 17
Convolution
ReLU
Pooling
Convolution
ReLU
Convolution
ReLU
Pooling
Fully
connected
Fully
connected
X
O
.92
.51
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 18
.92
Convolution
ReLU
Pooling
Convolution
ReLU
Convolution
ReLU
Pooling
Fully
connected
Fully
connected
X
O
.51
.92
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 19
.92
Convolution
ReLU
Pooling
Convolution
ReLU
Convolution
ReLU
Pooling
Fully
connected
Fully
connected
X
O
.51
.92
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 20
.92
Convolution
ReLU
Pooling
Convolution
ReLU
Convolution
ReLU
Pooling
Fully
connected
Fully
connected
X
O
.51
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 21
Convolution
ReLU
Pooling
Convolution
ReLU
Convolution
ReLU
Pooling
Fully
connected
Fully
connected
X
O
.51
.92
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 22
(Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
Use backpropagation to minimize loss function
Backpropagation can be used in CNN to
automatically find appropriate weights that minimize loss function
Convolution
ReLU
Pooling
Convolution
ReLU
Convolution
ReLU
Pooling
Fully
connected
Fully
connected
X
O
.51
.92
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 23
CNN can be used to other data
• Any 2D (or 3D) data.
• Things closer together are
more closely related than
things far away.
Columns of pixels
Rows
of
pixels
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 24
Time steps
Intensity
in
each
frequency
band
CNN can be used to other data
SOUND
Position in sentence
Words
in
dictionary
TEXT
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 25
Limitations
• CNN only captures local “spatial”
patterns in data.
• If the data can’t be made to look
like an image, CNN is less useful.
• If your data is just as useful after
swapping any of your columns
with each other, then you can’t
use Convolutional Neural
Networks.
• Example: customer data
Name, age,address,
email,purchases,browsing activity,…
Customers
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 26
Take home messages
• In this lecture, we learn about
a well-known variant of deep learning,
Convolutional Neural Networks (CNN).
• CNN consists of two parts: feature extraction
networks and classifiers networks.
• Convolution layers are useful to extract
features from input images.
• Pooling layers are used to squeeze the data
• ReLU layers are used for normalization,
converting data to a range of 0 to 1.
• There are so many variants of CNN, each of
them has been developed to solve specific
problem.
Source: https://towardsdatascience.com/top-10-cnn-architectures-every-machine-learning-engineer-should-know-68e2b0e07201
01/07/2022
sunu@ugm.ac.id
Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 27
27
End of File

More Related Content

Similar to Modul Topik 8 - Kecerdasan Buatan

Introduction to Artificial Intelligence - Pengenalan Kecerdasan Buatan
Introduction to Artificial Intelligence - Pengenalan Kecerdasan BuatanIntroduction to Artificial Intelligence - Pengenalan Kecerdasan Buatan
Introduction to Artificial Intelligence - Pengenalan Kecerdasan BuatanSunu Wibirama
 
IRJET- Image Privacy Protection as a Single Share
IRJET-  	  Image Privacy Protection as a Single ShareIRJET-  	  Image Privacy Protection as a Single Share
IRJET- Image Privacy Protection as a Single ShareIRJET Journal
 
The power of deep learning models applications
The power of deep learning models applicationsThe power of deep learning models applications
The power of deep learning models applicationsSameera Sk
 
A Survey on Privacy Preserving by Protecting the Images in Social Media using...
A Survey on Privacy Preserving by Protecting the Images in Social Media using...A Survey on Privacy Preserving by Protecting the Images in Social Media using...
A Survey on Privacy Preserving by Protecting the Images in Social Media using...BRNSSPublicationHubI
 
Understanding Emerging Technology and Its Impact on Online & Blended Learning
Understanding Emerging Technology and Its Impact on Online & Blended LearningUnderstanding Emerging Technology and Its Impact on Online & Blended Learning
Understanding Emerging Technology and Its Impact on Online & Blended LearningStephen Murgatroyd, PhD FBPsS FRSA
 
Survey on Graphical Password by Image Segmentation 2021 2022
Survey on Graphical Password by Image Segmentation 2021 2022Survey on Graphical Password by Image Segmentation 2021 2022
Survey on Graphical Password by Image Segmentation 2021 2022ijtsrd
 
Android Based Quiz Application
Android Based Quiz ApplicationAndroid Based Quiz Application
Android Based Quiz ApplicationIRJET Journal
 
The power of_deep_learning_models_applications
The power of_deep_learning_models_applicationsThe power of_deep_learning_models_applications
The power of_deep_learning_models_applicationsDrjabez
 
IRJET - A Review of Cyber Security using Biometric Devices
IRJET -  	  A Review of Cyber Security using Biometric DevicesIRJET -  	  A Review of Cyber Security using Biometric Devices
IRJET - A Review of Cyber Security using Biometric DevicesIRJET Journal
 
Unraveling Information about Deep Learning
Unraveling Information about Deep LearningUnraveling Information about Deep Learning
Unraveling Information about Deep LearningIRJET Journal
 
IRJET- Artificial Intelligence for Unearthing Yarn Breakage
IRJET- Artificial Intelligence for Unearthing Yarn BreakageIRJET- Artificial Intelligence for Unearthing Yarn Breakage
IRJET- Artificial Intelligence for Unearthing Yarn BreakageIRJET Journal
 
Proposing a new method of image classification based on the AdaBoost deep bel...
Proposing a new method of image classification based on the AdaBoost deep bel...Proposing a new method of image classification based on the AdaBoost deep bel...
Proposing a new method of image classification based on the AdaBoost deep bel...TELKOMNIKA JOURNAL
 
SocialCom 2009 - Social Synchrony
SocialCom 2009 - Social SynchronySocialCom 2009 - Social Synchrony
SocialCom 2009 - Social SynchronyMunmun De Choudhury
 
ChatGPT for State The Art- Prof. Wisnu Jatmiko (UIN Raden Fatah 2023).pdf
ChatGPT for State The Art- Prof. Wisnu Jatmiko (UIN Raden Fatah 2023).pdfChatGPT for State The Art- Prof. Wisnu Jatmiko (UIN Raden Fatah 2023).pdf
ChatGPT for State The Art- Prof. Wisnu Jatmiko (UIN Raden Fatah 2023).pdfAchmadNizarHidayanto
 

Similar to Modul Topik 8 - Kecerdasan Buatan (20)

Introduction to Artificial Intelligence - Pengenalan Kecerdasan Buatan
Introduction to Artificial Intelligence - Pengenalan Kecerdasan BuatanIntroduction to Artificial Intelligence - Pengenalan Kecerdasan Buatan
Introduction to Artificial Intelligence - Pengenalan Kecerdasan Buatan
 
IRJET- Image Privacy Protection as a Single Share
IRJET-  	  Image Privacy Protection as a Single ShareIRJET-  	  Image Privacy Protection as a Single Share
IRJET- Image Privacy Protection as a Single Share
 
The power of deep learning models applications
The power of deep learning models applicationsThe power of deep learning models applications
The power of deep learning models applications
 
lecture_1_2_ruohan.pdf
lecture_1_2_ruohan.pdflecture_1_2_ruohan.pdf
lecture_1_2_ruohan.pdf
 
A Survey on Privacy Preserving by Protecting the Images in Social Media using...
A Survey on Privacy Preserving by Protecting the Images in Social Media using...A Survey on Privacy Preserving by Protecting the Images in Social Media using...
A Survey on Privacy Preserving by Protecting the Images in Social Media using...
 
Understanding Emerging Technology and Its Impact on Online & Blended Learning
Understanding Emerging Technology and Its Impact on Online & Blended LearningUnderstanding Emerging Technology and Its Impact on Online & Blended Learning
Understanding Emerging Technology and Its Impact on Online & Blended Learning
 
Contents
ContentsContents
Contents
 
Survey on Graphical Password by Image Segmentation 2021 2022
Survey on Graphical Password by Image Segmentation 2021 2022Survey on Graphical Password by Image Segmentation 2021 2022
Survey on Graphical Password by Image Segmentation 2021 2022
 
Kaur2013
Kaur2013Kaur2013
Kaur2013
 
Android Based Quiz Application
Android Based Quiz ApplicationAndroid Based Quiz Application
Android Based Quiz Application
 
The power of_deep_learning_models_applications
The power of_deep_learning_models_applicationsThe power of_deep_learning_models_applications
The power of_deep_learning_models_applications
 
cybersec.pdf
cybersec.pdfcybersec.pdf
cybersec.pdf
 
IRJET - A Review of Cyber Security using Biometric Devices
IRJET -  	  A Review of Cyber Security using Biometric DevicesIRJET -  	  A Review of Cyber Security using Biometric Devices
IRJET - A Review of Cyber Security using Biometric Devices
 
Unraveling Information about Deep Learning
Unraveling Information about Deep LearningUnraveling Information about Deep Learning
Unraveling Information about Deep Learning
 
IRJET- Artificial Intelligence for Unearthing Yarn Breakage
IRJET- Artificial Intelligence for Unearthing Yarn BreakageIRJET- Artificial Intelligence for Unearthing Yarn Breakage
IRJET- Artificial Intelligence for Unearthing Yarn Breakage
 
SIRG-BSU_7_1.pptx
SIRG-BSU_7_1.pptxSIRG-BSU_7_1.pptx
SIRG-BSU_7_1.pptx
 
SIRG-BSU_7.pptx
SIRG-BSU_7.pptxSIRG-BSU_7.pptx
SIRG-BSU_7.pptx
 
Proposing a new method of image classification based on the AdaBoost deep bel...
Proposing a new method of image classification based on the AdaBoost deep bel...Proposing a new method of image classification based on the AdaBoost deep bel...
Proposing a new method of image classification based on the AdaBoost deep bel...
 
SocialCom 2009 - Social Synchrony
SocialCom 2009 - Social SynchronySocialCom 2009 - Social Synchrony
SocialCom 2009 - Social Synchrony
 
ChatGPT for State The Art- Prof. Wisnu Jatmiko (UIN Raden Fatah 2023).pdf
ChatGPT for State The Art- Prof. Wisnu Jatmiko (UIN Raden Fatah 2023).pdfChatGPT for State The Art- Prof. Wisnu Jatmiko (UIN Raden Fatah 2023).pdf
ChatGPT for State The Art- Prof. Wisnu Jatmiko (UIN Raden Fatah 2023).pdf
 

Recently uploaded

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

Modul Topik 8 - Kecerdasan Buatan

  • 1. Topik 8 Pengantar Deep Learning Dr. Sunu Wibirama Modul Kuliah Kecerdasan Buatan Kode mata kuliah: UGMx 001001132012 July 4, 2022
  • 2. July 4, 2022 1 Capaian Pembelajaran Mata Kuliah Topik ini akan memenuhi CPMK 5, yakni mampu mendefinisikan beberapa teknik ma- chine learning klasik (linear regression, rule-based machine learning, probabilistic machine learning, clustering) dan konsep dasar deep learning serta implementasinya dalam penge- nalan citra (convolutional neural network). Adapun indikator tercapainya CPMK tersebut adalah mengetahui sejarah singkat dan aplikasi deep learning, mengerti dan memahami konsep backpropagation, perceptron, mema- hami cara kerja convolutional neural network. 2 Cakupan Materi Cakupan materi dalam topik ini sebagai berikut: a) Artificial intelligence and deep learning: materi ini membahas sejarah dan perkem- bangan riset jaringan syaraf tiruan (neural network) sebagai salah satu cikal bakal dari teknologi kecerdasan buatan. Pada materi ini dibahas juga penemuan perceptron, kelemahan perceptron yang tidak bisa menyelesaikan persamaan non-linear sederhana, penemuan metode backpropagation, sampai dengan penggunaan deep learning hari ini. Pada materi ini juga dibahas hal-hal yang mendasari pesatnya perkembangan teknologi deep learning—perangkat keras, big data, dan perangkat lunak. b) Visualizing deep learning: materi membahas cara kerja deep learning secara visual, dengan ilustrasi yang mudah dipahami. Konsep-konsep dasar yang dijelaskan dalam materi ini adalah proses training dalam jaringan syaraf tiruan, bagaimana jaringan syaraf tiruan mengelola masukan, konsep bobot, konsep fungsi aktivasi, dan konsep dasar feed forward neural network. c) Deep learning essentials: materi ini membahas secara detail konsep dasar deep learn- ing, yakni perceptron, stacking perceptron to form neural networks, optimization through backpropagation, dan adaptive learning. Konsep loss function juga akan dibahas se- cara detail dalam materi ini, meliputi binary cross entropy, mean squared error, dan empirical loss. d) Convolutional neural network: materi ini akan membahas secara detail konsep feature engineering dengan konvolusi, konsep pooling, konsep normalization, dan konsep dense network dalam sebuah arsitektur deep learning—convolutional neural network. Selain itu, materi ini juga akan membahas kelebihan dan kekurangan convolutional neural network, serta berbagai macam implementasinya. 1
  • 3. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1 Sunu Wibirama sunu@ugm.ac.id Department of Electrical and Information Engineering Faculty of Engineering Universitas Gadjah Mada INDONESIA Introduction to Deep Learning (Part 01) Kecerdasan Buatan | Artificial Intelligence Version: January 2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2 Source: A. Amini (6.S191 Introduction to Deep Learning | MIT, 2019) The rise of deep learning
  • 4. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3 https://www.mygreatlearning.com/blog/deep-learning-applications/ Deep learning applications sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4 Source: A. Amini (6.S191 Introduction to Deep Learning | MIT, 2019) What is deep learning? Artificial intelligence and deep learning
  • 5. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5 Neural networks vs. deep neural networks Source: https://www.pnas.org/content/pnas/116/4/1074/F2.large.jpg sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6 http://beamandrew.github.io/deeplearning/2017/02/23/deep_learning_101_part1.html Milestones in the development of neural networks
  • 6. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7 7 End of File
  • 7. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1 Sunu Wibirama sunu@ugm.ac.id Department of Electrical and Information Engineering Faculty of Engineering Universitas Gadjah Mada INDONESIA Introduction to Deep Learning (Part 02) Kecerdasan Buatan | Artificial Intelligence Version: January 2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2 Early version of neural networks (Andrew Beam, 2017)
  • 8. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3 (Andrew Beam, 2017) The first AI Winter (1969) sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4 Early perceptron was not able to classify simple non linear function such as XOR function XOR problem in early perceptron
  • 9. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5 (Andrew Beam, 2017) The emergence of backpropagandists (1986) sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6 Neural networks was used to recognize hand writing in a bank check (LeCun,1999) (Andrew Beam, 2017)
  • 10. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7 The rise of deep learning in Silicon Valley (2012) • 2012 was the first year that neural nets grew to prominence • Alex Krizhevsky, Ilya Sutskever, and Geoffrey Hinton used them to win that year’s ImageNet competition (it is the annual olympics of computer vision) • They dropped the classification error record from 26.2% to 15.3%, a remarkable improvement at the time. • Ever since then, a host of companies have been using deep learning at the core of their services: • Facebook uses neural nets for their automatic tagging algorithms • Google for their photo search • Amazon for their product recommendations • Pinterest for their home feed personalization • Instagram for their search infrastructure. sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8 (Andrew Beam, 2017) Deep learning has mastered GO (2016)
  • 11. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9 Playing video game with deep learning (Andrew Beam, 2017) Playing game with deep learning sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10 https://towardsdatascience.com/machine-learning-methods-to-aid-in-coronavirus-response-70df8bfc7861 Using deep learning to investigate probability of Covid-19 infection through classification of CT scan images (2020)
  • 12. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11 Source: A. Amini (6.S191 Introduction to Deep Learning | MIT, 2019) What was behind the emergence of deep learning? sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12 12 End of File
  • 13. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1 Sunu Wibirama sunu@ugm.ac.id Department of Electrical and Information Engineering Faculty of Engineering Universitas Gadjah Mada INDONESIA Introduction to Deep Learning (Part 03) Kecerdasan Buatan | Artificial Intelligence Version: January 2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2 Workflow of Traditional Machine Learning Most machine learning research works try to develop novel features for more accurate performance Workflow of traditional machine learning
  • 14. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4
  • 15. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6 Deep learning
  • 16. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8
  • 17. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10 Pros and cons Source: Introducing Deep Learning with Matlab (Mathworks, 2018)
  • 18. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11 Where to start learning deep learning? John D. Kelleher, “Deep Learning”, MIT Press, 2019 Jon Krohn, Grant Beyleveld, Aglae Bassens “Deep Learning Illustrated”, Pearson, 2019 Ian Goodfellow, Yoshua Bengio, Aaron Courville “Deep Learning”, MIT Press, 2016 Easy Medium Hard sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12 MIT 6.S191 – Introduction to Deep Learning http://introtodeeplearning.com
  • 19. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13 Deep Learning Course @ NYU Center for Data Science https://cds.nyu.edu/deep-learning/ https://atcold.github.io/pytorch-Deep-Learning/ sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14
  • 20. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15 15 End of File
  • 21. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1 Sunu Wibirama sunu@ugm.ac.id Introduction to Deep Learning (Part 04) Department of Electrical and Information Engineering Faculty of Engineering Universitas Gadjah Mada Kecerdasan Buatan | Artificial Intelligence sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2 1986 2015 Read these papers for detailed explanation
  • 22. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3 Basic concept of deep learning sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4 The Perceptron: forward propagation Source: A. Amini (6.S191 Introduction to Deep Learning | MIT, 2019)
  • 23. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5 Source: A. Amini (6.S191 Introduction to Deep Learning | MIT, 2019) Common activation functions sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6 Source: A. Amini (6.S191 Introduction to Deep Learning | MIT, 2019) Importance of activation functions
  • 24. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7 Now, let’s go to the simplest one. We have a camera with 2 x 2 pixels of resolution. The following slides are based on Brandon Rohrer’s lecture (2017), crowned as the best Deep Learning lecture in KDDNuggets sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8 A four pixel camera
  • 25. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9 Categorize images solid vertical diagonal horizontal If we have a picture, can we ask our computer to decide: what type of image it is? sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10 Categorize images solid vertical diagonal horizontal
  • 26. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11 Categorize images solid vertical diagonal horizontal sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12 Categorize images solid vertical diagonal horizontal
  • 27. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13 solid vertical diagonal horizontal Categorize images sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14 However, if you have so many possible combination, simple rules can’t do it solid vertical diagonal horizontal
  • 28. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15 Instead of coding by yourself, we use neural networks sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 16 16 End of File
  • 29. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1 Sunu Wibirama sunu@ugm.ac.id Introduction to Deep Learning (Part 05) Department of Electrical and Information Engineering Faculty of Engineering Universitas Gadjah Mada Kecerdasan Buatan | Artificial Intelligence sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2 dendrites soma axon Drawing of Purkinje cells (A) and granule cells (B) from pigeon cerebellum by Santiago Ramón y Cajal, 1899; Instituto Cajal, Madrid, Spain B A Diagrams of neurons
  • 30. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3 Diagrams of neurons • Axons can connect to dendrites strongly, weakly, or somewhere in between. sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4 Diagrams of neurons • Medium connection (.6)
  • 31. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5 Diagrams of neurons • Strong connection (1.0) sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6 Diagrams of neurons • Weak connection (.2) • No connection is a 0.
  • 32. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7 Diagrams of neurons • Lots of axons connect with the dendrites of one neuron. • Each has its own connection strength. sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8 Redrawing and simplifying …
  • 33. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9 Adding quantitative weight .8 .9 .2 .3 .5 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10 Back to our 2 x 2 image…
  • 34. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11 Input neurons sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12 Pixel brightness -.75 -.50 -.25 0.0 +.25 +.50 +.75 +1.0 We quantify the brightness with a scaled range
  • 35. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13 .75 -.75 0.0 .50 Input vector sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14 Receptive fields Each input neuron will only consider pixel value at a particular position, regardless of pixel value at the other positions
  • 36. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15 A neuron + sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 16 Sum all the inputs + .75 -.75 0.0 .50 .50 .50 0.00 -.75 + .75 .50 +
  • 37. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 17 Weights + .75 -.75 0.0 .50 .50 1.0 1.0 1.0 1.0 .50 0.00 -.75 + .75 .50 x 1.0 x 1.0 x 1.0 x 1.0 The art of neural networks lay in the strength of each neuron. Hence, weight of neuron. + sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 18 Weights + .75 -.75 0.0 .50 -1.075 -.2 0.0 .8 -.5 .50 0.00 -.75 + .75 -1.075 -.2 0.0 .8 -.5 x x x x The art of neural networks lay in the strength of each neuron. Hence, weight of neuron +
  • 38. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 19 Weights + .75 -.75 0.0 .50 -1.075 -.2 0.0 .8 -.5 .50 0.00 -.75 + .75 -1.075 -.2 0.0 .8 -.5 x x x x Now, we represent the weight as: Black : negative Missing: zero Orange: positive + sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 20 Squash the result + .75 -.75 0.0 .50 -1.075 -0.746
  • 39. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 21 Sigmoid squashing function 1.0 .5 -1.0 -.5 1.0 .5 1.5 2.0 -1.0 -.5 -1.5 -2.0 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 22 Sigmoid squashing function 1.0 .5 -1.0 -.5 1.0 .5 1.5 2.0 -1.0 -.5 -1.5 -2.0 Your number goes in here
  • 40. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 23 Sigmoid squashing function 1.0 .5 -1.0 -.5 1.0 .5 1.5 2.0 -1.0 -.5 -1.5 -2.0 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 24 Sigmoid squashing function 1.0 .5 -1.0 -.5 1.0 .5 1.5 2.0 -1.0 -.5 -1.5 -2.0 The squashed version comes out here
  • 41. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 25 Sigmoid squashing function 1.0 .5 -1.0 -.5 1.0 .5 1.5 2.0 -1.0 -.5 -1.5 -2.0 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 26 Sigmoid squashing function 1.0 .5 -1.0 -.5 1.0 .5 1.5 2.0 -1.0 -.5 -1.5 -2.0
  • 42. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 27 No matter what you start with, the answer stays between -1 and 1. 1.0 .5 -1.0 -.5 1.0 .5 1.5 2.0 -1.0 -.5 -1.5 -2.0 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 28 28 End of File
  • 43. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1 Sunu Wibirama sunu@ugm.ac.id Introduction to Deep Learning (Part 06) Department of Electrical and Information Engineering Faculty of Engineering Universitas Gadjah Mada Kecerdasan Buatan | Artificial Intelligence sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2 Squash the result + .75 -.75 0.0 .50 -1.075 -0.746
  • 44. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3 Weighted sum-and-squash neuron .75 -.75 0.0 .50 -0.746 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4 Make lots of neurons, identical except for weights To keep our picture clear, weights will either be 1.0 (orange) -1.0 (black) or 0.0 (missing)
  • 45. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5 Receptive fields get more complex sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6 Repeat for additional layers
  • 46. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7 Receptive fields get still more complex sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8 Repeat with a variation
  • 47. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9 Rectified linear units (ReLUs) 1.0 .5 -1.0 -.5 1.0 .5 1.5 2.0 -1.0 -.5 -1.5 -2.0 If your number is positive, keep it. Otherwise you get a zero. sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10 Positive: solid white Negative: solid black Positive: left vertical Negative: right vertical Positive: right diagonal Negative: left diagonal Positive: bottom horizontal Negative: top horizontal
  • 48. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11 Add an output layer solid vertical diagonal horizontal sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12 solid vertical diagonal horizontal
  • 49. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13 Remember the big picture? If we have more pixels, we can represent more complex receptive fields sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14 solid vertical diagonal horizontal Now, let’s set the receptive fields according to the input
  • 50. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15 solid vertical diagonal horizontal Now, let’s set the receptive fields according to the input sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 16 solid vertical diagonal horizontal Now, let’s set the receptive fields according to the input
  • 51. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 17 solid vertical diagonal horizontal Now, let’s set the receptive fields according to the input sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 18 solid vertical diagonal horizontal Now, let’s set the receptive fields according to the input
  • 52. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 19 solid vertical diagonal Now, let’s set the receptive fields according to the input horizontal sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 20 Summary? • Traditional machine learning research focuses on finding a novel features. Good for small training datasets, but requires domain knowledge. • Deep learning is a type of neural networks with enormous hidden layers and new type of training method. • So far, we have learned basic concepts of: – Perceptron – Activation function in neural networks – Feed forward architecture
  • 53. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 21 21 End of File
  • 54. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1 Sunu Wibirama sunu@ugm.ac.id Deep Learning Essentials (Part 01) Department of Electrical and Information Engineering Faculty of Engineering Universitas Gadjah Mada Kecerdasan Buatan | Artificial Intelligence sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2 Core components of deep learning (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
  • 55. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3 Core components of deep learning (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) The Perceptron: forward propagation
  • 56. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) The Perceptron: forward propagation sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6 The Perceptron: forward propagation (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
  • 57. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7 e = 2.718.. (Euler number) (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) The Perceptron: forward propagation z sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8 Common activation functions (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
  • 58. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Importance of activation functions sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10 Importance of activation functions (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
  • 59. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Importance of activation functions sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) The Perceptron: example z
  • 60. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) The Perceptron: example z sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) The Perceptron: example z
  • 61. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) The Perceptron: example z sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 16 16 End of File
  • 62. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1 Sunu Wibirama sunu@ugm.ac.id Deep Learning Essentials (Part 02) Department of Electrical and Information Engineering Faculty of Engineering Universitas Gadjah Mada Kecerdasan Buatan | Artificial Intelligence sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2 Core components of deep learning (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
  • 63. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3 Core components of deep learning (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) From perceptron to feed forward networks Perceptron: simplified Note: for simplicity, we remove the drawing of bias
  • 64. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5 From perceptron to feed forward networks (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Multi outputs Perceptron sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6 From perceptron to feed forward networks (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Single layer neural networks
  • 65. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7 w w w From perceptron to feed forward networks (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Single layer neural networks sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8 From perceptron to feed forward networks (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Multi output perceptron
  • 66. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9 From perceptron to feed forward networks Deep feed forward networks (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Example problem
  • 67. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Example problem: Will I pass this class? sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Example problem: Will I pass this class?
  • 68. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Example problem: Will I pass this class? sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Example problem: Will I pass this class?
  • 69. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Quantifying loss sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 16 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Empirical loss
  • 70. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 17 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Binary cross entropy loss sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 18 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Mean squared error loss
  • 71. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 19 19 End of File
  • 72. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1 Sunu Wibirama sunu@ugm.ac.id Deep Learning Essentials (Part 03) Department of Electrical and Information Engineering Faculty of Engineering Universitas Gadjah Mada Kecerdasan Buatan | Artificial Intelligence sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2 Core components of deep learning (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
  • 73. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3 Core components of deep learning (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4 Core maths in deep learning
  • 74. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5 Core maths in deep learning sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6 Chain rules Composite function refers to the composition of two functions: one function takes the output of the other as input. Consider = and = 2 . You can compose these functions as = 2 = 2 To calculate derivatives of composite functions, you need to use the chain rule: Note: The chain rule is important to understand concept of deep neural networks: to update the network parameters, the chain rule is used to calculate the derivative of the cost function and update the parameters accordingly (backpropagation).
  • 75. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7 Chain rules Again, consider = and = 2 . Based on basic functions of derivatives, we have: ( ) ( ) = 2 and ( ) ( ) = 2 . Using chain rules, let’s calculate the derivative of ℎ( ): (ℎ ) ( ) = ( ) ( ) ( ) ( ) Because = ( ) , we have ′ = 2 ( ). In addition, we also have = 2. Thus: ℎ = ′ = 2 ( ) 2 = 2 2x 2 = 8x sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8 Partial derivatives and gradient • You can use the stylized cursive letter d, ∂, that can be called “curly d”, to refer to partial derivatives. • Let’s take the following function as a first example: The function takes the two variables and as input. • Partial derivatives of , = + are derivatives with respect to each independent variable ( and ).
  • 76. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9 Partial derivatives and gradient The partial derivative of , with respect to (considering as a constant) Likewise, the partial derivative of , with respect to (considering as a constant) sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10 Partial derivatives and gradient • Suppose you calculate the derivative with respect to each variable of a function ( , , , … , ) and store all these partial derivatives in a vector named with the symbol ∇ (“nabla”). • It is the gradient of f: ∇f is pronounced here gradient of f, grad f or del f, and contains the partial derivatives of the function with respect to each variable: http://www.claudiobellei.com/2018/01/06/backprop-word2vec/
  • 77. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Learning: loss optimization In deep learning, the way to adjust weights is to optimize to loss function Thus, learning means automatically finding appropriate weights that optimize loss function sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12 Find elements of vector (consists of several weights) that minimizes ( ) (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Loss optimization
  • 78. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13 for all layers (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Loss optimization sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Loss optimization
  • 79. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Loss optimization sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 16 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Loss optimization
  • 80. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 17 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Loss optimization sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 18 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Gradient descent
  • 81. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 19 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Gradient descent sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 20 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Gradient descent
  • 82. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 21 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Computing gradient: backpropagation sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 22 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Computing gradient: backpropagation
  • 83. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 23 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Computing gradient: backpropagation sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 24 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Computing gradient: backpropagation
  • 84. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 25 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Computing gradient: backpropagation sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 26 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Computing gradient: backpropagation
  • 85. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 27 (Alexander Amini, 2019) Training deep neural networks is difficult sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 28 Lost functions can be difficult to optimize (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019)
  • 86. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 29 Lost functions can be difficult to optimize (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 30 Source: https://www.jeremyjordan.me/nn-learning-rate/ Setting the learning rate ( ) ( ) ( )
  • 87. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 31 Adaptive learning rates (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 32 Adaptive learning rates
  • 88. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 33 Review: core components of deep learning (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 34 34 End of File
  • 89. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1 Sunu Wibirama sunu@ugm.ac.id Convolutional Neural Network (Part 01) Department of Electrical and Information Engineering Faculty of Engineering Universitas Gadjah Mada Kecerdasan Buatan | Artificial Intelligence sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2 What is Convolutional Neural Network? • Directly using the original image for recognition (as in the previous lecture) leads to poor accuracy. Hence, CNN is developed. • CNN is one of the most popular deep learning architectures • Very good deep learning architecture for computer vision task: object recognition / object classification • It implements “convolution” to extract features inside the training set before sending features value to neural network layers • Used by Alex Krizhevsky, Ilya Sutskever, and Geoffrey Hinton to win ImageNet Competition (dropping classification error from 26.2% to 15.3%). • Used in autonomous car of Nvidia. How can you differentiate cat vs. dog?
  • 90. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3 Proposed method Top-5 error rate: 15.3% What is Convolutional Neural Network? sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4 How self-driving car works? https://devblogs.nvidia.com/deep-learning-self-driving-cars/ Training the neural network. The trained network is used to generate steering commands from a single front-facing center camera. High-level view of the data collection system. Input Input Actual output by human driver Actual output by human driver Computed output Computed output Input Input Computed output Computed output
  • 91. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5 CNN architecture Feature extraction network Classifier network Source: https://adeshpande3.github.io/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks/ sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6 CNN architecture Feature extraction network Classifier network Source: https://adeshpande3.github.io/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks/
  • 92. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7 Feature extraction network: convolution Convolution ReLU Pooling Convolution ReLU Convolution ReLU Pooling sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8 How can you differentiate a Samoyed dog and a Wolf? The computer should be robust from small variations of similar object (e.g.: images of Samoyed dog taken from different point of views)but sensitive enough to recognize different objects with almost similar appearance (Samoyed dog vs. Wolf)
  • 93. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9 A toy CNN: X’s (SamoyedDog) and O’s (Wolf) Says whether a picture is of an X or an O X or O CNN A two-dimensional array of pixels sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10 For example CNN X CNN O
  • 94. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11 Trickier cases: variations of similar object CNN X CNN O translation scaling weight rotation sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12 Deciding is hard = ? What do you think? Is it the same “X” ?
  • 95. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13 What computers see = ? sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14 What computers see Some parts match with original image, some parts don’t Original image Rotated image
  • 96. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15 Computers are literal = x Computers will say, “Uncertain, I don’t know whether this image matches with another” sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 16 CNN match pieces of the image = = = Rather than matching the whole thing, we match parts of image
  • 97. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 17 Features match pieces of the image • Rather than matching the whole thing, we match parts of image • We provide convolutional filters for this. Note that the values of the filter are trained using backpropagation algorithm. • Therefore, these values are continuously trained throughout the training process. This aspect is similar to the updating process of the connection weights of the ordinary neural network. sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 18 Features match pieces of the image Diagonal line (downward left to right) Diagonal line (Downward right to left) Little “X” Three different convolutional filters (kernels)
  • 98. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 19 Notes about convolutional kernel In this example, the pixel values of the kernel are fixed, for the sake of simplicity. However in real world CNN, the kernel’s values are initialized with random values, and then learned and optimized through backpropagation (just like weights in deep neural network) sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 20
  • 99. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 21 21 End of File
  • 100. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1 Sunu Wibirama sunu@ugm.ac.id Convolutional Neural Network (Part 02) Department of Electrical and Information Engineering Faculty of Engineering Universitas Gadjah Mada Kecerdasan Buatan | Artificial Intelligence sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2 CNN architecture Feature extraction network Classifier network Source: https://adeshpande3.github.io/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks/
  • 101. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3 Features match pieces of the image Diagonal line (downward left to right) Diagonal line (Downward right to left) Little “X” Three different convolutional filters (kernels) sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4 Those features match the image exactly
  • 102. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5 Those features match the image exactly sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6 Those features match the image exactly
  • 103. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7 Those features match the image exactly sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8 Those features match the image exactly
  • 104. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9 Filtering: the math behind the match sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10 Filtering: the math behind the match 1. Line up the feature and the image patch. 2. Multiply each image pixel by the corresponding feature pixel. 3. Stride / slide the filter (usually one or two pixels) 4. Add them up. 5. Divide by the total number of pixels in the feature. Note: stride is the number of pixels with which we slide our filter
  • 105. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11 1 x 1 = 1 Filtering: the math behind the match sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12 1 x 1 = 1 Filtering: the math behind the match
  • 106. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13 Filtering: the math behind the match -1 x -1 = 1 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14 Filtering: the math behind the match -1 x -1 = 1
  • 107. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15 Filtering: the math behind the match -1 x -1 = 1 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 16 Filtering: the math behind the match 1 x 1 = 1
  • 108. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 17 Filtering: the math behind the match -1 x -1 = 1 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 18 Filtering: the math behind the match -1 x -1 = 1
  • 109. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 19 Filtering: the math behind the match -1 x -1 = 1 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 20 Filtering: the math behind the match 1 x 1 = 1
  • 110. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 21 Filtering: the math behind the match sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 22 Filtering: the math behind the match 1 x 1 = 1
  • 111. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 23 Filtering: the math behind the match -1 x 1 = -1 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 24 Filtering: the math behind the match
  • 112. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 25 Filtering: the math behind the match .55 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 26 Convolution: trying every possible match Move the filter on the whole pixels, we get the following map 9 X 9 (n x n) 9 - (m-1) x 9 - (m-1) = 7 X 7 3 X 3 (m x m)
  • 113. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 27 Convolution: trying every possible match = sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 28 = = =
  • 114. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 29 Convolution layer One image becomes a stack of filtered images sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 30 Convolution layer One image becomes a stack of filtered images
  • 115. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 31 Feature extraction network: ReLU Convolution ReLU Pooling Convolution ReLU Convolution ReLU Pooling sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 32 Normalization • Keep the math from breaking by tweaking each of the values just a bit. • Change everything negative to zero.
  • 116. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 33 Rectified Linear Units (ReLUs) sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 34 Rectified Linear Units (ReLUs)
  • 117. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 35 Rectified Linear Units (ReLUs) sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 36 Rectified Linear Units (ReLUs)
  • 118. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 37 ReLU layer A stack of images becomes a stack of images with no negative values. sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 38 Feature extraction network: Pooling Convolution ReLU Pooling Convolution ReLU Convolution ReLU Pooling
  • 119. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 39 Pooling: Shrinking the image stack 1. Pick a window size (usually 2 or 3). 2. Decide a stride (moving step, usually 2) 3. Walk your window across your filtered images. 4. From each window, take the maximum value. Note: stride is the number of pixels with which we slide our filter sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 40 Pooling maximum
  • 120. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 41 Pooling maximum sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 42 Pooling maximum
  • 121. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 43 Pooling maximum sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 44 Pooling maximum
  • 122. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 45 Pooling max pooling We get similar patter with the original map, but smaller sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 46
  • 123. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 47 Pooling layer A stack of images becomes a stack of smaller images. sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 48 Layers get stacked The output of one becomes the input of the next Convolution ReLU Pooling
  • 124. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 49 Deep stacking Layers can be repeated several (or many) times Convolution ReLU Pooling Convolution ReLU Convolution ReLU Pooling sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 50 50 End of File
  • 125. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 1 Sunu Wibirama sunu@ugm.ac.id Convolutional Neural Network (Part 03) Department of Electrical and Information Engineering Faculty of Engineering Universitas Gadjah Mada Kecerdasan Buatan | Artificial Intelligence sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 2 CNN architecture Feature extraction network Classifier network Source: https://adeshpande3.github.io/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks/
  • 126. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 3 CNN architecture Feature extraction network Classifier network Source: https://adeshpande3.github.io/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks/ sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 4 Fully connected layer The outputs are stacked into one layer
  • 127. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 5 Fully connected layer Vote depends on how strongly a value predicts X or O X O Some pixels of this stacked layer (we call it extracted feature) will have large values for a certain input (whether it is X or O) sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 6 Fully connected layer Vote depends on how strongly a value predicts X or O X O Some pixels of this stacked layer (we call it extracted feature) will have large values for a certain input (whether it is X or O)
  • 128. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 7 Fully connected layer Future values vote on X or O X O These pixels decide the label of an unseen new input. Pixel #1, 4, 5, 10, 11 are used for voting class X Pixel #2, 3, 9, 12 are used for voting class O 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 8 Fully connected layer Future values vote on X or O X O Suppose we have a new unseen input. We want to decide whether this is a Samoyed dog or Wolf
  • 129. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 9 Fully connected layer Future values vote on X or O X O .92 Suppose we have a new unseen input. We want to decide whether this is a Samoyed dog or Wolf sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 10 Fully connected layer X O .92 Suppose we have a new unseen input. We want to decide whether this is a Samoyed dog or Wolf Future values vote on X or O
  • 130. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 11 Fully connected layer X O .92 .51 Suppose we have a new unseen input. We want to decide whether this is a Samoyed dog or Wolf Future values vote on X or O sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 12 Fully connected layer X O .92 .51 Suppose we have a new unseen input. We want to decide whether this is a Samoyed dog or Wolf OK, so this is a dog, according to your AI system Future values vote on X or O
  • 131. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 13 Fully connected layer A list of feature values becomes a list of votes X O These features become input for a deep neural network sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 14 Fully connected layer These can also be stacked X O
  • 132. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 15 Putting it all together A set of pixels becomes a set of votes. Convolution ReLU Pooling Convolution ReLU Convolution ReLU Pooling Fully connected Fully connected X O .92 .51 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 16 Backpropagation Error = right answer – actual answer Convolution ReLU Pooling Convolution ReLU Convolution ReLU Pooling Fully connected Fully connected X O .92 .51
  • 133. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 17 Convolution ReLU Pooling Convolution ReLU Convolution ReLU Pooling Fully connected Fully connected X O .92 .51 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 18 .92 Convolution ReLU Pooling Convolution ReLU Convolution ReLU Pooling Fully connected Fully connected X O .51 .92
  • 134. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 19 .92 Convolution ReLU Pooling Convolution ReLU Convolution ReLU Pooling Fully connected Fully connected X O .51 .92 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 20 .92 Convolution ReLU Pooling Convolution ReLU Convolution ReLU Pooling Fully connected Fully connected X O .51
  • 135. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 21 Convolution ReLU Pooling Convolution ReLU Convolution ReLU Pooling Fully connected Fully connected X O .51 .92 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 22 (Source: Alexander Amini, “Introduction to Deep Learning”, MIT, 2019) Use backpropagation to minimize loss function Backpropagation can be used in CNN to automatically find appropriate weights that minimize loss function Convolution ReLU Pooling Convolution ReLU Convolution ReLU Pooling Fully connected Fully connected X O .51 .92
  • 136. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 23 CNN can be used to other data • Any 2D (or 3D) data. • Things closer together are more closely related than things far away. Columns of pixels Rows of pixels sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 24 Time steps Intensity in each frequency band CNN can be used to other data SOUND Position in sentence Words in dictionary TEXT
  • 137. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 25 Limitations • CNN only captures local “spatial” patterns in data. • If the data can’t be made to look like an image, CNN is less useful. • If your data is just as useful after swapping any of your columns with each other, then you can’t use Convolutional Neural Networks. • Example: customer data Name, age,address, email,purchases,browsing activity,… Customers sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 26 Take home messages • In this lecture, we learn about a well-known variant of deep learning, Convolutional Neural Networks (CNN). • CNN consists of two parts: feature extraction networks and classifiers networks. • Convolution layers are useful to extract features from input images. • Pooling layers are used to squeeze the data • ReLU layers are used for normalization, converting data to a range of 0 to 1. • There are so many variants of CNN, each of them has been developed to solve specific problem. Source: https://towardsdatascience.com/top-10-cnn-architectures-every-machine-learning-engineer-should-know-68e2b0e07201
  • 138. 01/07/2022 sunu@ugm.ac.id Copyright © 2022 Sunu Wibirama | Do not distribute without permission @sunu_wibirama 27 27 End of File