Understanding the Drawbacks of Using
Deep Neural Networks with Images
Janani Ravi
CO-FOUNDER, LOONYCORN
www.loonycorn.com
Overview Deep Neural Networks (DNNs) for
image classification
Drawbacks of using DNNs for image
classification
Implementing a fully-connected neural
network for image classification
Deep Neural Networks for Image Classification
Deep Learning and Neural Networks
Deep Learning Neural Networks Neurons
The most common class
Algorithms that learn Simple building blocks
of deep learning
what features matter that actually “learn”
algorithms
“Deep Learning”-based Binary Classifier
Object Parts
Corners
Edges
Pixels
Corpus of Feature Selection & ML-based Classifier
Images Classification Algorithm
“Deep Learning”-based Binary Classifier
Object Parts
Corners
Edges
Pixels
Corpus of “Visible “Visible ML-based Classifier
Images layer” layer”
“Deep Learning”-based Binary Classifier
Object Parts
Corners
Edges
Pixels
Corpus of “Hidden ML-based Classifier
Images Layers”
Neural Networks
Layer 2
Layer 1
Layer N
…
Corpus of Layers in a neural network ML-based Classifier
Images
Neural Networks
Pixels Processed groups of pixels
Corpus of Each layer consists of individual ML-based Classifier
Images interconnected neurons
The Computational Graph
Pixels Processed groups of pixels
Corpus of Operations (nodes) on ML-based Classifier
Images data (edges)
The Computational Graph
Pixels Processed groups of pixels
Corpus of The nodes in the computation graph are ML-based Classifier
Images
neurons (simple building blocks)
The Computational Graph
Pixels Processed groups of pixels
Corpus of ML-based Classifier
Images
The edges in the computation graph
are data items called tensors
Neural Networks
Pixels Processed groups of pixels
Corpus of Each layer consists of individual ML-based Classifier
Images interconnected neurons
Neural Networks for Image Classification
Layer 2
Layer 1
Layer N
…
Corpus of Layers in a neural network ML-based Classifier
Images
Neural Networks for Image Classification
Pixels Processed groups of pixels
Corpus of Each layer consists of individual ML-based Classifier
Images interconnected neurons
Parameter Explosion
Consider a 100 x 100 pixel image
(10,000 pixels)
If first layer = 10,000 neurons
Interconnections ~ O(10,000 * 10,000)
100 million parameters to train neural
network!
Parameter Explosion
Dense, fully connected neural networks
can’t cope
Also do not provide feature extraction
with location invariance
Convolutional neural networks to the
rescue
Deep neural networks do
not consider the spatial
aspects of images
CNNs Introduced
Eye perceives visual stimulus in 2D
visual field
“Local receptive field”
Eye sends 2D image to visual cortex
CNNs Introduced
Visual cortex adds depth perception
Individual neurons in cortex focus on
small field
CNNs Introduced
CNNs perform spectacularly well at
many tasks
Particularly at image recognition
Dramatically fewer parameters than
DNN with similar performance
Inspirations for CNNs
Two Dimensions Local Receptive Fields
Data comes in expressed Neurons focus on narrow
in 2D portions
CNN Layers
Convolution layers - zoom in on specific
bits of input
Successive layers aggregate inputs into
higher level features
Pixels >> Lines >> Edges >> Object
MNIST Dataset
Handwritten digits database
Large quantity of handwritten digits
commonly used for training image
processing systems
MNIST Dataset
Each digit is in grayscale
MNIST Dataset
Every image is standardized
to be of size 28x28
= 784 pixels
MNIST Dataset
Every pixel holds a single value for intensity
MNIST Dataset
0 0 0 0 0 0
0.2 0.8 0 0.3 0.6 0
0.2 0.9 0 0.3 0.8 0
0.3 0.8 0.7 0.8 0.9 0
0 0 0 0.2 0.8 0
0 0 0 0.2 0.2 0
MNIST Dataset
0 0 0 0 0 0
0.2 0.8 0 0.3 0.6 0
0.2 0.9 0 0.3 0.8 0
0.3 0.8 0.7 0.8 0.9 0
0 0 0 0.2 0.8 0
0 0 0 0.2 0.2 0
MNIST Dataset
0 0 0 0 0 0
0.2 0.8 0 0.3 0.6 0
0.2 0.9 0 0.3 0.8 0
0.3 0.8 0.7 0.8 0.9 0
0 0 0 0.2 0.8 0
0 0 0 0.2 0.2 0
MNIST Dataset
0 0 0 0 0 0
0.2 0.8 0 0.3 0.6 0
0.2 0.9 0 0.3 0.8 0
0.3 0.8 0.7 0.8 0.9 0
0 0 0 0.2 0.8 0
0 0 0 0.2 0.2 0
MNIST Dataset
Every image has an associated label
MNIST Dataset
5 0 4 1
Demo
Implement image classification using a
deep, fully-connected neural network
Summary Deep Neural Networks (DNNs) for
image classification
Drawbacks of using DNNs for image
classification
Implementing a fully-connected neural
network for image classification