Developing Deep
Learning Algorithms
using MATLAB
David Willingham
© 2015 The MathWorks, Inc.
1
New MATLAB framework makes deep learning
easy and accessible
2
Object Recognition using Deep Learning
ACCESS
LEARN
INTEGRATE
Training Millions of images from 1000 different categories
(using GPU)
Prediction Real-time object recognition using a webcam connected to a
laptop
3
What is Deep Learning ?
Cat
Deep learning is a type of machine learning that learns tasks
directly from data
Dog
Learned Features Car
Dog
Bird
… Cat
Bird
Car
5
What is Deep Learning ?
Cat
Dog
Learned Features Car
Dog
Bird
… Cat
Bird
Data Task
Car
6
Why is Deep Learning So Popular Now?
Human
Accuracy
Source: ILSVRC Top-5 Error on ImageNet 7
Deep Learning Enablers
Acceleration with GPUs
Massive sets of labeled data
Availability of state of the art models from experts
8
MATLAB makes Deep Learning Easy and Accessible
Learn about new MATLAB capabilities to
Handle and label large sets of images
Accelerate deep learning with GPUs
Visualize and debug deep neural networks
Access and use models from experts
9
Agenda
Image classification using pre-trained network
Transfer learning to classify new objects
Locate & classify objects in images and video
10
Agenda
Image classification using pre-trained network
Transfer learning to classify new objects
Locate & classify objects in images and video
11
Image Classification Using Pre-trained Network (Video)
12
Convolutional Neural Networks
13
Visualize Deep Learning Features
15
Agenda
Image classification using pre-trained network
Transfer learning to classify new objects
Locate & classify objects in images and video
16
Why Train a New Model ?
o Models from research do not work on your data
o Pre-trained model not available for your data type
o Improve results by creating a model specific to your problem
17
Two Approaches for Deep Learning
1. Train a Deep Neural Network from Scratch
2. Fine-tune a pre-trained model (transfer learning)
18
Why Perform Transfer Learning
Requires less data and training time
Reference models (like AlexNet, VGG-16, VGG-19) are great feature
extractors
Leverage best network types from top researchers
19
Example: Classify Vehicles With Transfer Learning
Convolution
Convolution
Convolution
Convolution
Connected
Activation
Activation
Activation
Activation
Pooling
Pooling
Pooling
Pooling
Layers
Fully
… 1000 Category
Classifier
AlexNet
car
suv
5 Category
AlexNet pickup Classifier
van
truck
New Data 20
Transfer Learning to Classify New Objects
21
New MATLAB framework makes deep learning
easy and accessible
22
MATLAB makes Deep Learning Easy and Accessible
Learn about new MATLAB capabilities to
imageDS = imageDatastore(dir)
Easily manage large sets of images
Handle and label large sets of images
Accelerate deep learning with GPUs
Visualize and debug deep neural networks
Access and use models from experts
23
MATLAB makes Deep Learning Easy and Accessible
Training modes supported:
Learn about new MATLAB capabilities to
Auto Select
GPU
Handle and label large sets of images Multi GPU (local)
Multi GPU (cluster)
Accelerate deep learning with GPUs
Visualize and debug deep neural networks
Access and use models from experts
Acceleration with Multiple GPUs
24
MATLAB makes Deep Learning Easy and Accessible
Learn about new MATLAB capabilities to
Training Accuracy Plot
Handle and label large sets of images
Accelerate deep learning with GPUs
Visualize and debug deep neural networks Deep Dream Network Activations
Access and use models from experts
25
Feature Visualization
MATLAB makes Deep Learning Easy and Accessible
Learn about new MATLAB capabilities to
Handle and label large sets of images
Accelerate deep learning with GPUs
Visualize and debug deep neural networks
Curated Set of Pretrained Models
Access and use models from experts
Access Models with 1-line of MATLAB Code
Net1 = alexnet
Net2 = vgg16
Net3 = vgg19
26
Regression Support for Deep Learning
Classification vs. Regression
Classification – outputs categories/labels
Regression – outputs numbers
Supported by new regression layer:
routputlayer = regressionLayer('Name','routput')
Example predict facial key-points:
27
Agenda
Image classification using pre-trained network
Transfer learning to classify new objects
Locate & classify objects in images and video
28
Is Object Recognition/Classification Enough ?
Car Label for entire image
Car ? SUV? Truck?
29
Object Detection – Locate and Classify Object
TRUCK CAR
SUV
30
Goal: Create Object Detector to Locate Vehicles
Step 1: Label / Crop data
Step 2: Train detector
Step 3: Use detector
31
Video: Object Detection using Faster R-CNN
32
Label Images with MATLAB
33
Labeling Videos with MATLAB
34
New MATLAB framework makes deep learning
easy and accessible
35
MATLAB makes Deep Learning Easy and Accessible
Learn about new MATLAB capabilities to
Handle and label large sets of images
Accelerate deep learning with GPUs
Image Labeler
Visualize and debug deep neural networks
Access and use models from experts
Video Labeler 36
Object Detection Frameworks in MATLAB
Machine Learning
1. Cascade Object Detector
2. Aggregate Channel Features (ACF)
Same labels , train any detector.
Deep Learning
1. R-CNN
2. Fast R-CNN
3. Faster R-CNN
39
MATLAB makes Deep Learning Easy and Accessible
Learn about new MATLAB capabilities to
Handle and label large sets of images
Accelerate deep learning with GPUs
Visualize and debug deep neural networks
Access and use models from experts
40
Thank You
41