developing deep using matlab · using matlab david willingham. 2 new matlab framework makes deep...

37
1 © 2015 The MathWorks, Inc. Developing Deep Learning Algorithms using MATLAB David Willingham

Upload: others

Post on 22-Mar-2020

20 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

1© 2015 The MathWorks, Inc.

Developing Deep

Learning Algorithms

using MATLAB

David Willingham

Page 2: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

2

New MATLAB framework makes deep learning

easy and accessible

Page 3: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

3

Object Recognition using Deep Learning

Training

(using GPU)Millions of images from 1000 different categories

Prediction Real-time object recognition using a webcam connected to a

laptop

ACCESS

LEARN

INTEGRATE

Page 4: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

5

Cat

Dog

Bird

Car

Learned Features

CarDogCatBird

What is Deep Learning ?

Deep learning is a type of machine learning that learns tasks

directly from data

Page 5: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

6

Cat

Dog

Bird

Car

Learned Features

CarDogCatBird

TaskData

What is Deep Learning ?

Page 6: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

7

Why is Deep Learning So Popular Now?

Source: ILSVRC Top-5 Error on ImageNet

Human

Accuracy

Page 7: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

8

Deep Learning Enablers

Massive sets of labeled data

Acceleration with GPUs

Availability of state of the art models from experts

Page 8: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

9

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

Page 9: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

10

Agenda

Image classification using pre-trained network

Transfer learning to classify new objects

Locate & classify objects in images and video

Page 10: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

11

Agenda

Image classification using pre-trained network

Transfer learning to classify new objects

Locate & classify objects in images and video

Page 11: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

12

Image Classification Using Pre-trained Network (Video)

Page 12: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

13

Convolutional Neural Networks

Page 13: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

15

Visualize Deep Learning Features

Page 14: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

16

Agenda

Image classification using pre-trained network

Locate & classify objects in images and video

Transfer learning to classify new objects

Page 15: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

17

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

Page 16: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

18

Two Approaches for Deep Learning

2. Fine-tune a pre-trained model (transfer learning)

1. Train a Deep Neural Network from Scratch

Page 17: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

19

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

Page 18: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

20

Example: Classify Vehicles With Transfer Learning

New Data

Po

oli

ng

Co

nvo

luti

on

Ac

tiva

tio

n

Po

oli

ng

Co

nvo

luti

on

Ac

tiva

tio

n

Po

oli

ng

Co

nvo

luti

on

Ac

tiva

tio

n

Po

oli

ng

Co

nvo

luti

on

Ac

tiva

tio

n

Fu

lly

Co

nn

ec

ted

Layers

1000 Category

Classifier

5 Category

Classifier

AlexNet

AlexNet

car

suv

pickup

van

truck

Page 19: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

21

Transfer Learning to Classify New Objects

Page 20: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

22

New MATLAB framework makes deep learning

easy and accessible

Page 21: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

23

MATLAB makes Deep Learning Easy and Accessible

imageDS = imageDatastore(dir)

Easily manage large sets of images

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

Page 22: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

24

MATLAB makes Deep Learning Easy and Accessible

Acceleration with Multiple GPUs

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

Training modes supported:

Auto Select

GPU

Multi GPU (local)

Multi GPU (cluster)

Page 23: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

25

MATLAB makes Deep Learning Easy and Accessible

Feature Visualization

Training Accuracy Plot

Network ActivationsDeep Dream

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

Page 24: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

26

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 expertsCurated Set of Pretrained Models

Access Models with 1-line of MATLAB CodeNet1 = alexnet

Net2 = vgg16

Net3 = vgg19

Page 25: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

27

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:

Page 26: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

28

Agenda

Image classification using pre-trained network

Transfer learning to classify new objects

Locate & classify objects in images and video

Page 27: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

29

Is Object Recognition/Classification Enough ?

Car Label for entire image

Car ? SUV? Truck?

Page 28: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

30

Object Detection – Locate and Classify Object

TRUCK

SUV

CAR

Page 29: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

31

Goal: Create Object Detector to Locate Vehicles

Step 1: Label / Crop data

Step 2: Train detector

Step 3: Use detector

Page 30: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

32

Video: Object Detection using Faster R-CNN

Page 31: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

33

Label Images with MATLAB

Page 32: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

34

Labeling Videos with MATLAB

Page 33: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

35

New MATLAB framework makes deep learning

easy and accessible

Page 34: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

36

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

Image Labeler

Video Labeler

Page 35: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

39

Object Detection Frameworks in MATLAB

Machine Learning

1. Cascade Object Detector

2. Aggregate Channel Features (ACF)

Deep Learning

1. R-CNN

2. Fast R-CNN

3. Faster R-CNN

Same labels , train any detector.

Page 36: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

40

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

Page 37: Developing Deep using MATLAB · using MATLAB David Willingham. 2 New MATLAB framework makes deep learning easy and accessible. 3 Object Recognition using Deep Learning Training (using

41

Thank You