Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on...
Transcript of Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on...
![Page 1: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/1.jpg)
1© 2015 The MathWorks, Inc.
Demystifying Deep Learning
Dr. Amod Anandkumar
Senior Team Lead – Signal Processing & Communications
![Page 2: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/2.jpg)
2
What is Deep Learning?
![Page 3: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/3.jpg)
3
Deep learning is a type of machine learning in which a model learns
to perform classification tasks directly from images, text, or sound.
Deep learning is usually implemented using a neural network.
The term “deep” refers to the number of layers in the network—the
more layers, the deeper the network.
![Page 4: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/4.jpg)
4
Deep Learning is Versatile MATLAB Examples Available Here
![Page 5: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/5.jpg)
5
Directed Acyclic Graph Network
ResNet
R-CNN
Many Network Architectures for Deep Learning
Series Network
AlexNet
YOLO
Recurrent Network
LSTM
and more
(GAN, DQN,…)
![Page 6: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/6.jpg)
6
Convolutional Neural Networks
Convolution +
ReLU PoolingInput
Convolution +
ReLU Pooling
… …
Flatten Fully
ConnectedSoftmax
dog
…
cat
… …
Feature Learning Classification
cake ✓
![Page 7: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/7.jpg)
7
Deep Learning Inference in 4 Lines of Code
• >> net = alexnet;
• >> I = imread('peacock.jpg')
• >> I1 = imresize(I,[227 227]);
• >> classify(net,I1)
• ans =
• categorical
• peacock
![Page 8: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/8.jpg)
8
What is Training?
Labels
Network
Training
Images
Trained Deep
Neural Network
During training, neural network architectures learn features directly
from the data without the need for manual feature extraction
Large Data Set
![Page 9: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/9.jpg)
9
What Happens During Training?AlexNet Example
Layer weights are learned
during training
Training Data Labels
![Page 10: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/10.jpg)
10
Visualize Network Weights During TrainingAlexNet Example
Training Data LabelsFirst Convolution
Layer
![Page 11: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/11.jpg)
11
Visualization Technique – Deep Dream
deepDreamImage(...
net, 'fc5', channel,
'NumIterations', 50, ...
'PyramidLevels', 4,...
'PyramidScale', 1.25);
Synthesizes images that strongly activate
a channel in a particular layer
Example Available Here
![Page 12: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/12.jpg)
12
Visualize Features Learned During TrainingAlexNet Example
Sample Training Data Features Learned by Network
![Page 13: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/13.jpg)
13
Visualize Features Learned During TrainingAlexNet Example
Sample Training Data Features Learned by Network
![Page 14: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/14.jpg)
14
Deep Learning Challenges
Data
▪ Handling large amounts of data
▪ Labeling thousands of images & videos
Training and Testing Deep Neural Networks
▪ Accessing reference models from research
▪ Optimizing hyperparameters
▪ Training takes hours-days
Rapid and Optimized Deployment
▪ Desktop, web, cloud, and embedded hardware
Not a deep learning expert
![Page 15: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/15.jpg)
15
Example – Semantic Segmentation
▪ Classify pixels into 11 classes
– Sky, Building, Pole, Road,
Pavement, Tree, SignSymbol,
Fence, Car, Pedestrian, Bicyclist
▪ CamVid dataset Brostow, Gabriel J., Julien Fauqueur, and Roberto Cipolla. "Semantic object classes in
video: A high-definition ground truth database." Pattern Recognition Letters Vol 30, Issue
2, 2009, pp 88-97.
Available Here
![Page 16: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/16.jpg)
16
Label Images Using Image Labeler App
![Page 17: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/17.jpg)
17
Accelerate Labeling With Automation Algorithms
Learn More
![Page 18: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/18.jpg)
18
Ground Truth
Train
Network
Labeling Apps
Images
Videos
Automation
Algorithm
Propose LabelsMore
Ground TruthImprove Network
Perform Bootstrapping to Label Large Datasets
![Page 19: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/19.jpg)
19
Example – Semantic Segmentation Available Here
![Page 20: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/20.jpg)
20
Access Large Sets of Images
Handle Large Sets of Images
Easily manage large sets of images- Single line of code to access images- Operates on disk, database, big-data file system
imageData =
imageDataStore(‘vehicles’)
Easily manage large sets of images
- Single line of code to access images
- Operates on disk, database, big-data file system
Organize Images in Folders
(~ 10,000 images , 5 folders)
![Page 21: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/21.jpg)
21
Handle Big Image Collections without Big Changes
Images in local directory
Images on HDFS
![Page 22: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/22.jpg)
22
Import Pre-Trained Models and Network Architectures
Import Models from Frameworks
▪ Caffe Model Importer
(including Caffe Model Zoo)
– importCaffeLayers
– importCaffeNetwork
▪ TensorFlow-Keras Model Importer
– importKerasLayers
– importKerasNetwork
Download from within MATLAB
Pretrained Models
▪ alexnet
▪ vgg16
▪ vgg19
▪ googlenet
▪ inceptionv3
▪ resnet50
▪ resnet101
▪ inceptionresnetv2
▪ squeezenet
![Page 23: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/23.jpg)
23
Example – Semantic Segmentation Available Here
![Page 24: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/24.jpg)
24
Augment Training Images
Rotation
Reflection
Scaling
Shearing
Translation
Colour pre-processing
Resize / Random crop / Centre crop
![Page 25: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/25.jpg)
25
Tune Hyperparameters to Improve Training
Many hyperparameters
▪ depth, layers, solver options,
learning rates, regularization,
…
Techniques
▪ Parameter sweep
▪ Bayesian optimization
![Page 26: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/26.jpg)
26
Training Performance
TensorFlow
MATLAB
MXNet
![Page 27: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/27.jpg)
NVIDIA Tesla V100 32GBThe Fastest and Most Productive GPU for AI and HPC
Volta Architecture
Most Productive GPU
Tensor Core
125 Programmable
TFLOPS Deep Learning
Improved SIMT Model
New Algorithms
Volta MPS
Inference Utilization
Improved NVLink &
HBM2
Efficient Bandwidth
Core5120 CUDA cores,
640 Tensor cores
Compute 7.8 TF DP ∙ 15.7 TF SP ∙ 125 TF DL
Memory HBM2: 900 GB/s ∙ 32 GB/16 GB
InterconnectNVLink (up to 300 GB/s) +
PCIe Gen3 (up to 32 GB/s)
Visit NVIDIA booth
to learn more
![Page 28: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/28.jpg)
28
Deep Learning on CPU, GPU, Multi-GPU & Clusters
Single CPU
Single CPUSingle GPU
HOW TO TARGET?
Single CPU, Multiple GPUs
On-prem server with GPUs
Cloud GPUs(AWS)
![Page 29: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/29.jpg)
29
Multi-GPU Performance Scaling
Ease of scaling
▪ MATLAB “transparently”
scales to multiple GPUs
▪ Runs on Windows!
Se
co
nds p
er
ep
och
1 GPU 2 GPUs 4 GPUs
![Page 30: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/30.jpg)
30
Examples to Learn More
![Page 31: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/31.jpg)
31
Example – Semantic Segmentation Available Here
![Page 32: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/32.jpg)
32
Accelerate Using GPU Coder
Running in MATLAB Generated Code from GPU Coder
![Page 33: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/33.jpg)
33
Prediction Performance: Fast with GPU Coder
AlexNet ResNet-50 VGG-16
TensorFlow
MATLAB
MXNet
GPU Coder
Images/Sec
~2x
~2x
~2x
~2x faster than
TensorFlow
![Page 34: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/34.jpg)
34
Deploying Deep Learning Application
Embedded Hardware Desktop, Web, CloudApplication
logic
Application
Deployment
Code
Generation
![Page 35: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/35.jpg)
35
Next Session
![Page 36: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/36.jpg)
36
Addressing Deep Learning Challenges
✓Perform deep learning without being an expert
✓Automate ground truth labeling
✓Create and visualize models with just a few lines of code
✓Seamless scale training to GPUs, clusters and cloud
✓Integrate & deploy deep learning in a single workflow
![Page 37: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/37.jpg)
38
Framework Improvements
▪ Architectures / layers
– Regression LSTMs
– Bidirectional LSTMs
– Multi-spectral images
– Custom layer validation
▪ Data pre-processing
– Custom Mini-Batch Datastores
▪ Performance
– CPU performance optimizations
– Optimizations for zero learning-rate
▪ Network training
– ADAM & RMSProp optimizers
– Gradient clipping
– Multi-GPU DAG network training
– DAG network activations
![Page 38: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/38.jpg)
39
Deep Learning Network Analyzer
![Page 39: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/39.jpg)
40
MATLAB provides a simple programmatic
interface to create layers and form a network
• addLayers
• removeLayers
• connectLayers
• disconnectLayers
… but are all these layers
compatible?
Creating Custom Architectures
![Page 40: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/40.jpg)
41
![Page 41: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/41.jpg)
42
8 x 12 x 64
![Page 42: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/42.jpg)
43
8 x 12 x 128
![Page 43: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/43.jpg)
44
7 x 11 x 32
![Page 44: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/44.jpg)
45
Change the padding
from zero to one
![Page 45: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/45.jpg)
46
![Page 46: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/46.jpg)
47
Call to Action – Deep Learning Onramp Free Introductory Course
Available Here
![Page 47: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/47.jpg)
48
MATLAB Deep Learning Framework
Access Data Design + Train Deploy
▪ Manage large image sets
▪ Automate image labeling
▪ Easy access to models
▪ Acceleration with GPU’s
▪ Scale to GPUs & clusters
▪ Optimized inference
deployment
▪ Target NVIDIA, Intel, ARM
platforms
![Page 48: Demystifying Deep Learning · Demystifying Deep Learning Dr. Amod Anandkumar ... - Operates on disk, database, big-data file system Organize Images in Folders (~ 10,000 images , 5](https://reader036.fdocuments.us/reader036/viewer/2022071101/5fd9c1738f6452603c0875fd/html5/thumbnails/48.jpg)
49
• Share your experience with MATLAB & Simulink on Social Media
▪ Use #MATLABEXPO
• Share your session feedback: Please fill in your feedback for this session in the feedback form
Speaker Details
Email: [email protected]
LinkedIn: https://in.linkedin.com/in/ajga2
Twitter: @_Dr_Amod
Contact MathWorks India
Products/Training Enquiry Booth
Call: 080-6632-6000
Email: [email protected]