Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi...
Transcript of Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi...
![Page 1: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/1.jpg)
1© 2015 The MathWorks, Inc.
Demystifying Deep Learning
Mandar Gujrathi
![Page 2: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/2.jpg)
2
![Page 3: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/3.jpg)
3
Deep Learning Applications
Voice assistants (speech to text)
Teaching character to beat video game
Automatically colouring black-and-white images
![Page 4: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/4.jpg)
4
Why MATLAB for Deep Learning?
▪ MATLAB is Productive
▪ MATLAB is Fast
▪ MATLAB Integrates with Open Source
![Page 5: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/5.jpg)
5
What is Deep Learning?
![Page 6: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/6.jpg)
6
Deep Learning
Model learns to perform classification tasks directly from data.
x1000
x1000
x1000
x1000
x1000
Deep
Learning
Model
Image
Classifier
![Page 7: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/7.jpg)
7
Data Types for Deep Learning
Signal ImageText
![Page 8: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/8.jpg)
8
Deep Learning is Versatile
Iris Recognition – 99.4% accuracy2
Rain Detection and Removal1Detection of cars and road in autonomous driving systems
1. Deep Joint Rain Detection and Removal from a Single Image" Wenhan Yang,
Robby T. Tan, Jiashi Feng, Jiaying Liu, Zongming Guo, and Shuicheng Yan
2. Source: An experimental study of deep convolutional features for iris recognition
Signal Processing in Medicine and Biology Symposium (SPMB), 2016 IEEE
Shervin Minaee ; Amirali Abdolrashidiy ; Yao Wang; An experimental study of
deep convolutional features for iris recognition
![Page 9: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/9.jpg)
13
Deep Learning in 6 Lines of MATLAB Code
![Page 10: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/10.jpg)
14
Why MATLAB for Deep Learning?
▪ MATLAB is Productive
▪ MATLAB is Fast
▪ MATLAB integrates with Open Source
![Page 11: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/11.jpg)
15
“I love to label and
preprocess my data”
~ Said no engineer, ever.
![Page 12: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/12.jpg)
16
Caterpillar Case Study
▪ World’s leading manufacturer of
construction and mining
equipment.
▪ Similarity between these
projects?
– Autonomous haul trucks
– Pedestrian detection
– Equipment classification
– Terrain mapping
![Page 13: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/13.jpg)
17
Computer Must Learn from Lots of Data
▪ ALL data must first be labeled to create these autonomous systems.
“We were spending way too much time ground-truthing [the data]”
--Larry Mianzo, Caterpillar
![Page 14: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/14.jpg)
18
Semi-automated labelling
▪ Semi-automated labelling process
▪ Used MATLAB for entire development workflow.
– “Because everything is in MATLAB, development time is short”
![Page 15: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/15.jpg)
19
How Does MATLAB Come into Play?
![Page 16: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/16.jpg)
20
![Page 17: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/17.jpg)
21
![Page 18: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/18.jpg)
22
![Page 19: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/19.jpg)
23
MATLAB is Productive
▪ Image Labeler App semi-automates labeling workflow
▪ Bootstrapping
– Improve automatic labeling by updating algorithm as you label
more images correctly.
▪ Easy to load metadata even when labeling manually
![Page 20: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/20.jpg)
24
Why MATLAB for Deep Learning?
▪ MATLAB is Productive
▪ MATLAB is Fast
▪ MATLAB integrates with Open Source
![Page 21: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/21.jpg)
25
MATLAB is Fast
Performance
Training Deployment
![Page 22: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/22.jpg)
26
What is Training?Feed labeled data into neural network to create working model
Convolution
Neural
Network
Image
Classifier
Model
x1000
x1000
x1000
x1000
x1000
![Page 23: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/23.jpg)
28
Deep Learning in Finance
▪ Predict Trade Weighted US Dollar Index
![Page 24: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/24.jpg)
29
Another Network for Signals - LSTM
▪ LSTM = Long Short Term Memory (Networks)
– Signal, text, time-series data
– Use previous data to predict new information
▪ I live in France. I speak ___________.
c0 C1 Ct
![Page 25: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/25.jpg)
31
1. Prepare data
▪ Functionalities to:
– connect to FRED
servers
– databases
– Handle Big Data
– Perform out of memory
computations.
![Page 26: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/26.jpg)
33
2. Split data
Training Validation Test
70% 15% 15%
• Trains the model
• Computer “learns”
from this data
• Checks accuracy
of model during
training
• Tests model accuracy
• Not used until validation
accuracy is good
![Page 27: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/27.jpg)
35
3. Define Network architecture and parameters
![Page 28: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/28.jpg)
37
4. Train Network
![Page 29: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/29.jpg)
38
Deep Learning on CPU, GPU, Multi-GPU and Clusters
Single CPU
Single CPUSingle GPU
HOW TO TARGET?
Single CPU, Multiple GPUs
On-prem server with GPUs
Cloud GPUs(AWS)
![Page 30: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/30.jpg)
39
Training Performance
TensorFlow
MATLAB
MXNet
Batch size 32
Seconds / Epoch
![Page 31: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/31.jpg)
41
MATLAB is Fast for Deployment
▪ Target a GPU for optimal
performance
▪ NVIDIA GPUs use CUDA
code
▪ We only have MATLAB code.
Can we translate this?
![Page 32: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/32.jpg)
42
GPU Coder
▪ Automatically generates CUDA Code from MATLAB Code
– can be used on NVIDIA GPUs
▪ CUDA extends C/C++ code with constructs for parallel computing
![Page 33: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/33.jpg)
43
GPU Coder Performance
![Page 34: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/34.jpg)
44
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
![Page 35: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/35.jpg)
45
Why MATLAB?
▪ MATLAB is Productive
▪ MATLAB is Fast
▪ MATLAB Integrates workflows
![Page 36: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/36.jpg)
46
Used MATLAB and Open Source Together
1. Deep Joint Rain Detection and Removal from a Single
Image" Wenhan Yang, Robby T. Tan, Jiashi Feng,
Jiaying Liu, Zongming Guo, and Shuicheng Yan
▪ Used Caffe and MATLAB
together
▪ Achieved significantly
better results than an
engineered rain model.
▪ Use our tools where it
makes your workflow
easier!
![Page 37: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/37.jpg)
47
MATLAB Integrates Workflows
▪ Access to many pretrained models through add-ons
▪ Users wanted to import latest models
▪ Import models directly from TensorFlow or Caffe
– Allows for improved collaboration
![Page 38: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/38.jpg)
48
Keras-Tensorflow Importer
![Page 39: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/39.jpg)
49
MATLAB Integrates Workflows
▪ MATLAB supports entire deep learning workflow
– Use when it is convenient for your workflow
▪ Access to latest models
▪ Improved collaboration with other users
![Page 40: Demystifying Deep Learning - MathWorks · Demystifying Deep Learning Mandar Gujrathi Mandar.Gujrathi@mathworks.com.au. 2. 3 ... Model learns to perform classification tasks directly](https://reader035.fdocuments.in/reader035/viewer/2022071101/5fd9bf036cc85e54355f4be0/html5/thumbnails/40.jpg)
50
Why MATLAB for Deep Learning?
▪ MATLAB is Productive
▪ MATLAB is Fast (Performance)
▪ MATLAB Integrates with Open Source
(Frameworks)