0% found this document useful (0 votes)
5 views

Computer Vision Masterclass

The document outlines a comprehensive plan for a computer vision masterclass, covering various topics such as face detection, recognition, object tracking, and neural network applications. It includes detailed sections on algorithms, biological fundamentals, and practical implementations using libraries like OpenCV, TensorFlow, and PyTorch. The structure is divided into parts, each focusing on specific techniques and methodologies in computer vision.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Computer Vision Masterclass

The document outlines a comprehensive plan for a computer vision masterclass, covering various topics such as face detection, recognition, object tracking, and neural network applications. It includes detailed sections on algorithms, biological fundamentals, and practical implementations using libraries like OpenCV, TensorFlow, and PyTorch. The structure is divided into parts, each focusing on specific techniques and methodologies in computer vision.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 154

COMPUTER

VISION
PLAN
LOREM OF ATTACK
Part 1 IPSUM
– FACE DETECTION
Part 2 Part 3 Part 4 Part 5
Neural networks for Convolutional neural
Face detection Face recognition Object tracking networks for
image classification
image classification

Part 6 Part 7 Part 8 Part 9 Part 10


Neural networks for
Transfer learning Autoencoders Object detection Recognition of
classification of
and fine tuning emotions with YOLO gestures
and actions

Part 11 Part 12 Part 13 Part 14

Deep dream Style transfer GANs (Generative Image segmentation


Adversarial
Networks)
COMPUTER
LOREM IPSUM VISION MASTERCLASS

• Basic
1. Part 1python programming
• Only thefundamentals
Biological basic intuition (except for neural networks)
Single layer perceptron
• Libraries
2. Part 2
• OpenCV
Multi-layer perceptron
• Dlib
3. Part 3
• TensorFlow
Pybrain
• Darknet
Sklearn
• Caffe framework
TensorFlow
• Homeworks
PyTorch
PLAN OF
LOREM ATTACK – FACE DETECTION
IPSUM

1. Part
1. Face1detection with Haarcascade and
OpenCV
Biological fundamentals
2. Single
Facelayer
detection with HOG and Dlib
perceptron
2.
3. Part
Face2detection with CNN and Dlib
Multi-layer perceptron
4. Face detection using webcam
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
PIXELSIPSUM
LOREM

RGB
1. Part 1 32 pixels

Biological fundamentals
Single layer perceptron 32 pixels

2. Part 2
Multi-layer perceptron
32 x 32 = 1024 pixels
3. Part 3 32 x 32 x 3 = 3072
Pybrain
Sklearn
TensorFlow
PyTorch
CASCADE
LOREM CLASSIFIER
IPSUM

AdaBoost
1. Part 1 Training
Biological fundamentals
Single layer perceptron
2. Part 2
Not faces Feature
Multi-layer perceptron
selection
3. Part 3
Pybrain
Sklearn
Faces
TensorFlow
PyTorch
Apply to each “sub-window”
CASCADE
LOREM CLASSIFIER
IPSUM

Sum of white pixels – sum


of black pixels

More than 160.000


2356
combinations in a 24x24 8921
image!
CASCADE
LOREM CLASSIFIER
IPSUM
CASCADE
LOREM CLASSIFIER
IPSUM
HOG –IPSUM
LOREM HISTOGRAMS OF ORIENTED GRADIENTS

Derivative allows to measure the rate of change


(zero derivative, small derivative and high derivative)

Gradient vector (direction that the values increase)

Source of images: https://www.learnopencv.com/histogram-of-oriented-gradients/


HOG –IPSUM
LOREM HISTOGRAMS OF ORIENTED GRADIENTS
HOG –IPSUM
LOREM HISTOGRAMS OF ORIENTED GRADIENTS
PLAN OF
LOREM ATTACK – FACE RECOGNITION
IPSUM

1. Part
1. Face1recognition with LBPH and OpenCV
2. Biological
Face recognition
fundamentalswith Dlib, CNN and distance
calculation
Single layer perceptron
2.
3. Part
Face2recognition using the webcam
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
LBPH (LOCAL
LOREM IPSUM BINARY PATTERNS HISTOGRAMS)

42 55 48
1. Part 1
Biological fundamentals 35 38 33
Single layer perceptron 38 30 32
2.
12 Part
15 218
Binary = 11100010
5
Multi-layer
8 3
perceptron
3.
8
Part
1
32 If >= 8: 1 1 1 1
If < 8: 0
Pybrain 0 8 0
Sklearn
TensorFlow 1 0 0

PyTorch
Binary = 11100010
Decimal = 226
LBPH (LOCAL
LOREM IPSUM BINARY PATTERNS HISTOGRAMS)

Edge Corner

110 201
240

Source: https://bytefish.de/blog/local_binary_patterns/
LBPH (LOCAL
LOREM IPSUM BINARY PATTERNS HISTOGRAMS)

1. Radius 12 15 18
2. Neighbors 5 8 3
3. grid_x and grid_y 8 1 2
4. Threshold

Source: https://en.wikipedia.org/wiki/Local_binary_patterns
PLAN OF
LOREM ATTACK – OBJECT TRACKING
IPSUM

1. Part
1. Object1 tracking vs. Object detection
2. Biological
KCF (Kernel Correlation Filters) algorithm
fundamentals
Single layer perceptron
3. CSRT (Discriminative Correlation Filter with Channel and
2. Part 2 Reliability) algorithm
Spatial
Multi-layer perceptron
4. KCF and CSRT implementation
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
OBJECT
LOREM TRACKING vs. OBJECT DETECTION
IPSUM

• Object
1. Part 1tracking vs. Object detection
Biological fundamentals
Single layer perceptron
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
KCF (KERNAL
LOREM IPSUM CORRELATION FILTERS)

1. Part 1
Biological fundamentals
Single layer perceptron
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch Source: https://www.groundai.com/project/enkcf-ensemble-of-kernelized-correlation-filters-for-high-speed-object-tracking/1
CSRT (DISCRIMINATIVE CORRELATION FILTER WITH
LOREM IPSUM
CHANNEL AND SPATIAL RELIABILITY)

1. Part 1
Biological fundamentals
Single layer perceptron
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
1. From left to right: training patch with the bounding box of the object
Sklearn
2. HOG to extract useful information of the image
3. TensorFlow
Application of Random Markov Test to generate probabilities
4. PyTorch
Training patch masked using the confidence map

Source: https://www.arxiv-vanity.com/papers/1611.08461/
PLAN OF
LOREM ATTACK
IPSUM

1. Part
1. Part 11
Biological fundamentals
Biological fundamentals
Single layer
Single layerperceptron
perceptron
2. Part 2
2. Multi-layer
Part 2 perceptron
Multi-layer perceptron
3. Part 3
3. Pybrain
Part 3
Pybrain
Sklearn
Sklearn
TensorFlow
PyTorch
TensorFlow
PyTorch
BIOLOGICAL FUNDAMENTALS
BIOLOGICAL FUNDAMENTALS

Axon terminals

Dendrites
Cell body

Axon
BIOLOGICAL FUNDAMENTALS

Axon terminals
Dendrites Cell body

Axon
Synapse
ARTIFICIAL NEURON

Input Output
ARTIFICIAL NEURON

Inputs

X1 Weights
w1

X2 w2
$

w3 ∑ f 𝑠𝑢𝑚 = % 𝑥𝑖 ∗ 𝑤𝑖
X3
Sum Activation !"#
wn function function
.
. X1 * w1+ X2 * w2 + X3 * w3
.

Xn
PERCEPTRON

𝑠𝑢𝑚 = % 𝑥𝑖 ∗ 𝑤𝑖
Inputs !"#

35
Weights sum = (35 * 0.8) + (25 * 0.1)
Age
0.8
sum = 28 + 2.5
∑ f =1 sum = 30.5
0.1
Educational Sum Step
25
function
background function Greater or equal to 1 = 1
Otherwise = 0

“All or nothing” representation


PERCEPTRON

𝑠𝑢𝑚 = % 𝑥𝑖 ∗ 𝑤𝑖
Inputs !"#

35
Weights sum = (35 * -0.8) + (25 * 0.1)
Age
-0.8
sum = -28 + 2.5
∑ f =0 sum = -25.5
0.1
Educational Sum Step
25
function
background function Greater or equal to 1 = 1
Otherwise = 0
STEP FUNCTION
PERCEPTRON

• Positive weight – exciting synapse


• Negative weight – inhibitory synapse
• Weights are the synapses
• Weights amplify or reduce the input signal
• The knowledge of a neural network is the weights
“AND” OPERATOR

X1 X2 Class
0 0 0
0 1 0
1 0 0
1 1 1
“AND” OPERATOR

X1 1
X1 X2 Class
X1 0
0 0 0 0 0
0 1 0
∑ f =0 ∑ f =0
1 0 0
0
0
0
0*0+0*0 X2 0
1*0+0*0 1 1 1
X2
0+0=0 0+0=0
error = correct - prediction
Class Prediction Error
0 0 0
X1 0 X1 1
0 0 0 0 0
0 0 0
∑ f =0 ∑ f =0 1 0 1

X2 1
0
0*0+1*0 X2 1
0
1*0+1*0 75%
0+0=0 0+0=0
weight (n + 1) = weight(n) + (learning_rate * input * error)
“AND” OPERATOR

weight (n + 1) = weight(n) + (learning_rate * input * error)


weight (n + 1) = 0 + (0.1 * 1 * 1)
weight (n + 1) = 0.1
error = correct - prediction
Class Prediction Error x1 1 x1 1

0 0.1
0 0 0
0 0 0
∑ f ∑ f
0 0 0
0 0.1
1 0 1 x2 1 x2 1

weight (n + 1) = weight(n) + (learning_rate * input * error)


weight (n + 1) = 0 + (0.1 * 1 * 1)
weight (n + 1) = 0.1
“AND” OPERATOR

X1 1
X1 X2 Class
X1 0
0.1 0.1 0 0 0
0 1 0
∑ f =0 ∑ f =0
1 0 0
0.1
0
0.1
0 * 0.1 + 0 * 0.1 X2 0
1 * 0.1 + 0 * 0.1 1 1 1
X2
0+0=0 0.1 + 0 = 0
error = correct - prediction
Class Prediction Error
0 0 0
X1 0 X1 1
0.1 0.1 0 0 0
0 0 0
∑ f =0 ∑ f =0 1 0 1

X2 1
0.1
0 * 0.1 + 1 * 0.1 X2 1
0.1
1 * 0.1 + 1 * 0.1 75%
0 + 0.1 = 0.1 0.1 + 0.1 = 0.2
“AND” OPERATOR

weight (n + 1) = weight(n) + (learning_rate * input * error)


weight (n + 1) = 0.1 + (0.1 * 1 * 1)
weight (n + 1) = 0.2
error = correct - prediction
Class Prediction Error x1 1 x1 1

0.1 0.2
0 0 0
0 0 0
∑ f ∑ f
0 0 0
0.1 0.2
1 0 1 x2 1 x2 1

weight (n + 1) = weight(n) + (learning_rate * input * error)


weight (n + 1) = 0.1 + (0.1 * 1 * 1)
weight (n + 1) = 0.2
“AND” OPERATOR

X1 1
X1 X2 Class
X1 0
0.5 0.5 0 0 0
0 1 0
∑ f =0 ∑ f =0
1 0 0
0.5
0
0.5
0 * 0.5 + 0 * 0.5 X2 0
1 * 0.5 + 0 * 0.5 1 1 1
X2
0+0=0 0.5 + 0 = 0.5
error = correct - prediction
Class Prediction Error
0 0 0
X1 0 X1 1
0.5 0.5 0 0 0
0 0 0
∑ f =0 ∑ f =1 1 1 0

X2 1
0.5
0 * 0.5 + 1 * 0.5 X2 1
0.5
1 * 0.5 + 1 * 0.5 100%
0 + 0.5 = 0.5 0.5 + 0.5 = 1.0
BASIC ALGORITHM

While error <> 0


For each row
Calculate output
Calculate error (correct - prediction)
If error > 0
For each weight
Update the weights
“OR” OPERATOR

X1 1
X1 X2 Class
X1 0
1.1 1.1 0 0 0
0 1 1
∑ f =0 ∑ f =1
1 0 1
1.1
0
1.1
0 * 1.1 + 0 * 1.1 X2 0
1 * 1.1 + 0 * 1.1 1 1 1
X2
0+0=0 1.1 + 0 = 1.1
error = correct - prediction
Class Prediction Error
0 0 0
X1 0 X1 1
1.1 1.1 1 1 0
1 1 0
∑ f =1 ∑ f =1 1 1 0

X2 1
1.1
0 * 1.1 + 1 * 1.1 X2 1
1.1
1.1 * 1.1 + 1 * 1.1 100%
0 + 1.1 = 1.1 1.1 + 1.1 = 2.2
“XOR” OPERATOR

y y
AND XOR

0 1 1 1 0
1

0 0 0 y 0 1
OR 0
x x
0 1 0 1
1 1 1

Non-linearly separable
Linearly separable
0 0 1
x
0 1
MULTI-LAYER PERCEPTRON

Hidden layer

Inputs Weights
∑ f Weights
X1

∑ f

∑ f Sum Activation
function function
X2

∑ f
STEP FUNCTION
SIGMOID FUNCTION

1
𝑦=
1 + 𝑒 *+

If X is high, the value is approximately 1


If X is small, the value is approximately 0
HYPERBOLIC TANGENT FUNCTION

, ! * , "!
Y= , ! - , "!
STEP FUNCTION

Inputs Inputs

Weights Weights
35 35
0.8 -0.8

∑ f =1 0.1
∑ f =0
0.1
Sum Step Sum Step
25 25
function function function function
$ $

𝑠𝑢𝑚 = % 𝑥𝑖 ∗ 𝑤𝑖 𝑠𝑢𝑚 = % 𝑥𝑖 ∗ 𝑤𝑖
!"# !"#

sum = (35 * 0.8) + (25 * 0.1) sum = (35 * -0.8) + (25 * 0.1)
sum = 28 + 2.5 sum = -28 + 2.5
sum = 30.5 sum = -25.5
“XOR” OPERATOR

X1 X2 Class
0 0 0
0 1 1
1 0 1
1 1 0
INPUT LAYER TO HIDDEN LAYER
$ 1 X1 X2 Class
𝑠𝑢𝑚 = ' 𝑥𝑖 ∗ 𝑤𝑖 Sum = 0 𝑦= 0 0 0
1 + 𝑒 %&
!"# Activation = 0.5
0 1 1

0.5 1 0 1
-0.424
1 1 0
0.358

-0.017 0 * (-0.424) + 0 * 0.358 = 0


Sum = 0
0
Activation = 0.5

-0.740 0.5
-0.893 0 * (-0.740) + 0 * (-0.577) = 0
-0.577

0.148
0 * (-0.961) + 0 * (-0.469) = 0
0
Sum = 0
-0.961 Activation = 0.5

-0.469 0.5
INPUT LAYER TO HIDDEN LAYER
X1 X2 Class
Sum = 0.358 0 0 0
Activation = 0.588
0 1 1

0.588 1 0 1
-0.424
1 1 0
0.358

-0.017 0 * (-0.424) + 1 * 0.358 = 0.358


Sum = -0.577
0
Activation = 0.359

-0.740 0.359
-0.893 0 * (-0.740) + 1 * (-0.577) = -0.577
-0.577

0.148
0 * (-0.961) + 1 * (-0.469) = -0.469
1
Sum = -0.469
-0.961 Activation = 0.384

-0.469 0.384
INPUT LAYER TO HIDDEN LAYER
X1 X2 Class
Sum = -0.424 0 0 0
Activation = 0.395
0 1 1

0.395 1 0 1
-0.424
1 1 0
0.358

-0.017 1 * (-0.424) + 0 * 0.358 = -0.424


Sum = -0.740
1
Activation = 0.323

-0.740 0.323
-0.893 1 * (-0.740) + 0 * (-0.577) = -0.740
-0.577

0.148
1 * (-0.961) + 0 * (-0.469) = -0.961
0
Sum = -0.961
-0.961 Activation = 0.276

-0.469 0.276
INPUT LAYER TO HIDDEN LAYER
X1 X2 Class
Sum = -0.066 0 0 0
Activation = 0.483
0 1 1

0.483 1 0 1
-0.424
1 1 0
0.358

-0.017 1 * (-0.424) + 1 * 0.358 = -0.066


Sum = -1.317
1
Activation = 0.211

-0.740 0.211
-0.893 1 * (-0.740) + 1 * (-0.577) = -1.317
-0.577

0.148
1 * (-0.961) + 1 * (-0.469) = -1.430
1
Sum = -1.430
-0.961 Activation = 0.193

-0.469 0.193
HIDDEN LAYER TO OUTPUT LAYER
$
1 X1 X2 Class
𝑠𝑢𝑚 = ' 𝑥𝑖 ∗ 𝑤𝑖 𝑦= 0 0 0
1 + 𝑒 %&
!"#
0.5 0 1 1

1 0 1

1 1 0
-0.017

-0.893 Sum = -0.381


0.5 0.405
Activation = 0.405

0.148
0

0.5 * (-0.017) + 0.5 * (-0.893) + 0.5 * 0.148 = -0.381

0.5
HIDDEN LAYER TO OUTPUT LAYER
X1 X2 Class
0 0 0

0.589 0 1 1

1 0 1

1 1 0
-0.017

-0.893 Sum = -0.274


0.360 0.431
Activation = 0.431

0.148
1

0.589 * (-0.017) + 0.360 * (-0.893) + 0.385 * 0.148 = -0.274

0.385
HIDDEN LAYER TO OUTPUT LAYER
X1 X2 Class
0 0 0

0.395 0 1 1

1 0 1

1 1 0
-0.017

-0.893 Sum = -0.254


0.323 0.436
Activation = 0.436

0.148
0

0.395 * (-0.017) + 0.323 * (-0.893) + 0.277 * 0.148 = -0.254

0.277
HIDDEN LAYER TO OUTPUT LAYER
X1 X2 Classe
0 0 0

0.483 0 1 1

1 0 1

1 1 0
-0.017

-0.893 Sum = -0.168


0.211 0.458
Activation = 0.458

0.148
1

0.483 * (-0.017) + 0.211 * (-0.893) + 0.193 * 0.148 = -0.168

0.193
“XOR” OPERATOR – ERROR (LOSS FUNCTION)

The simplest algorithm


error = correct – prediction

X1 X2 Class Prediction Error


0 0 0 0.405 -0.405
0 1 1 0.431 0.569
1 0 1 0.436 0.564
1 1 0 0.458 -0.458
Average = 0.499
ALGORITHM

Initialize the weights


Cost function (loss function)
Gradient descent
Calculate the outputs
Derivative
Calculate the error Delta
Backpropagation
Calculate the new weights

Update the weights

Reached
No the Yes
number of
epochs?
GRADIENT DESCENT

min C(w1, w2 ... wn)


Calculate the partial derivative to move to the
gradient direction

error Calculates the slope of the


curve using partial derivatives

Local minimum

Global minimum
1 2 3 4 5 6 7 w
GRADIENT DESCENT (DERIVATIVE)

1
𝑦=
1 + 𝑒 !"

𝑑 = y * (1 – y)
𝑑 = 0.1 * (1 – 0.1)
DELTA PARAMETER

Activation function

Derivative

error
Delta

Gradient

w
OUTPUT LAYER – DELTA
X1 X2 Class
𝑑𝑒𝑙𝑡𝑎!"#$"# = 𝑒𝑟𝑟𝑜𝑟 ∗ 𝑠𝑖𝑔𝑚𝑜𝑖𝑑%&'()*#()&
0 0 0

0.5 0 1 1

1 0 1

1 1 0
-0.017

-0.893 Sum = -0.381


0.5 0.405
Activation = 0.405
Error = 0 – 0.405 = -0.405
0.148 Derivative activation (sigmoid) = 0.241
0 Delta (output) = -0.405 * 0.241 = -0.097

0.5
OUTPUT LAYER – DELTA
X1 X2 Class
𝑑𝑒𝑙𝑡𝑎!"#$"# = 𝑒𝑟𝑟𝑜𝑟 ∗ 𝑠𝑖𝑔𝑚𝑜𝑖𝑑%&'()*#()&
0 0 0

0.589 0 1 1

1 0 1

1 1 0
-0.017

-0.893 Sum = -0.274


0.360 0.431
Activation = 0.431
Error = 1 – 0.431 = 0.569
0.148 Derivative activation (sigmoid) = 0.245
1 Delta (output) = 0.569 * 0.245 = 0.139

0.385
OUTPUT LAYER – DELTA
X1 X2 Class
𝑑𝑒𝑙𝑡𝑎!"#$"# = 𝑒𝑟𝑟𝑜𝑟 ∗ 𝑠𝑖𝑔𝑚𝑜𝑖𝑑%&'()*#()&
0 0 0
0.395 0 1 1

1 0 1

1 1 0
-0.017

-0.893 Sum = -0.254


0.323 0.436
Activation = 0.436
Error = 1 – 0.436 = 0.564
0.148 Derivative activation (sigmoid) = 0.246
0 Delta (output) = 0.564 * 0.246 = 0.138

0.277
OUTPUT LAYER – DELTA
X1 X2 Class
𝑑𝑒𝑙𝑡𝑎!"#$"# = 𝑒𝑟𝑟𝑜𝑟 ∗ 𝑠𝑖𝑔𝑚𝑜𝑖𝑑%&'()*#()&
0 0 0

0.483 0 1 1

1 0 1

1 1 0
-0.017

-0.893 Sum = -0.168


0.211 0.458
Activation = 0.458
Error = 0 – 0.458 = -0.458
0.148 Derivative activation (sigmoid) = 0.248
1 Delta (output) = -0.458 * 0.248 = -0.113

0.193
HIDDEN LAYER – DELTA
𝑑𝑒𝑙𝑡𝑎'!(()$ = 𝑠𝑖𝑔𝑚𝑜𝑖𝑑()*!+,-!+) ∗ 𝑤𝑒𝑖𝑔ℎ𝑡 ∗ 𝑑𝑒𝑙𝑡𝑎./-0/- X1 X2 Class
Sum = 0 0 0 0
Derivative = 0.25
0 1 1
0.5 1 0 1

1 1 0

-0.017

0 Sum = 0
Derivative = 0.25
-0.893
0.5 Delta (output) = -0.097

0.25 * (-0.017) * (-0.097) = 0.000


0.148
0
0.25 * (-0.893) * (-0.097) = 0.021
0.25 * 0.148 * (-0.097) = -0.003
Sum = 0
Derivative = 0.25

0.5
HIDDEN LAYER – DELTA
𝑑𝑒𝑙𝑡𝑎'!(()$ = 𝑠𝑖𝑔𝑚𝑜𝑖𝑑()*!+,-!+) ∗ 𝑤𝑒𝑖𝑔ℎ𝑡 ∗ 𝑑𝑒𝑙𝑡𝑎./-0/- X1 X2 Class

Sum = 0.358 0 0 0
Derivative = 0.242
0 1 1
0.589 1 0 1

1 1 0

-0.017

0 Sum = -0.577
Derivative = 0.230
-0.893
0.360 Delta (output) = 0.139

0.242 * (-0.017) * 0.139 = -0.000


0.148
1
0.230 * (-0.893) * 0.139 = -0.028
0.236 * 0.148 * 0.139 = 0.004
Sum = -0.469
Derivative = 0.236

0.385
HIDDEN LAYER – DELTA
𝑑𝑒𝑙𝑡𝑎'!(()$ = 𝑠𝑖𝑔𝑚𝑜𝑖𝑑()*!+,-!+) ∗ 𝑤𝑒𝑖𝑔ℎ𝑡 ∗ 𝑑𝑒𝑙𝑡𝑎./-0/- X1 X2 Class
Sum = -0.424 0 0 0
Derivative = 0.239
0 1 1
0.396
1 0 1

1 1 0

-0.017

1 Sum = -0.740
Derivative = 0.218
-0.893
0.323 Delta (output) = 0.138

0.239 * (-0.017) * 0.138 = -0.000


0.148
0
0.218 * (-0.893) * 0.138 = -0.026
0.200 * 0.148 * 0.138 = 0.004
Sum = -0.961
Derivative = 0.200

0.277
HIDDEN LAYER – DELTA
𝑑𝑒𝑙𝑡𝑎'!(()$ = 𝑠𝑖𝑔𝑚𝑜𝑖𝑑()*!+,-!+) ∗ 𝑤𝑒𝑖𝑔ℎ𝑡 ∗ 𝑑𝑒𝑙𝑡𝑎./-0/- X1 X2 Class

Sum = -0.066 0 0 0
Derivative = 0.249
0 1 1
0.484 1 0 1

1 1 0

-0.017

1 Sum = -1.317
Derivative = 0.166
-0.893
0.211 Delta (output) = -0.113

0.249 * (-0.017) * (-0.113) = 0.000


0.148
1
0.166 * (-0.893) * (-0.113) = 0.016
0.155 * 0.148 * (-0.113) = -0.002
Sum = -1.430
Derivative = 0.155

0.193
WEIGHT UPDATE

𝑤𝑒𝑖𝑔ℎ𝑡𝑛 + 1 = 𝑤𝑒𝑖𝑔ℎ𝑡𝑛 + (𝑖𝑛𝑝𝑢𝑡 ∗ 𝑑𝑒𝑙𝑡𝑎 ∗ 𝑙𝑒𝑎𝑟𝑖𝑛𝑔_𝑟𝑎𝑡𝑒)


LEARNING RATE

• Defines how fast the algorithm will learn


• High: the convergence is fast but may lose the global minimum
• Low: the convergence will be slower but more likely to reach the global
minimum
error

w
WEIGHT UPDATE – OUTPUT LAYER TO HIDDEN LAYER
0.5 𝑤𝑒𝑖𝑔ℎ𝑡𝑛 + 1 = 𝑤𝑒𝑖𝑔ℎ𝑡! + (𝒊𝒏𝒑𝒖𝒕 ∗ 𝒅𝒆𝒍𝒕𝒂 ∗ 𝑙𝑒𝑎𝑟𝑛𝑖𝑛𝑔_𝑟𝑎𝑡𝑒) 0.588

0 0

Delta (output) = -0.097 Delta (output) = 0.139

0 1

0.5 * (-0.097) + 0.588 * 0.139 +


0.395 * 0.138 + 0.483 * (-0.113) = 0.033
0.395 0.483

1 1

Delta (output) = 0.138 Delta (output) = -0.113

0 1
WEIGHT UPDATE – OUTPUT LAYER TO HIDDEN LAYER
𝑤𝑒𝑖𝑔ℎ𝑡𝑛 + 1 = 𝑤𝑒𝑖𝑔ℎ𝑡! + (𝒊𝒏𝒑𝒖𝒕 ∗ 𝒅𝒆𝒍𝒕𝒂 ∗ 𝑙𝑒𝑎𝑟𝑛𝑖𝑛𝑔_𝑟𝑎𝑡𝑒)

0 0

0.5 Delta (output) = -0.097 0.359 Delta (output) = 0.139

0 1

0.5 * (-0.097) + 0.359 * 0.139 +


0.323 * 0.138 + 0.211 * (-0.113) = 0.022

1 1

0.323 Delta (output) = 0.138 0.211 Delta (output) = -0.113

0 1
WEIGHT UPDATE – OUTPUT LAYER TO HIDDEN LAYER
𝑤𝑒𝑖𝑔ℎ𝑡𝑛 + 1 = 𝑤𝑒𝑖𝑔ℎ𝑡! + (𝒊𝒏𝒑𝒖𝒕 ∗ 𝒅𝒆𝒍𝒕𝒂 ∗ 𝑙𝑒𝑎𝑟𝑛𝑖𝑛𝑔_𝑟𝑎𝑡𝑒)

0 0

Delta (output) = -0.097 Delta (output) = 0.139

0 1

0.5 0.384
0.5 * (-0.097) + 0.384 * 0.139 +
0.276 * 0.138 + 0.193 * (-0.113) = 0.021

1 1

Delta (output) = 0.138 Delta (output) = -0.113

0 1

0.276 0.193
WEIGHT UPDATE – OUTPUT LAYER TO HIDDEN LAYER
Learning rate = 0.3

Input x delta -0.017


0.033
0.022 -0.893
0.021
0.148

𝑤𝑒𝑖𝑔ℎ𝑡𝑛 + 1 = 𝑤𝑒𝑖𝑔ℎ𝑡+ + (𝒊𝒏𝒑𝒖𝒕 ∗ 𝒅𝒆𝒍𝒕𝒂 ∗


𝑙𝑒𝑎𝑟𝑛𝑖𝑛𝑔_𝑟𝑎𝑡𝑒)

-0.017 + 0.033 * 0.3 = -0.007


-0.007

-0.893 + 0.022 * 0.3 = -0.886 -0.886

0.148 + 0.021 * 0.3 = 0.154


0.154
WEIGHT UPDATE – HIDDEN LAYER TO INPUT LAYER
Delta = -0.001
𝑤𝑒𝑖𝑔ℎ𝑡𝑛 + 1 = 𝑤𝑒𝑖𝑔ℎ𝑡! + (𝒊𝒏𝒑𝒖𝒕 ∗ 𝒅𝒆𝒍𝒕𝒂 ∗ 𝑙𝑒𝑎𝑟𝑛𝑖𝑛𝑔_𝑟𝑎𝑡𝑒)
Delta = 0.000

0 0

0 1

Delta = 0.001 Delta = -0.000

1 1
0 * 0.000 + 0 * (-0.001) + 1 * (0.001) + 1 * -0.000 = -0.000
0 * 0.000 + 1 * (-0.001) + 0 * (0.001) + 1 * -0.000 = -0.000

0 1
WEIGHT UPDATE – HIDDEN LAYER TO INPUT LAYER
𝑤𝑒𝑖𝑔ℎ𝑡𝑛 + 1 = 𝑤𝑒𝑖𝑔ℎ𝑡! + (𝒊𝒏𝒑𝒖𝒕 ∗ 𝒅𝒆𝒍𝒕𝒂 ∗ 𝑙𝑒𝑎𝑟𝑛𝑖𝑛𝑔_𝑟𝑎𝑡𝑒)

0 0

Delta = 0.021 Delta = -0.028

0 1

0 * 0.021 + 0 * (-0.028) + 1 * (-0.026) + 1 * 0.016 = -0.009


0 * 0.021 + 1 * (-0.028) + 0 * (-0.026) + 1 * 0.016 = -0.012
1
1
Delta = -0.026
Delta = 0.016

0
1
WEIGHT UPDATE – HIDDEN LAYER TO INPUT LAYER
𝑤𝑒𝑖𝑔ℎ𝑡𝑛 + 1 = 𝑤𝑒𝑖𝑔ℎ𝑡! + (𝒊𝒏𝒑𝒖𝒕 ∗ 𝒅𝒆𝒍𝒕𝒂 ∗ 𝑙𝑒𝑎𝑟𝑛𝑖𝑛𝑔_𝑟𝑎𝑡𝑒)

0 0

0 1

Delta = -0.003 Delta = 0.004

0 * (-0.003) + 0 * 0.004 + 1 * 0.004 + 1 * (-0.002) = 0.002


0 * (-0.003) + 1 * 0.004 + 0 * 0.004 + 1 * (-0.002) = 0.002
1 1

0 1

Delta = 0.004 Delta = -0.002


WEIGHT UPDATE – HIDDEN LAYER TO INPUT LAYER
Learning rate = 0.3
-0.424

0.358
Input x delta
-0.000 -0.009 0.002
-0.000 -0.012 0.002
-0.740

𝑤𝑒𝑖𝑔ℎ𝑡𝑛 + 1 = 𝑤𝑒𝑖𝑔ℎ𝑡$ + (𝒊𝒏𝒑𝒖𝒕 ∗ 𝒅𝒆𝒍𝒕𝒂 ∗ 𝑙𝑒𝑎𝑟𝑛𝑖𝑛𝑔_𝑟𝑎𝑡𝑒) -0.577

-0.424 + (-0.000) * 0.3 = -0.424 -0.961


-0.424

0.358 + (-0.000) * 0.3 = 0.358 0.358 -0.469

-0.740 + (-0.009) * 0.3 = -0.743

-0.577 + (-0.012) * 0.3 = -0.580 -0.743

-0.580

-0.961 + 0.002 * 0.3 = -0.960

-0.469 + 0.002 * 0.3 = -0.468


-0.960

-0.468
BIAS

-0.851 1
1
-0.424

0.358

-0.017

0
-0.541
0.145

-0.740 -0.893

-0.577

0.148
1

-0.961 0.985

-0.469

𝑜𝑢𝑡𝑝𝑢𝑡 = 𝑠𝑢𝑚 𝑖𝑛𝑝𝑢𝑡𝑠 ∗ 𝑤𝑒𝑖𝑔ℎ𝑡𝑠 + 𝑏𝑖𝑎𝑠


ERROR (LOSS FUNCTION)

The simplest algorithm


error = correct – prediction

X1 X2 Class Prediction Error


0 0 0 0.405 -0.405
0 1 1 0.431 0.569
1 0 1 0.436 0.564
1 1 0 0.458 -0.458
Average = 0.499
MEAN SQUARED ERROR (MSE) AND ROOT MEAN
SQUARED ERROR (RMSE)

X1 X2 Class Prediction Error


0 0 0 0.405 (0 – 0.405)2 = 0.164
0 1 1 0.431 (1 – 0.431)2 = 0.322
1 0 1 0.436 (1 – 0.436)2 = 0.316
1 1 0 0.458 (0 - 0.458)2 = 0.209
Sum = 1.011
10 (expected) – 5 (prediction) = 5 (52 = 25)
MSE = 1.011 / 4 = 0.252
10 (expected) – 8 (prediction) = 2 (22 = 4)
RMSE = 0.501
MULTIPLE OUTPUTS
X1 X2 Class
-0.851 1
1 0 0 0
-0.424
0 1 1
0.358
1 0 1
-0.541 1 1 0
-0.017
0 0.012 0.988
0.145
0.148
-0.893
-0.740
-0.577 0.452
0.123

0.851 0.988 0.012 1 0


1 0 1
-0.808 0 0
-0.961 0.985 0 0
0 0
-0.469
Source: https://developers.google.com/machine-learning/crash-course/multi-class-neural-networks/softmax
HIDDEN LAYERS

𝐼𝑛𝑝𝑢𝑡𝑠 + 𝑂𝑢𝑡𝑝𝑢𝑡𝑠
𝑁𝑒𝑢𝑟𝑜𝑛𝑠 =
2

Inputs Output

2+1
𝑁𝑒𝑢𝑟𝑜𝑛𝑠 = = 1.5
2

7+1
𝑁𝑒𝑢𝑟𝑜𝑛𝑠 = =4 8+2
2 𝑁𝑒𝑢𝑟𝑜𝑛𝑠 = =5
2
HIDDEN LAYERS

• Linearly separable problems do not require hidden layers


• In general, two layers work well
• Deep learning research shows that more layers are essential for more
complex problems
HIDDEN LAYERS

Credit history Debts Properties Anual income Risk


Bad High No < 15.000 High
Unknown High No >= 15.000 a <= 35.000 High
Unknown Low No >= 15.000 a <= 35.000 Moderate
Unknown Low No > 35.000 High
Unknown Low No > 35.000 Low
Unknown Low Yes > 35.000 Low
Bad Low No < 15.000 High
Bad Low Yes > 35.000 Moderate
Good Low No > 35.000 Low
Good High Yes > 35.000 Low
Good High No < 15.000 High
Good High No >= 15.000 a <= 35.000 Moderate
Good High No > 35.0000 Low
Bad High No >= 15.000 a <= 35.000 High
HIDDEN LAYERS

4+3 History
𝑁𝑒𝑢𝑟𝑜𝑛𝑠 = = 3,5
2

Credit history High

Debts
Current Moderate
situation
Properties

Low
Anual income

Patrimony

The higher the activation value,


the more impact the neuron has
OUTPUT LAYER WITH CATEGORICAL DATA

Credit history High

Debts
Moderate

Properties

Low
Anual income Credit history Debts Properties Anual Risk
income
3 1 1 1 100
2 1 1 2 100
error = correct – prediction 2 2 1 2 010
2 2 1 3 100

expected output = 1 0 0 2
2
2
2
1
2
3
3
001
001

prediction = 0.95 0.02 0.03 3


3
2
2
1
2
1
3
100
010
1 2 1 3 001
error = (1 – 0.95) + (0 – 0.02) + (0 – 0.03) 1 1 2 3 001
1 1 1 1 100
error = 0.05 + 0.02 + 0.03 = 0.08 1 1 1 2 010
1 1 1 3 001
3 1 1 2 100
STOCHASTIC GRADIENT DESCENT
Credit history Debts Properties Anual Risk
income
3
2
1
1
1
1 2
1 100
100
Batch gradient descent
2
2
2
2
1
1
2
3
010
100
Calculate the error for all instances and then update the weights
2 2 1 3 001
2 2 2 3 001 Stochastic gradient descent
3 2 1 1 100
3 2 2 3 010 Calculate the error for each instance and then update the weights
1 2 1 3 001
1 1 2 3 001
1 1 1 1 100
1 1 1 2 010
1 1 1 3 001
3 1 1 2 100

Credit history Debts Properties Anual Risk


income
3 1 1 1 100
2 1 1 2 100
2 2 1 2 010
2 2 1 3 100
2 2 1 3 001
2 2 2 3 001
3 2 1 1 100
3 2 2 3 010
1 2 1 3 001
1 1 2 3 001
1 1 1 1 100
1 1 1 2 010
1 1 1 3 001
3 1 1 2 100
CONVEX AND NON CONVEX

Convex

Non convex
GRADIENT DESCENT

•Stochastic gradient descent


• Prevent local minimums (non convex)
• Faster
•Mini batch gradient descent
• Select a pre-defined number of instances in order
to calculate the error and update the weights
DEEP LEARNING

•90’s: SVM (Support Vector Machines)


•From 2006, several algorithms were created
for training neural networks
•Two or more hidden layers
DEEP LEARNING

•Convolutional neural networks


•Recurrent neural networks
•Autoencoders
•GANs (Generative adversarial networks)
SOFTMAX

,(+)
Y=
∑ ,(+)
PLAN OF ATTACK – NEURAL NETWORKS FOR IMAGE
LOREM IPSUM
CLASSIFICATION

1.1. Part
Intuition
1 about neural networks
2.Biological
Neuralfundamentals
network using the pixels of the images
Single layer perceptron
2.3. Part
Feature
2 extractor with OpenCV
4.Multi-layer
Neuralperceptron
network using feature extraction
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
PIXELSIPSUM
LOREM

RGB
1. Part 1 32 pixels

Biological fundamentals
Single layer perceptron 32 pixels

2. Part 2
Multi-layer perceptron
32 x 32 = 1024 pixels
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
PIXELSIPSUM
LOREM

0,1,1,1,0,0,1,0,1,0,0,1,1,1,0,0,0,0,1,0,0,1,1,1,0,9

0,1,1,1,0,0,1,0,0,0,0,1,1,1,0,0,1,0,1,0,0,1,1,1,0,6
FEATURE
LOREM EXTRACTION
IPSUM

Brown (mouth) Orange (T-Shirt)


1. Part 1
Blue (pants) Blue (shorts)
Gray (shoes)
Biological fundamentals Blue (sneakers)
Single layer perceptron
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
PLAN OF ATTACK – CONVOLUTIONAL NEURAL
LOREM IPSUM
NETWORKS FOR IMAGE CLASSIFICATION

1. Part
1. Intuition
1 about convolutional neural networks
2. Biological
Types of neural networks for image classification
fundamentals
Single layer perceptron
3. Convolutional neural network for image classification
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
PIXELSIPSUM
LOREM

32 x 32 = 1.024 x 3 = 3.072 inputs

• It does not use all pixels


• It applies a dense neural network, but at the beginning it transforms the data
• What are the most important features?
CONVOLUTIONAL
LOREM IPSUM NEURAL NETWORK STEPS

1.
1. Convolution
Part 1 operation
2. Biological
Poolingfundamentals
Single layer perceptron
3.
2. Flattening
Part 2
4. Multi-layer
Dense neuralperceptronnetwork
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
STEP 1:
LOREM CONVOLUTION OPERATION
IPSUM

1. Part 1
0 0 0 fundamentals
Biological 0 0 0 0
0 1 layer
Single 0 0perceptron
0 1 0 0
0 0 0 0 0 0 0 1 0 0
2. 0Part
0 0
2 1 0 1 1 X 1 0 1 =
Multi-layer perceptron
0 1 0 1 1 0 0 0 1 1
3. 0Part
1 30 1 1 0 1 Feature detector
Pybrain
0 1 0 0 0 1 1
Feature map
Sklearn Image
TensorFlow
0*1+0*0+0*0+0*1+1*0+0*1+0*0+0*1+0*1=0
PyTorch
STEP 1:
LOREM CONVOLUTION OPERATION
IPSUM

0 0 0 0 0 0 0
0 1 0 0 0 1 0 0 1
0 0 0 0 0 0 0 1 0 0
0 0 0 1 0 1 1 X 1 0 1 =
0 1 0 1 1 0 0 0 1 1
0 1 0 1 1 0 1 Feature detector
0 1 0 0 0 1 1
Feature map
Image

0*1+0*0+0*0+1*1+0*0+0*1+0*0+0*1+0*1=1
STEP 1:
LOREM CONVOLUTION OPERATION
IPSUM

0 0 0 0 0 0 0
0 1 0 0 0 1 0 0 1 0
0 0 0 0 0 0 0 1 0 0
0 0 0 1 0 1 1 X 1 0 1 =
0 1 0 1 1 0 0 0 1 1
0 1 0 1 1 0 1 Feature detector
0 1 0 0 0 1 1
Feature map
Image

0*1+0*0+0*0+0*1+0*0+0*1+0*0+0*1+0*1=0
STEP 1:
LOREM CONVOLUTION OPERATION
IPSUM

0 0 0 0 0 0 0
0 1 0 0 0 1 0 0 1 0 1
0 0 0 0 0 0 0 1 0 0
0 0 0 1 0 1 1 X 1 0 1 =
0 1 0 1 1 0 0 0 1 1
0 1 0 1 1 0 1 Feature detector
0 1 0 0 0 1 1
Feature map
Image

0*1+0*0+0*0+0*1+0*0+1*1+0*0+0*1+0*1=1
STEP 1:
LOREM CONVOLUTION OPERATION
IPSUM

0 0 0 0 0 0 0
0 1 0 0 0 1 0 0 1 0 1 0
0 0 0 0 0 0 0 1 0 0 0 2 1 1 2
0 0 0 1 0 1 1 X 1 0 1 = 1 2 2 3 1
0 1 0 1 1 0 0 0 1 1 1 3 3 3 2
0 1 0 1 1 0 1 Feature detector
1 3 1 3 5
0 1 0 0 0 1 1
Feature map
Image

1*1+0*0+0*0+1*1+0*0+1*1+0*0+1*1+1*1=5
STEP 1:
LOREM CONVOLUTION OPERATION – RELU
IPSUM

0 0 0 0 0 0 0
0 1 0 0 0 1 0 0 1 0 1 0
0 0 0 0 0 0 0 1 0 0 0 2 1 1 2
0 0 0 1 0 1 1 X 1 0 1 = 1 2 2 3 1
0 1 0 1 1 0 0 0 1 1 1 3 3 3 2
0 1 0 1 1 0 1 Feature detector
1 3 1 3 5
0 1 0 0 0 1 1
Feature map
Image
STEP 1:
LOREM CONVOLUTIONAL LAYER
IPSUM

0 0 0 0 0 0 0 0 1 0 1 0
0 1 00 1
0 1 0 0 0 1 0 0 02 11 01 12 0
0 02 11 01 12 0
0 0 0 0 0 0 0 1 02 0220 1131 0110 121 0 0
0 0 0 1 0 1 1 1 02 220 131 110 21 0
1 13 0230 22032 13121 1101 212 0
0 1 0 1 1 0 0 1 13 230 2032 3121 101 12 0
1 13 1311 23032 23252 3213 111 2
0 1 0 1 1 0 1 1 13 311 3032 3252 213 11 2
1 13 311 332 352 23 1
0 1 0 0 0 1 1 1 13 311 332 352 23 1
1 13 31 33 35 2
Image 1 13 31 33 35 2
1 13 31 33 35 2
1 3 1 3 5
The network will decide which feature detector to use 1 3 1 3 5
Feature maps
The convolutional layer is the set of feature maps
STEP 2:
LOREM POOLING
IPSUM
STEP 2:
LOREM POOLING
IPSUM

0 1 0 1 0
0 2 1 1 2 2
1 2 2 3 1
1 3 3 3 2
1 3 1 3 5
Feature map
STEP 2:
LOREM POOLING
IPSUM

0 1 0 1 0
0 2 1 1 2 2 1
1 2 2 3 1
1 3 3 3 2
1 3 1 3 5
Feature map
STEP 2:
LOREM POOLING
IPSUM

0 1 0 1 0
0 2 1 1 2 2 1 2
1 2 2 3 1
1 3 3 3 2
1 3 1 3 5
Feature map
STEP 2:
LOREM POOLING
IPSUM

0 1 0 1 0
0 2 1 1 2 2 1 2
1 2 2 3 1 3
1 3 3 3 2
1 3 1 3 5
Feature map
STEP 2:
LOREM POOLING
IPSUM

0 1 0 1 0
0 2 1 1 2 2 1 2
1 2 2 3 1 3 3
1 3 3 3 2
1 3 1 3 5
Feature map
STEP 2:
LOREM POOLING
IPSUM

0 1 0 1 0
0 2 1 1 2 2 1 2
1 2 2 3 1 3 3 2
1 3 3 3 2
1 3 1 3 5
Feature map
STEP 2:
LOREM POOLING
IPSUM

0 1 0 1 0
0 2 1 1 2 2 1 2
1 2 2 3 1 3 3 2
1 3 3 3 2 3
1 3 1 3 5
Feature map
STEP 2:
LOREM POOLING
IPSUM

0 1 0 1 0
0 2 1 1 2 2 1 2
1 2 2 3 1 3 3 2
1 3 3 3 2 3 3
1 3 1 3 5
Feature map
STEP 2:
LOREM POOLING
IPSUM

0 1 0 1 0
0 2 1 1 2 2 1 2
1 2 2 3 1 3 3 2
1 3 3 3 2 3 3 5
1 3 1 3 5
Feature map
CONVOLUTIONAL
LOREM IPSUM NEURAL NETWORK – POOLING

0 0 0 0 0 0 0 0 1 0 1 0
0 1 00 1
0 1 0 0 0 1 0 0 2 1 1 2 0
0 1 0 1 2 1 2
0 02 11 01 12 0 2 2 1
0 0 0 0 0 0 0 1 02 0220 1131 0110 121 0 0 3 23 12 2
1 02 220 131 110 21 0 3 23 12 2
0 0 0 1 0 1 1
1 13 0230 22032 13121 1101 212 0 3 33 2352 12 1 2 2
1 13 230 2032 3121 101 12 0 3 33 352 2 1 2
0 1 0 1 1 0 0 3 33 352 2 1 2
1 13 1311 23032 23252 3213 111 2 3 33 352 2 1 2
0 1 0 1 1 0 1 1 13 311 3032 3252 213 11 2 3 33 35 2
1 13 311 332 352 23 1 3 33 35 2
0 1 0 0 0 1 1 1 13 311 332 352 23 1 3 33 35 2
1 13 31 33 35 2 3 3 5
Image 1 13 31 33 35 2 3 3 5
1 13 31 33 35 2
1 3 1 3 5
1 3 1 3 5 Max pooling

Feature maps
STEP 3:
LOREM FLATTENING
IPSUM

2
1
2
2 1 2
3
3 3 2
3
3 3 5
2
Pooled feature
map
3
3
5
STEP 3:
LOREM DENSE NEURAL NETWORK
IPSUM

0.9

0.8

0.1

0.2

0.1
STEP 3:
LOREM DENSE NEURAL NETWORK
IPSUM

0.1

0.2

0.1

0.7

0.9
STEP 3:
LOREM DENSE NEURAL NETWORK
IPSUM

0.1

0.2

0.9

0.2

0.3
STEP 3:
LOREM DENSE NEURAL NETWORK
IPSUM

0.9

65%
0.6

05%
0.6

0.2 30%

0.3
CONVOLUTIONAL
LOREM IPSUM NEURAL NETWORK

0 0 0 0 0 0 0 0 1 0 1 0 2
0
1 0 1 0 2 1 2
0 1 0 0 0 1 0
0 20 11 10 21 0 2 1 2 1
0 0 0 0 0 0 0 0 2 1 1 2 3 32 21 2
1 20 022 131 0 11 1 2 0 3 32 21 2 2
0 0 0 1 0 1 1
1 2 02 13 0 1 1 0 3 33 53
2 21 2
0 1 0 1 1 0 0 1 31 032 2032 1123 10 1 21 0 3 33 53
1 3 03 203 112 10 21 0 3 33
2 5 21 2 3
0 1 0 1 1 0 1 1 31 113 2033 22503 3112 110 21 0 3 3
32
5
21 2
0 1 0 0 0 1 1 1 31 113 2033 22503 3112 110 21 0
3 32 21 2 3
3 33 53
1 3 1 1 203 225 31 11 2 2 21 2
1 3 3 3 2 3 33 53 2
Image 1 3 1 1 203 225 31 11 2 2
1 3 3 3 2 3 33 53
1 3 11 23 25 3 1 2
1 31 32 32 23 1 3 3 5 3
1 3 1 3 5
1 3 3 3 2 3 3 5
1 3 1 3 5 3
1 3 3 3 2
1 3 1 3 5
1 3 1 3 5 5

Training using gradient descent

In addition to adjusting the weights, the feature detector is also changed


PLAN OF ATTACK – TRANSFER LEARNING AND FINE
LOREM IPSUM
TUNING FOR IMAGE CLASSIFICATION

1. Part
1. Intuition
1 about transfer learning
2. Biological
Implementation
fundamentals
Single layer perceptron
3. Intuition about fine tuning
2. Part 2
4. Multi-layer
Implementation
perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
TRANSFER
LOREM IPSUMLEARNING

1. Part 1
Biological fundamentals
Single layer perceptron
2. Part 2
KNOWLEDGE TRANSFER
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
TRANSFER
LOREM IPSUMLEARNING

0 1 0 1 0 2
0 1 0 1 0 2 1 2
0 20 11 10 21 0 2 1 2 1
0 2 1 1 2 3 32 21 2
1 20 02
2 13
1 01 12 0 3 32 21 2
2 Elephant
ImageNet 1
1
31
23
2
20 31 1 0
03
2 123 112
12 0 3
3
33
3
523
52
3
12
12
2
2
3 Snake
1 3 3 0 302 211 01 12 0 3 33 35 2
1 31 13 33 253 32
1 2 1
1 3 1 1 302 522 13 11 2
3
3
33
3
35
5
2
3 Lion
1 13 31 33 35 2
3 3 5
13 13 23 23 32 1 2
1 1 3 5
1 13 31 33 35 2 3

General features 1 3 1 3 5
3

Transfer trained parameters Classification specific layers

2
0 1 0 1 0
0 1 0 1 0 2 1 2 1
0 20 11 10 21 0 2 1 2
0 2
1 2 1 3 32 21 2 2
1 20131 01 02 12 0
Custom 32 21
2 3 2
1 2
20 31 1 0
1 31 32 32 23 11 12 0 3 33 523 12 2 3 Cat
0 2 1 3 3 52
3 12 2
images 1 3 3 30 21
1 31 113 0233 2253 132
01
1
12 0 3
3
33
33
35
35
2
2
3 Dog
1 3 1 1 302 522 1 11 2 3 3 5
1 13 31 33 35 32 2
3 3 5
1 13 131 233 235 32 1
3
1 13 31 33 35 2
3
1 3 1 3 5
5
FINE TUNING
LOREM IPSUM

0 1 0 1 0 2
0 1 0 1 0 2 1 2
0 20 11 10 21 0 2 1 2 1
0 2 1 1 2 3 32 21 2
1 20 02
2 13
1 01 12 0 3 32 21 2
2 Elephant
ImageNet 1
1
31
23
2
20 31 1 0
03
2 123 112
12 0 3
3
33
3
523
52
3
12
12
2
2
3 Snake
1 3 3 0 302 211 01 12 0 3 33 35 2
1 31 13 33 253 32
1 2 1
1 3 1 1 302 522 13 11 2
3
3
33
3
35
5
2
3 Lion
1 13 31 33 35 2
3 3 5
13 13 23 23 32 1 2
1 1 3 5
1 13 31 33 35 2 Train some convolutional 3

General features 1 3 1 3 5 layers 3

Transfer trained parameters Classification specific layers

2
0 1 0 1 0
0 1 0 1 0 2 1 2 1
0 20 11 10 21 0 2 1 2
0 2
1 2 1 3 32 21 2 2
1 20131 01 02 12 0
Custom 32 21
2 3 2
1 2
20 31 1 0
1 31 32 32 23 11 12 0 3 33 523 12 2 3 Cat
0 2 1 3 3 52
3 12 2
images 1 3 3 30 21
1 31 113 0233 2253 132
01
1
12 0 3
3
33
33
35
35
2
2
3 Dog
1 3 1 1 302 522 1 11 2 3 3 5
1 13 31 33 35 32 2
3 3 5
1 13 131 233 235 32 1
3
1 13 31 33 35 2
3
1 3 1 3 5
5
PLAN OF ATTACK – NEURAL NETWORKS FOR
LOREM IPSUM
CLASSIFICATION OF EMOTIONS

1. Part
1. Implementation
1 of convolutional neural networks
2. Biological
Detecting emotions in images
fundamentals
Single layer perceptron
3. Detecting emotions in videos
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch

Source: EPFL
PLAN OF
LOREM ATTACK – AUTOENCODERS
IPSUM

1. Part
1. Intuition
1 about autoencoders
2. Biological
Implementation
fundamentalsof linear autoencoders
Single layer perceptron
3. Implementation of convolutional autoencoders
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
AUTOENCODERS
LOREM IPSUM

1. Part 1
Biological fundamentals
Single layer perceptron
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
LINEAR
LOREM AUTOENCODERS
IPSUM

Input layer
Output layer

Coding Decoding
LINEAR
LOREM AUTOENCODERS
IPSUM

1. Part 1
Biological fundamentals
Single layer perceptron
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
Source: https://skymind.ai/wiki/deep-autoencoder
CONVOLUTIONAL
LOREM IPSUM AUTOENCODERS

1. Part 1
Biological fundamentals
Single layer perceptron
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch

Source: https://www.semanticscholar.org/paper/Deep-Clustering-with-Convolutional-Autoencoders-Guo-Liu/b4c8c77fe8ac7aa07a9e41827955d38a24f6137f
AUTOENCODERS
LOREM IPSUM – APPLICATIONS

1. Noise removal
1. Part 1
2. Image compression
Biological fundamentals
3. Single
Fraudlayer
detection
perceptron
4. Dimensionality reduction (similar to PCA)
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
PLAN OF
LOREM ATTACK – YOLO (YOU ONLY LOOK ONCE)
IPSUM

1. Part
1. Intuition
1 about YOLO
2. Biological
Object fundamentals
detection in images (Darknet)
Single layer perceptron
3. Object detection in videos
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
YOLO IPSUM
LOREM (YOU ONLY LOOK ONCE)

1. Part 1
Biological fundamentals
Single layer perceptron
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
PLAN OF ATTACK – RECOGNITION OF GESTURES AND
LOREM IPSUM
ACTIONS

1. Part
1. Intuition
1 about recognition of gestures and actions
2. Biological
Implementation
fundamentalsusing images and videos
Single layer perceptron
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
MPII MODEL
LOREM IPSUM

1. Part 1
Biological fundamentals
Single layer perceptron http://human-pose.mpi-inf.mpg.de/

2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
MPII –IPSUM
LOREM BODY POINTS

0 1. Part 1 Head 9 Rigth knee


1 BiologicalNeck
fundamentals10 Rigth ankle
Single layer perceptron
2 Rigth shoulder 11 Left hip

3
2. Part 2 Rigth elbow 12 Left knee
Multi-layer perceptron
4 Rigth wrist 13 Left ankle

5
3. Part 3 Left shoulder 14 Chest
Pybrain
6 Left elbow 15 Background
Sklearn
7 Left wrist
TensorFlow
8 PyTorch Rigth hip
PLAN OF
LOREM ATTACK – DEEP DREAM
IPSUM

1. Part
1. Intuition
1 about Deep Dream
2. Biological
Implementation
fundamentals
Single layer perceptron
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
DEEP DREAM
LOREM IPSUM

1. Part 1
Biological fundamentals
Single layer perceptron
2. Part 2
Multi-layer perceptron
3. Part 3 0
0
1
1
0
0
1
1
0
2 1 2
2
0

Pybrain 0
0
20
2
11
1
10
1
21
2
0
3
2
32
1
21
2
2
1

1 20 02
2 13
1 01 12 0 3 32 21 2
2 Elephant
ImageNet
Sklearn 1
1
31
23
2
20 31 1 0
03
2 123 112
12 0 3
3
33
3
523
52
3
12
12
2
2
3 Snake
1 3 3 0 302 211 01 12 0 3 33 35 2
1 31 13 33 253 32
1 2 1 3 33 35 Lion
TensorFlow
2
1 3 1 1 302 522 13 11 2 3 3 5 3
1 13 31 33 35 2
3 3 5
13 13 23 23 32 1 2

PyTorch
1 1 3 5
1 13 31 33 35 2 3

General features 1 3 1 3 5
3

Classification specific layers


PLAN OF
LOREM ATTACK – STYLE TRANSFER
IPSUM

1. Intuition about Style Transfer


1. Part 1
2. Biological
Implementation
fundamentals
Single layer perceptron
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
Source of images: https://www.cv-foundation.org/openaccess/content_cvpr_2016/papers/Gatys_Image_Style_Transfer_CVPR_2016_paper.pdf
STYLE IPSUM
LOREM TRANSFER

1. Part 1
Biological fundamentals
Activations (ReLU)
Single layer perceptron
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
STYLE IPSUM
LOREM TRANSFER

1. Part 1
Biological fundamentals
Single layer perceptron
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
PLAN OF ATTACK – GANs (GENERATIVE ADVERSARIAL
LOREM IPSUM
NETWORKS)

1. Part
1. Intuition
1 about GANs
2. Biological
Implementation
fundamentals
Single layer perceptron
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch

Source of images: https://jonathan-hui.medium.com/gan-some-cool-applications-of-gans-4c9ecca35900


GANs IPSUM
LOREM (GENERATIVE ADVERSARIAL NETWORKS)

1. Part 1
Biological fundamentals
Single layerGENERATOR
perceptron DISCRIMINATOR

2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch
GANs IPSUM
LOREM (GENERATIVE ADVERSARIAL NETWORKS)

BANK REAL MONEY

GENERATOR
DISCRIMINATOR
FAKE MONEY
GANs IPSUM
LOREM – GENERATOR

1 – Real images
GENERATOR
0 – Fake images
GANs IPSUM
LOREM - DISCRIMINATOR

DISCRIMINATOR
0

FAKE MONEY

REAL MONEY 1
GANs IPSUM
LOREM – DISCRIMINATOR TRAINING

GENERATOR
FAKE MONEY

DISCRIMINATOR 0

1
REAL MONEY
UPDATE WEIGHTS
GANs IPSUM
LOREM – GENERATOR TRAINING

GENERATOR
FAKE MONEY

DISCRIMINATOR
1

UPDATE WEIGHTS
PLAN OF
LOREM ATTACK – IMAGE SEGMENTATION
IPSUM

1. Part
1. Intuition
1 about segmentation
2. Biological
Implementation
fundamentals
Single layer perceptron
2. Part 2
Multi-layer perceptron
3. Part 3
Pybrain
Sklearn
TensorFlow
PyTorch

Source of images: data-flair.training & deepsense.ai


INSTANCE
LOREM VS. SEMANTIC SEGMENTATION
IPSUM

Source: NVIDIA Developer Blog

Source: Garcia et al

Source: Pexels
MASKIPSUM
LOREM R-CNN

• It was built based on the previous object detection works: R-CNN (2013),
Fast R-CNN (2015), and Faster R-CNN (2015), all by Girshick et al.

Source: https://arxiv.org/abs/1703.06870
R-CNN,
LOREM FAST R-CNNs AND FASTER R-CNN
IPSUM

Original R-CNN Architecture Faster R-CNN Architecture

Source: Girshick et al,. 2013)

Fast R-CNN Architecture

Source: Girshick et al., 2015) Source: Girshick et al., 2015)

You might also like