18
TCC 2016 Deep Learning with MATLAB Jan Studnička [email protected] www.humusoft.cz [email protected] www.mathworks.com 8.9.2016 Brno

TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ... 8.9.2016 Brno . Computer Vision Applications ... Manual …

  • Upload
    vantruc

  • View
    225

  • Download
    1

Embed Size (px)

Citation preview

Page 1: TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ...  8.9.2016 Brno . Computer Vision Applications ... Manual …

TCC 2016

Deep Learning with MATLAB

Jan Studnička [email protected] www.humusoft.cz [email protected] www.mathworks.com

8.9.2016 Brno

Page 2: TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ...  8.9.2016 Brno . Computer Vision Applications ... Manual …

Computer Vision Applications

Computer Vision

• Pedestrian and traffic sign detection

• Landmark identification

• Scene recognition

• Medical diagnosis and drug discovery

• Public Safety / Surveillance

• Automotive

• Robotics

and many more…

Page 3: TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ...  8.9.2016 Brno . Computer Vision Applications ... Manual …

What is Deep Learning ?

Deep learning performs end-end learning by learning features, representations and tasks directly from images, text and sound

Traditional Machine Learning

Machine

Learning

Classification Manual Feature Extraction

Truck Car

Bicycle

Deep Learning approach

𝟗𝟓%𝟑%

𝟐%

Truck

Car

Bicycle

Convolutional Neural Network (CNN)

Learned features End-to-end learning

Feature learning + Classification

Page 4: TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ...  8.9.2016 Brno . Computer Vision Applications ... Manual …

• Autoencoders

– Example: Classify digits in images

Deep Learning with MATLAB for Computer Vision

4

A visualization of learned weights of the first layer of a CNN.

• Convolutional Neural Networks (CNN)

– Trained on massive sets of data

– High accuracy

Page 5: TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ...  8.9.2016 Brno . Computer Vision Applications ... Manual …

Neural Network

5

• Single neuron

• Layer of Neurons

Page 6: TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ...  8.9.2016 Brno . Computer Vision Applications ... Manual …

Autoencoders

• Unsupervised Learning

– Hidden layer – Encoder

• Pretrain Deep Neural Network

– Hidden layers – Encoders of pretrained Autoencoders

6

Page 7: TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ...  8.9.2016 Brno . Computer Vision Applications ... Manual …

Digit Classification

7

• Classify digits in images

• Data:

– 28 x 28 pixels

– 10 digit classes

– 5000 samples

• Solution:

– 2 hidden layers – autoencoders

– Classification – Softmax layer

– Stack the Encoders with the Softmax layer to form a Deep Network

– Fine-tune the entire Deep Network – Classification

Page 8: TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ...  8.9.2016 Brno . Computer Vision Applications ... Manual …

Convolutional Neural Networks: Live Object Recognition with Webcam

Page 9: TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ...  8.9.2016 Brno . Computer Vision Applications ... Manual …

Why is Deep Learning so Popular ?

• Results: Achieved substantially better results on ImageNet large scale recognition challenge

– 95% + accuracy on ImageNet 1000 class challenge

• Computing Power: GPU’s and advances to processor technologies have enabled us to train networks on massive sets of data.

• Data: Availability of storage and access to large sets of labeled data

– E.g. ImageNet , PASCAL VoC , Kaggle

Year Error Rate

Pre-2012 (traditional

computer vision and

machine learning

techniques)

> 25%

2012 (Deep Learning) ~ 15%

2015 (Deep Learning) <5 %

Page 10: TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ...  8.9.2016 Brno . Computer Vision Applications ... Manual …

Two Approaches for Deep Learning

𝟗𝟓%𝟑%

𝟐%

Truck

Car

Bicycle

Convolutional Neural Network (CNN)

Learned features

1. Train a Deep Neural Network from Scratch

Lots of data

New Task

Fine-tune network weights

Truck

Car Pre-trained CNN

Medium amounts

of data

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

Page 11: TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ...  8.9.2016 Brno . Computer Vision Applications ... Manual …

Two Deep Learning Approaches Approach 1: Train a Deep Neural Network from Scratch

Training data 1000s to millions of labeled images

Computation Compute intensive (requires GPU)

Training Time Days to Weeks for real problems

Model accuracy High (can overfit to small datasets)

Recommended only when:

𝟗𝟓%𝟑%

𝟐%

Truck

Car

Bicycle

Convolutional Neural Network (CNN)

Learned features

Page 12: TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ...  8.9.2016 Brno . Computer Vision Applications ... Manual …

Two Deep Learning Approaches Approach 2: Fine-tune a pre-trained model (transfer learning)

Training data 100s to 1000s of labeled images (small)

Computation Moderate computation (GPU optional)

Training Time Seconds to minutes

Model accuracy Good, depends on the pre-trained CNN model

New Task

Fine-tune network weights

Truck

Car Pre-trained CNN

New Data

CNN trained on massive sets of data

• Learned robust representations of images from larger data set

• Can be fine-tuned for use with new data or task with small – medium size datasets

Recommended when:

Page 13: TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ...  8.9.2016 Brno . Computer Vision Applications ... Manual …

• Train “deep” neural networks on structured data (e.g. images, signals, text)

• Implements Feature Learning: Eliminates need for “hand crafted” features

• Trained using GPUs for performance

Convolutional Neural Networks

Convolution +

ReLu Pooling Input

Convolution +

ReLu Pooling

… …

Flatten Fully

Connected Softmax

car truck

bicycle

van

Feature Learning Classification

Page 14: TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ...  8.9.2016 Brno . Computer Vision Applications ... Manual …

Convolutional Neural Networks

Page 15: TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ...  8.9.2016 Brno . Computer Vision Applications ... Manual …

Demo Fine-tune a pre-trained model (transfer learning)

Pre-trained CNN

(AlexNet – 1000 Classes)

SUV

Car

New Data

New Task – 2 Class

Classification

Page 16: TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ...  8.9.2016 Brno . Computer Vision Applications ... Manual …

Demo Fine-tune a pre-trained model (transfer learning)

Page 17: TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ...  8.9.2016 Brno . Computer Vision Applications ... Manual …

Addressing Challenges in Deep Learning for CV

Challenge

Managing large sets of labeled

images

Resizing, Data augmentation

Background in neural networks

(deep learning)

Computation intensive task

(requires GPU)

Solution

imageSet or imageDataStore to

handle large sets of images

imresize, imcrop, imadjust,

imageInputLayer, etc.

Intuitive interfaces, well-documented

architectures and examples

Training supported on GPUs

No GPU expertise is required

Automate. Offload computations to a

cluster and test multiple architectures

Page 18: TCC 2016 Deep Learning with MATLAB - Humusoft · TCC 2016 Deep Learning with MATLAB Jan Studnička ...  8.9.2016 Brno . Computer Vision Applications ... Manual …

Pobřežní 20 www.facebook.com/humusoft

186 00 Praha 8 www.youtube.com/humusoft

Česká republika www.twitter.com/humusoft

Email: [email protected]

www.humusoft.cz

Tel.: +420 284 011 720

International reseller of MathWorks for the Czech Republic and Slovakia