Luis Serrano
A friendly introduction to
Convolutional Neural Networks
and Image Recognition
Person AlphabetComputer
 / /  / !
Simple World
Simple World
1
11
1
Simple World
 /
Keyboard
Image recognition software

/
-1 1
1 -1
1 -1
-1 1

/
1 -1 -1 1
-1 1 1 -1
+
+
-
-
+
-+
-
+ - +-
+ - +-
= 4
= -4
+1 +1 +1+1
-1 -1 -1-1
+ + + = 0
+ + + = 0
x x x = 1
x x x = 1
+ -
- +
Image Recognition Classifier
If positive, “”
If negative, “/”
-1 -1
1 -1
1 1
-1 1
-1 -1
1 -1
1 1
-1 1

/
+
+
-
-
+
-+
-
1 1 -1 1
-1 -1 1 -1
= 2
= -2
+1 -1 +1+1
-1 +1 -1-1
+ - +-
+ - +-
Artificial Intelligence
?
= 
= /
+ -
- +
Artificial Intelligence
- -
- -
- +
+ -
+ -
- -
- +
- +
- +
- -
- -
+ -
- -
+ +
+ +
+ -
- -
- +
+ +
- -
+ -
+ -
+ -
- +
+ +
- +
+ -
+ +
- +
+ +
+ +
+ +
16 choices
Artificial Intelligence
+ +
+ +
so-so
Artificial Intelligence
+ +
+ +
- +
+ +
+ -
+ +
+ +
+ -
+ +
- +so-so
worse
better
worse
better
Artificial Intelligence
+ +
+ +
- +
+ +
+ -
+ +
+ +
+ -
+ +
- +so-so
- -
+ +
+ -
- +
+ -
+ -
worse
better!
worse
Artificial Intelligence
Way too many choices
0.5 1.2
0.7 1.0
0.9 -0.7
-0.6 1.1
, , etc…
Gradient Descent
0.5 1.2
0.7 1.0 0.6 0.9
0.5 1.1
0.7 0.4
0.3 1.2
0.9 -0.2
-0.2 1.1
0.9 -0.7
-0.6 1.1
1 -1
-1 1
Lots of
errors
Derivatives
Few
errors
XOXO!
Slightly More Complex World
Person Alphabet
X O
Computer
X O
1 -1 -1
-1 1 -1
-1 -1 1

-1 -1 1
-1 1 -1
1 -1 -1
1 -1 1
-1 1 -1
1 -1 1
-1 1 -1
1 -1 1
-1 1 -1
/
X
O
1 -1 1
-1 1 -1
1 -1 1
+
+
-
-
+
-
+
- +
1 -1
-1 1
Previous Knowledge
-1 1
1 -1
X
O
/
1 -1 1
-1 1 -1
1 -1 1
-1 1 -1
1 -1 1
-1 1 -1
-1 -1 1
-1 1 -1
1 -1 -1
1 -1 -1
-1 1 -1
-1 -1 1

Convolutional Neural Network
Convolution Layer
Pooling Layer
Fully Connected
Layer
1 -1 1
-1 1 -1
1 -1 1
4 -4
-4 4
+ -
- +
+
+
-
-
-4 4
4 -4
- +
+ -
-
-
+
+
Convolution Layer Pooling Layer
1 -1 1
-1 1 -1
1 -1 1
-1 1 -1
1 -1 1
-1 1 -1
-4 4
4 -4
+ -
- +
+
+
-
-
4 -4
-4 4
- +
+ -
-
-
+
+
-1 1 -1
1 -1 1
-1 1 -1
1 -1 -1
-1 1 -1
-1 -1 1
4 -2
-2 4
+ -
- +
+
+
-
-
-4 2
2 -4
- +
+ -
-
-
+
+
1 -1 -1
-1 1 -1
-1 -1 1
-1 -1 1
-1 1 -1
1 -1 -1
2 -4
-4 2
+ -
- +
+
+
-
-
-2 4
4 -2
- +
+ -
-
-
+
+
-1 -1 1
-1 1 -1
1 -1 -1
Convolution Layer
Pooling Layer
Fully Connected Layer
1 -1 1
-1 1 -1
1 -1 1
-1 1 -1
1 -1 1
-1 1 -1
-1 -1 1
-1 1 -1
1 -1 -1
1 -1 -1
-1 1 -1
-1 -1 1
1 -1 -1 1
-1 1 1 -1
-1 1 1 -1
1 -1 -1 1
-1 -1 -1 -1
-1 1 1 -1
1 -1 -1 1
-1 -1 -1 -1
1 -1 1
-1 1 -1
1 -1 1
1 -1 -1 1
-1 1 1 -1
-1 1 -1
1 -1 1
-1 1 -1
-1 1 1 -1
1 -1 -1 1
-1 -1 1
-1 1 -1
1 -1 -1
-1 -1 -1 -1
-1 1 1 -1
1 -1 -1
-1 1 -1
-1 -1 1
1 -1 -1 1
-1 -1 -1 -1
+ - - +
- + + - X
- + + -
+ - - +
- - - -
- + + -
+ - - +
- - - -
O
/

Filters
1 -1 1
-1 1 -1
1 -1 1
1 -1 -1 1
-1 1 1 -1
+ - - +
- + + -
- + + -
+ - - +
- - - -
- + + -
+ - - +
- - - -
8X
O
/

-8
4
4
+1 +1 +1+1
+1 +1 +1+1
-1 1 -1
1 -1 1
-1 1 -1
-1 1 1 -1
1 -1 -1 1
+ - - +
- + + -
- + + -
+ - - +
- - - -
- + + -
+ - - +
- - - -
-8X
O
/

8
-4
-4
-1 -1 1
-1 1 -1
1 -1 -1
-1 -1 -1 -1
-1 1 1 -1
+ - - +
- + + -
- + + -
+ - - +
- - - -
- + + -
+ - - +
- - - -
4X
O
/

-4
8
0
1 -1 -1
-1 1 -1
-1 -1 1
1 -1 -1 1
-1 -1 -1 -1
+ - - +
- + + -
- + + -
+ - - +
- - - -
- + + -
+ - - +
- - - -
4X
O
/

-4
0
8
1 -1 1
-1 1 -1
1 -1 1
-1 1 -1
1 -1 1
-1 1 -1
-1 -1 1
-1 1 -1
1 -1 -1
1 -1 -1
-1 1 -1
-1 -1 1
X
O
/

Convolutional Neural Network
Convolution Layer
Pooling Layer
Fully Connected
Layer
+ -
- +
+ -
- +
+ -
- +
+ -
- +
- +
+ -
- +
+ -
- +
+ -
- +
+ -
+ - - +
- + + -
- + + -
+ - - +
- - - -
- + + -
+ - - +
- - - -
1 -1 -1 1
-1 1 1 -1
-1 1 1 -1
1 -1 -1 1
-1 -1 -1 -1
-1 1 1 -1
1 -1 -1 1
-1 -1 -1 -1
1 -1 1
-1 1 -1
1 -1 1
X
O
/

Convolution Layer Pooling Layer Fully Connected Layer
+ -
- +
+ -
- +
+ -
- +
+ -
- +
- +
+ -
- +
+ -
- +
+ -
- +
+ -
+ - - +
- + + -
- + + -
+ - - +
- - - -
- + + -
+ - - +
- - - -
1 -1 -1 1
-1 1 1 -1
1 -1 1
-1 1 -1
1 -1 1
X
O
/

Convolution Layer Pooling Layer Fully Connected Layer
8
-8
4
4
X O
Artificial Intelligence
?
Gradient Descent
X O
Lots of
errors
Few
errors
People Computer Alphabet
Advanced World
http://serrano.academy
https://www.linkedin.com/in/luisgserrano
https://www.youtube.com/c/LuisSerrano
Twitter: luis_likes_math
Subscribe, like, share, comment

Convolutional neural neworks