Computer Vision Masterclass
Computer Vision Masterclass
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
• 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
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
𝑠𝑢𝑚 = % 𝑥𝑖 ∗ 𝑤𝑖
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
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
0 0.1
0 0 0
0 0 0
∑ f ∑ f
0 0 0
0 0.1
1 0 1 x2 1 x2 1
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
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
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
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 + 𝑒 *+
, ! * , "!
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.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.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.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.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.148
0
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.148
1
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.148
0
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.148
1
0.193
“XOR” OPERATOR – ERROR (LOSS FUNCTION)
Reached
No the Yes
number of
epochs?
GRADIENT DESCENT
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.5
OUTPUT LAYER – DELTA
X1 X2 Class
𝑑𝑒𝑙𝑡𝑎!"#$"# = 𝑒𝑟𝑟𝑜𝑟 ∗ 𝑠𝑖𝑔𝑚𝑜𝑖𝑑%&'()*#()&
0 0 0
0.589 0 1 1
1 0 1
1 1 0
-0.017
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.277
OUTPUT LAYER – DELTA
X1 X2 Class
𝑑𝑒𝑙𝑡𝑎!"#$"# = 𝑒𝑟𝑟𝑜𝑟 ∗ 𝑠𝑖𝑔𝑚𝑜𝑖𝑑%&'()*#()&
0 0 0
0.483 0 1 1
1 0 1
1 1 0
-0.017
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.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.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.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.193
WEIGHT UPDATE
w
WEIGHT UPDATE – OUTPUT LAYER TO HIDDEN LAYER
0.5 𝑤𝑒𝑖𝑔ℎ𝑡𝑛 + 1 = 𝑤𝑒𝑖𝑔ℎ𝑡! + (𝒊𝒏𝒑𝒖𝒕 ∗ 𝒅𝒆𝒍𝒕𝒂 ∗ 𝑙𝑒𝑎𝑟𝑛𝑖𝑛𝑔_𝑟𝑎𝑡𝑒) 0.588
0 0
0 1
1 1
0 1
WEIGHT UPDATE – OUTPUT LAYER TO HIDDEN LAYER
𝑤𝑒𝑖𝑔ℎ𝑡𝑛 + 1 = 𝑤𝑒𝑖𝑔ℎ𝑡! + (𝒊𝒏𝒑𝒖𝒕 ∗ 𝒅𝒆𝒍𝒕𝒂 ∗ 𝑙𝑒𝑎𝑟𝑛𝑖𝑛𝑔_𝑟𝑎𝑡𝑒)
0 0
0 1
1 1
0 1
WEIGHT UPDATE – OUTPUT LAYER TO HIDDEN LAYER
𝑤𝑒𝑖𝑔ℎ𝑡𝑛 + 1 = 𝑤𝑒𝑖𝑔ℎ𝑡! + (𝒊𝒏𝒑𝒖𝒕 ∗ 𝒅𝒆𝒍𝒕𝒂 ∗ 𝑙𝑒𝑎𝑟𝑛𝑖𝑛𝑔_𝑟𝑎𝑡𝑒)
0 0
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
0 1
0.276 0.193
WEIGHT UPDATE – OUTPUT LAYER TO HIDDEN LAYER
Learning rate = 0.3
0 0
0 1
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
0 1
0
1
WEIGHT UPDATE – HIDDEN LAYER TO INPUT LAYER
𝑤𝑒𝑖𝑔ℎ𝑡𝑛 + 1 = 𝑤𝑒𝑖𝑔ℎ𝑡! + (𝒊𝒏𝒑𝒖𝒕 ∗ 𝒅𝒆𝒍𝒕𝒂 ∗ 𝑙𝑒𝑎𝑟𝑛𝑖𝑛𝑔_𝑟𝑎𝑡𝑒)
0 0
0 1
0 1
0.358
Input x delta
-0.000 -0.009 0.002
-0.000 -0.012 0.002
-0.740
-0.580
-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
𝐼𝑛𝑝𝑢𝑡𝑠 + 𝑂𝑢𝑡𝑝𝑢𝑡𝑠
𝑁𝑒𝑢𝑟𝑜𝑛𝑠 =
2
Inputs Output
2+1
𝑁𝑒𝑢𝑟𝑜𝑛𝑠 = = 1.5
2
7+1
𝑁𝑒𝑢𝑟𝑜𝑛𝑠 = =4 8+2
2 𝑁𝑒𝑢𝑟𝑜𝑛𝑠 = =5
2
HIDDEN LAYERS
4+3 History
𝑁𝑒𝑢𝑟𝑜𝑛𝑠 = = 3,5
2
Debts
Current Moderate
situation
Properties
Low
Anual income
Patrimony
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
Convex
Non convex
GRADIENT DESCENT
,(+)
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
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
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
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
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
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
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
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
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)
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: 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