+ All Categories
Home > Documents > Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation...

Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation...

Date post: 03-Aug-2020
Category:
Upload: others
View: 4 times
Download: 0 times
Share this document with a friend
36
1 © 2018 The MathWorks, Inc. Deep Learning in MATLAB: A Brief Overview Brett Shoelson, PhD Principal Application Engineer
Transcript
Page 1: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

1© 2018 The MathWorks, Inc.

Deep Learning in MATLAB:A Brief Overview

Brett Shoelson, PhD Principal Application Engineer

Page 2: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

2

What is can Deep Learning do for us?(An example)

Page 3: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

3

Example 1: Object recognition using deep learning

Page 4: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

4

Object recognition using deep learning

Training (GPU)

Millions of images from 1000

different categories

PredictionReal-time object recognition using

a webcam connected to a laptop

Page 5: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

5

What is Machine Learning?What is Deep Learning?

Page 6: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

6

Machine Learning vs Deep Learning

Machine Learning

We specify the nature

of the features we want

to extract… …and the type of model

we want to build.

Page 7: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

7

Deep Learning

Machine Learning vs Deep Learning

We need only specify

the architecture of the

model…

Page 8: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

8

▪ Deep learning is a type of machine learning in which a model learns to perform tasks like classification – directly from images, texts, or signals.

▪ Deep learning performs end-to-end learning, and is usually implemented using a neural network architecture.

▪ Deep learning algorithms also scale with data – traditional machine

learning saturates.

Page 9: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

9

Why is Deep Learning So Popular Now?

Source: ILSVRC Top-5 Error on ImageNet

Human

Accuracy

AlexNet

Page 10: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

10

Two Approaches for Deep Learning

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

1. Train a Deep Neural Network from Scratch

Page 11: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

11

Pains In Deep Learning

Expertise Time to Train Data

Page 12: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

12

Example: Vehicle recognition using deep transfer learning

5 Category

Classifier

Cars

Trucks

SUVs

Big Trucks

Vans

Page 13: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

13

Import the Latest Models for Transfer Learning

Pretrained Models*

▪ AlexNet

▪ VGG-16

▪ VGG-19

▪ GoogLeNet

▪ Inception-v3

▪ ResNet50

▪ ResNet-101

▪ Inception-resnet-v2

▪ SqueezeNet

▪ MobileNet(coming soon)

* single line of code to access model

Import Models from Frameworks

▪ Caffe Model Importer

▪ TensorFlow-Keras Model Importer

▪ Onnx - Importer/ Exporter (Coming Soon)

AlexNetPRETRAINED

MODEL

CaffeI M P O R T E R

ResNet-50PRETRAINED MODEL

TensorFlow-

KerasI M P O R T E R

VGG-16PRETRAINED

MODEL

GoogLeNet PRETRAINED

MODEL

ResNet-101PRETRAINED MODEL

Inception-v3M O D E L S

Page 14: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

14

Detection and localization using deep learning

Regions with Convolutional Neural Network Features (R-CNN)

Page 15: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

15

What is semantic segmentation?

Page 16: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

16

Original Image

ROI detection

Pixel classification

Localization using deep learning

Page 17: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

17

Semantic Segmentation Network

Boat

Airplane

Other classes

Page 18: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

18

Semantic Segmentation Network

Page 19: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

19

Semantic Segmentation Demo

CamVid Dataset1. Segmentation and Recognition Using Structure from Motion Point Clouds, ECCV 2008

2. Semantic Object Classes in Video: A High-Definition Ground Truth Database ,Pattern Recognition Letters

Page 20: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

20

Semantic Segmentation

CamVid Dataset1. Segmentation and Recognition Using Structure from Motion Point Clouds, ECCV 2008

2. Semantic Object Classes in Video: A High-Definition Ground Truth Database ,Pattern Recognition Letters

Page 21: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

21

“I love to label and

preprocess my data”

~ Said no engineer, ever.

Page 22: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

22

Data

Ground truth Labeling

“How do I label

my data?”

New App for

Ground Truth

Labeling

Label pixels

and regions for

semantic

segmentation

Page 23: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

23

Attributes and Sublabels NEW in

Page 24: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

24

Types of Datasets

Numeric

Data

Time Series/

Text Data

Image

Data

ML or LSTMLSTM or CNN

CNN

Page 25: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

25

Analyzing signal data using deep learning

Signal Classification using LSTMs Speech Recognition using CNNs

Page 26: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

26

Deep learning features overview

▪ Classification

▪ Regression

▪ Semantic segmentation

▪ Object detection

▪ Scalability – Multiple GPUs

– Cluster or cloud

▪ Custom network layers

▪ Import models – Caffe

– Keras/TensorFlow

▪ Data augmentation

▪ Hyperparameter tuning – Bayesian optimization

▪ Python MATLAB interface

▪ LSTM networks – Time series, signals, audio

▪ Custom labeling – API for ground-truth labeling

automation

– Superpixels

▪ Data validation – Training and testing

Page 27: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

27

Prediction Performance: Fast with GPU Coder

Why is GPU Coder so fast?

– Analyzes and optimizes

network architecture

– Invested 15 years in code

generation

AlexNet ResNet-50 VGG-16

TensorFlow

MATLAB

MXNet

GPU Coder

Images/Sec

Using CUDA v9

and cuDNN v7

Page 28: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

28

Overview of deep learning deployment options

“How do I deploy

my model?”

Deploy / Share

▪ Create Desktop Apps

▪ Run Enterprise Solution

▪ Generate C and C++ Code

GPU Coder

▪ Target GPUs

Introducing:

GPU Coder-

Convert to

NVIDIA CUDA

code

▪ Generate C and C++ Code

Page 29: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

29

GPU Coder Fills a Gap in Our Deep Learning Solution

Access Data Preprocess Select Network Train

Image Acq.Image

Processing

Computer

Vision

Neural

NetworkPCT

GPU

Coder

Deploy

InferenceTraining

Page 30: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

30

Deploying to CPUs

GPU

Coder

Deep Learning

Networks

NVIDIA

TensorRT &

cuDNN

Libraries

ARM

Compute

Library

Intel

MKL-DNN

Library

Page 31: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

31

MATLAB products for deep learning

▪ Neural Network Toolbox

▪ Parallel Computing Toolbox

▪ Image Processing Toolbox

▪ Computer Vision System Toolbox

▪ Statistics and Machine Learning Toolbox

▪ MATLAB Coder

▪ GPU Coder

▪ Automated Driving System Toolbox

Required products Recommended products

Page 32: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

32

Deep learning features overview

▪ Classification

▪ Regression *

▪ Semantic segmentation

▪ Object detection *

▪ Scalability *– Multiple GPUs

– Cluster or cloud

▪ Custom network layers *

▪ Import models *– Caffe

– Keras/TensorFlow

▪ Data augmentation *

▪ Hyperparameter tuning *– Bayesian optimization

▪ Python MATLAB interface *

▪ LSTM networks *– Time series, signals, audio

▪ Custom labeling *– API for ground-truth labeling

automation

– Superpixels

▪ Data validation *– Training and testing

* We can cover in more detail outside this presentation

Page 33: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

33

Thank you!

Page 34: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

34

Deep learning in

automated driving…

Page 35: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

35

Deep Learning Onramp

▪ Get started using deep learning

methods to perform image recognition.

▪ Free access for everyone

▪ Interactive exercises and short video

demonstrations

▪ Work on real-life image recognition

problems

▪ Topics include:

– Convolutional neural networks

– Working with pre-trained networks

– Transfer learning

– Evaluating network performance

Page 36: Deep Learning in MATLAB - MathWorks · network architecture –Invested 15 years in code generation AlexNet ResNet-50 VGG-16 TensorFlow MATLAB MXNet GPU Coder Images/Sec Using CUDA

36

Convolutional Neural Networks (CNN)

ObjectsShapes

Edges


Recommended