Deep Learning: Data Mining: Advanced Aspects
Deep Learning: Data Mining: Advanced Aspects
Deep Learning: Data Mining: Advanced Aspects
Siham Tabik
University of Granada
[email protected]
Fei-Fei Li & Andrej Karpathy & Justin Johnson Lecture 8 - 1 1 Feb 2016
Schedule
Deep Learning
February 13th February 14th February 20th
Deep Neural Networks. Tensorflow. Recurrent Neural
Networks.
• Convolutional Neural
Networks (CNNs) • Get familiar • Some theory
• Classification & • Build our first CNN • an example using
detection model tensorflow
• Two case studies • One case study
Logistics
• Forum for debates, …
https://github.com/SihamTabik/Patio_DL/issues
• Textbook “Deep Learning with Tensorflow”. Please, download the
pdf from PRADO.
Convolutional Neural Networks
Siham Tabik
University of Granada
[email protected]
Fei-Fei Li & Andrej Karpathy & Justin Johnson Lecture 8 - 1 1 Feb 2016
Outline
1. What are ANN and CNNs?
2. How do CNNs work?
Convolution layers, pooling layers, FC layers, gradient, Backpropagation
3. Transfer learning
4. Data augmentation
5. One case study of CNN-classification model
6. CNNs for Detection
7. Two case studies
Outline
1. What are ANN and CNNs?
2. How do CNNs work?
Convolution layers, pooling layers, FC layers, gradient, Backpropagation
3. Transfer learning
4. Data augmentation
5. One case study of CNN-classification model
6. CNNs for Detection
7. Two case studies
Artificial Neural Networks
Machine learning algorithms
Learn and predict on data
Artificial Neural Networks
... and others
Source:
http://www.asimovinstitute.org/neural-network-zoo/
By the way, what is image classification?
Classification Instance
Classification Object Detection
+ Localization Segmentation
Fei-Fei Li & Andrej Karpathy & Justin Johnson Lecture 8 - 8 1 Feb 2016
Convolutional Neural Networks
PASCAL Visual Object Classes Challenge (2005-2012)
0,3
Imagenet classification error
28,0%
26,0%
0,2
16,4%
0,1 11,7%
7,3% 6,7%
3,5% 5,1%
0,0 2,3%
2010 2011 2012 2013 2014 2015 2016 2017 Human
ILSVRC year Russakovsky et
al. arXiv, 2014
IMAGENET image classification challenge
Year 2012 2013 2014 2015 2016
AlexNet ZFnet GoogLeNet VGG ResNet Inception&ResNet
8 layers 8 layers 19 layers 22 layers 152 layers
4. Transfer learning
5. Data augmentation
6. One case study
7. CNNs for Detection
8. Two case studies
How CNNs work?
A two‐dimensional
array of pixels
CNN X or O
For example
CNN X
CNN O
Trickier cases
CNN X
CNN O
Deciding is hard
Deciding is hard
‐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 ‐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
What computers see
‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1
‐1 X ‐1 ‐1 ‐1 ‐1 X X ‐1
‐1 X X ‐1 ‐1 X X ‐1 ‐1
‐1 ‐1 X 1 ‐1 1 ‐1 ‐1 ‐1
‐1 ‐1 ‐1 ‐1 1 ‐1 ‐1 ‐1 ‐1
‐1 ‐1 ‐1 1 ‐1 1 X ‐1 ‐1
‐1 ‐1 X X ‐1 ‐1 X X ‐1
‐1 X X ‐1 ‐1 ‐1 ‐1 X ‐1
‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1
Computers are literal
‐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 ‐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
CNNs match pieces of the image
=
=
Features match pieces of the image
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 ‐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
Filtering: The math behind the match
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
Filtering: The math behind the match
Filtering: The math behind the match
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
Filtering: The math behind the match
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
Filtering: The math behind the match
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
Filtering: The math behind the match
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
Filtering: The math behind the match
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
Filtering: The math behind the match
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
Filtering: The math behind the match
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
Filtering: The math behind the match
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
Filtering: The math behind the match
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
Filtering: The math behind the match
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
Filtering: The math behind the match
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
Filtering: The math behind the match
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
Filtering: The math behind the match
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
Filtering: The math behind the match
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
Filtering: The math behind the match
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 55
‐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
Convolution: Trying every possible match
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 0.77 ‐0.11 0.11 0.33 0.55 ‐0.11 0.33
‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1
Convolution: Trying every possible match
=
‐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 ‐0.11 0.33 ‐0.77 1.00 ‐0.77 0.33 ‐0.11
‐1
‐1
‐1
‐1
‐1
‐1
‐1
1
1
‐1
‐1
1
‐1
‐1
‐1
‐1
‐1
‐1
‐1 1 ‐1 ‐0.11 0.33 ‐0.77 1.00 ‐0.77 0.33 ‐0.11
0.55 ‐0.11 0.11 ‐0.33 1.00 ‐0.11 0.11 0.55 0.33 1.00 0.11
‐0.11 0.11 ‐0.11 0.33 ‐0.11 1.00 ‐0.11
0.33 0.55 0.11 0.77
0.33 ‐0.11 0.55 0.33 0.11 ‐0.11 0.77
0.11 ‐0.55 0.55 ‐0.77 0.55 ‐0.55 0.11 0.55 0.55 0.55 0.11
‐0.55 0.55 ‐0.55 0.33 ‐0.55 0.55 ‐0.55
0.33 0.11 0.11 0.33
0.33 ‐0.55 0.11 ‐0.11 0.11 ‐0.55 0.33
0.11 ‐0.11 1.00 ‐0.33 0.11 ‐0.11 0.55 1.00 1.00 0.11 0.55
0.55 ‐0.11 0.11 ‐0.33 1.00 ‐0.11 0.11 0.55 0.33 1.00 0.11
‐0.11 0.11 ‐0.11 0.33 ‐0.11 1.00 ‐0.11
0.33 0.55 0.11 0.77
0.33 ‐0.11 0.55 0.33 0.11 ‐0.11 0.77
0.11 ‐0.55 0.55 ‐0.77 0.55 ‐0.55 0.11 0.55 0.55 0.55 0.11
0.11 ‐0.11 1.00 ‐0.33 0.11 ‐0.11 0.55 1.00 1.00 0.11 0.55
0.77 ‐0.11 0.11 0.33 0.55 ‐0.11 0.33 0.77 0 0.11 0.33 0.55 0 0.33
0.77 ‐0.11 0.11 0.33 0.55 ‐0.11 0.33 0.77 0 0.11 0.33 0.55 0 0.33
‐0.11 1.00 ‐0.11 0.33 ‐0.11 0.11 ‐0.11 0 1.00 0 0.33 0 0.11 0
0.11 ‐0.11 1.00 ‐0.33 0.11 ‐0.11 0.55 0.11 0 1.00 0 0.11 0 0.55
0.33 0.33 ‐0.33 0.55 ‐0.33 0.33 0.33 0.33 0.33 0 0.55 0 0.33 0.33
0.55 ‐0.11 0.11 ‐0.33 1.00 ‐0.11 0.11 0.55 0 0.11 0 1.00 0 0.11
‐0.11 0.11 ‐0.11 0.33 ‐0.11 1.00 ‐0.11 0 0.11 0 0.33 0 1.00 0
0.33 ‐0.11 0.55 0.33 0.11 ‐0.11 0.77 0.33 0 0.55 0.33 0.11 0 0.77
ReLU layer
0.33 0.33 ‐0.33 0.55 ‐0.33 0.33 0.33 0.33 0.33 0 0.55 0 0.33 0.33
0.55 ‐0.11 0.11 ‐0.33 1.00 ‐0.11 0.11 0.55 0 0.11 0 1.00 0 0.11
‐0.11 0.11 ‐0.11 0.33 ‐0.11 1.00 ‐0.11 0 0.11 0 0.33 0 1.00 0
0.33 ‐0.11 0.55 0.33 0.11 ‐0.11 0.77 0.33 0 0.55 0.33 0.11 0 0.77
0.33 ‐0.55 0.11 ‐0.11 0.11 ‐0.55 0.33 0.33 0 0.11 0 0.11 0 0.33
‐0.55 0.55 ‐0.55 0.33 ‐0.55 0.55 ‐0.55 0 0.55 0 0.33 0 0.55 0
0.11 ‐0.55 0.55 ‐0.77 0.55 ‐0.55 0.11 0.11 0 0.55 0 0.55 0 0.11
‐0.11 0.33 ‐0.77 1.00 ‐0.77 0.33 ‐0.11 0 0.33 0 1.00 0 0.33 0
0.11 ‐0.55 0.55 ‐0.77 0.55 ‐0.55 0.11 0.11 0 0.55 0 0.55 0 0.11
‐0.55 0.55 ‐0.55 0.33 ‐0.55 0.55 ‐0.55 0 0.55 0 0.33 0 0.55 0
0.33 ‐0.55 0.11 ‐0.11 0.11 ‐0.55 0.33 0.33 0 0.11 0 0.11 0 0.33
0.33 ‐0.11 0.55 0.33 0.11 ‐0.11 0.77 0.33 0 0.55 0.33 0.11 0 0.77
‐0.11 0.11 ‐0.11 0.33 ‐0.11 1.00 ‐0.11 0 0.11 0 0.33 0 1.00 0
0.55 ‐0.11 0.11 ‐0.33 1.00 ‐0.11 0.11 0.55 0 0.11 0 1.00 0 0.11
0.33 0.33 ‐0.33 0.55 ‐0.33 0.33 0.33 0.33 0.33 0 0.55 0 0.33 0.33
0.11 ‐0.11 1.00 ‐0.33 0.11 ‐0.11 0.55 0.11 0 1.00 0 0.11 0 0.55
‐0.11 1.00 ‐0.11 0.33 ‐0.11 0.11 ‐0.11 0 1.00 0 0.33 0 0.11 0
0.77 ‐0.11 0.11 0.33 0.55 ‐0.11 0.33 0.77 0 0.11 0.33 0.55 0 0.33
Layers get stacked
‐1 ‐1 1 ‐1 ‐1 ‐1 1 ‐1 ‐1
0.55 0.33 0.55 0.33
‐1 ‐1 ‐1 1 ‐1 1 ‐1 ‐1 ‐1
0.33 1.00 0.55 0.11
‐1 ‐1 ‐1 ‐1 1 ‐1 ‐1 ‐1 ‐1
0.55 0.55 0.55 0.11
‐1 ‐1 ‐1 1 ‐1 1 ‐1 ‐1 ‐1
0.33 0.11 0.11 0.33
‐1 ‐1 1 ‐1 ‐1 ‐1 1 ‐1 ‐1
‐1 1 ‐1 ‐1 ‐1 ‐1 ‐1 1 ‐1 0.33 0.55 1.00 0.77
1.00 0.55
‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1 0.55 1.00
‐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.00 0.55
‐1 ‐1 ‐1 ‐1 1 ‐1 ‐1 ‐1 ‐1
0.55 0.55
‐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 0.55 1.00
‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1
1.00 0.55
Fully connected layer
1.00
0.55
1.00
0.55
0.55 1.00
0.55
1.00 0.55
1.00
1.00
0.55
Fully connected layer
1.00
0.55
0.55
1.00
1.00
X
0.55
0.55
O
0.55
0.55
1.00
1.00
0.55
Fully connected layer
0.55
1.00
1.00
0.55
0.55
X
0.55
0.55
O
0.55
1.00
0.55
0.55
1.00
Fully connected layer
0.9
0.65
0.45
0.87
0.96
X
0.73
0.23
O
0.63
0.44
0.89
0.94
0.53
Fully connected layer
0.9
0.65
0.45
0.87
0.96
X
0.73
0.23
O
0.63
0.44
0.89
0.94
0.53
Fully connected layer
0.9
0.65
0.45
0.87
0.96
X
0.73
0.23
O
0.63
0.44
0.89
0.94
0.53
Putting it all together
‐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
‐1 ‐1 ‐1 1 ‐1 1 ‐1 ‐1 ‐1
‐1 ‐1 1 ‐1 ‐1 ‐1 1 ‐1 ‐1
O
‐1 1 ‐1 ‐1 ‐1 ‐1 ‐1 1 ‐1
‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1
Learning
Backpropagation
Wi
‐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
Backpropagation
Wi
Forward pass
W1 W2 W3 W4 W5
‐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
actual answer
‐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
Backpropagation
Wi
Forward pass
W1 W2 W3 W4 W5
‐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
actual answer
‐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
Backpropagation
Wi X
Forward pass
W1 W2 W3 W4 W5
Error= right answer –
‐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
actual answer
‐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
Backpropagation
Wi X
Forward pass
W1 W2 W3 W4 W5
Error= right answer –
‐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
actual answer
‐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 2 5
Back pass
Gradient descent
error
weight
Gradient descent
error
weight
Limitations
Practical solutions
Outline
1. What are ANN?
2. What are CNNs?
3. How do CNNs work?
Convolution layers, pooling layers, FC layers, Backpropagation
4. Transfer learning
5. Data augmentation
6. One case study
7. CNNs for Detection
8. Two case studies
Transfer Learning
Given a new problem & new data
Instead of training from scratch, train only the last layers
‐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
‐1 ‐1 ‐1 1 ‐1 1 ‐1 ‐1 ‐1
‐1 ‐1 1 ‐1 ‐1 ‐1 1 ‐1 ‐1
O
‐1 1 ‐1 ‐1 ‐1 ‐1 ‐1 1 ‐1
‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1
Outline
1. What are ANN?
2. What are CNNs?
3. How CNNs work?
Convolution layers, pooling layers, FC layers, Backpropagation
4. Transfer learning
5. Data augmentation
6. Three case studies
Data augmentation
Increase the training dataset volume artificially using transformations
Objective: Improve model robustness
Original : Scaling Centring translation rotation …. etc
Outline
1. What are ANN?
2. What are CNNs?
3. How CNNs work?
Convolution layers, pooling layers, FC layers, Backpropagation
4. Transfer learning
5. Data augmentation
6. One case study
7. CNNs for Detection
8. Two case studies
Case study 1: Data-augumentation for CNNs using MNIST
A snapshot of image pre-processing for convolutional neural networks: case study of MNIST S Tabik, D Peralta, A
Herrera-Poyatos, F Herrera. International Journal of Computational Intelligence Systems 10, 555–568
Case study 1: Data-augumentation for CNNs using MNIST
Data-augmentation techniques
Three Lenet like CNNs:
1. LeNet: 2 Conv + 2FC(ReLU)
2. Network3: 2 Conv + 3FC (ReLU+Dropout)
3. DropConnect: 2 Conv + 2FC (ReLU+Dropconnect)
Case study 1: Data-augumentation for CNNs using MNIST
Test-set accuracies ( )
Case study 1: Data-augumentation for CNNs using MNIST
Test-set accuracies
Case study 1: Data-augumentation for CNNs using MNIST
Test-set accuracies
Case study 1: Data-augumentation for CNNs using MNIST
Error : 0.28% versus state of the art ensemble 0.23%
Case study 1: Data-augumentation for CNNs using MNIST
Object Detection
CAT? NO
DOG? NO
Fei-Fei Li & Andrej Karpathy & Justin Johnson Lecture 8 - 41 1 Feb 2016
Detection as Classification
CAT? YES!
DOG? NO
Fei-Fei Li & Andrej Karpathy & Justin Johnson Lecture 8 - 42 1 Feb 2016
Detection as Classification
CAT? NO
DOG? NO
Fei-Fei Li & Andrej Karpathy & Justin Johnson Lecture 8 - 48 1 Feb 2016
Region Proposals
● Find “blobby” image regions that are likely to contain objects
● “Class-agnostic” object detector
● Look for “blob-like” regions
Fei-Fei Li & Andrej Karpathy & Justin Johnson Lecture 8 - 49 1 Feb 2016
1 Feb 2016
R-CNN (RP+CNN)
The first CNN based detection model was R-CNN
Combines: VGG and Region Proposals
Boosted the object detection challenge by almost 50%.
Girshick, Ross, et al. "Rich feature hierarchies for accurate object detection
and semantic segmentation." 2014.
Fei-Fei Li & Andrej Karpathy & Justin Johnson Lecture 8 - 53 1 Feb 2016
Fast R-CNN and Faster R-CNN
Deep-Learning Convolutional Neural Networks for scattered shrub detection with Google Earth Imagery E Guirado,
S Tabik, D Alcaraz-Segura, J Cabello, F Herrera. Remote Sensing 9(12): 1220 (2017)
Case study 2: Protected plant species detection using Google-earth imagery
Design new database to train CNNs
Case study 2: Protected plant species detection using Google-earth imagery
• Database for training
the CNNs
• A two‐class problem
Case study 2: Protected plant species detection using Google-earth imagery
Case study 2: Protected plant species detection using Google-earth imagery
Preprocessing:
(Pixel value<100)
Case study 2: Protected plant species detection using Google-earth imagery
• Results
(GoogLeNet+sliding
window)
• It takes: 291 min
Case study 2: Protected plant species detection using Google-earth imagery
Results: OBIA(12 hours) vs CNNs(35.4seconds)
Precision Recall F1
Precision Recall F1