Top Banner
1 © 2015 The MathWorks, Inc. Deep Learning e Reinforcement Learning per l’intelligenza artificiale Giuseppe Ridinò
46

Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

May 20, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

1© 2015 The MathWorks, Inc.

Deep Learning e Reinforcement

Learning per l’intelligenza artificiale

Giuseppe Ridinò

Page 2: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

2

Why MATLAB for Artificial Intelligence?

Page 3: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

3

Artificial Intelligence

Development of computer systems to perform tasks that normally

require human intelligence

Page 4: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

4

Speech RecognitionObject Classification

Signal Classification

Predictive Maintenance

Automated Driving Stock Market Prediction

A.I. Applications

Page 5: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

5

Artificial Intelligence

▪ Development of computer systems to perform tasks that

normally require human intelligence

Machine Learning

K-means

Gaussian

Mixture

Logistic

Regression

Decision

Trees

SVM

Nearest

Neighbor

Deep

Learning

Reinforcement Learning

Page 6: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

6

Unsupervised

Learning[No Labeled Data]

Clustering

Machine Learning

Machine Learning and Deep Learning

Page 7: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

7

Unsupervised

Learning[No Labeled Data]

Supervised Learning

[Labeled Data]

Clustering Classification Regression

Machine Learning

Machine Learning and Deep Learning

Page 8: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

8

Unsupervised

Learning[No Labeled Data]

Supervised Learning

[Labeled Data]

Clustering Classification Regression

Machine Learning

Machine Learning and Deep Learning

Deep Learning

Supervised learning typically involves

feature extraction

Deep learning typically does not

involve feature extraction

Page 9: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

9

Deep Learning

Deep Learning

Machine

Learning

Deep

Learning

▪ Subset of machine learning with automatic feature extraction

– Learns features and tasks directly from data

– More Data = better model

Page 10: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

10

Deep Learning Uses a Neural Network Architecture

Input

LayerHidden Layers (n)

Output

Layer

Page 11: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

11

Deep Learning Datatypes

SignalImage

TextNumeric

Page 12: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

12

Deep Learning Workflow

Ground truth labeling

Train ModelPrepare Data

Model exchange

across frameworks

Model design,

Hyperparameter

tuning

Data access and

preprocessing

Deploy

Enterprise

Deployment

Edge deployment

Multiplatform code

generation (CPU, GPU)

Hardware-

accelerated training

Page 13: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

13

Why MATLAB for A.I. Tasks?

Increased productivity with interactive tools

Generate simulation data for complex models and systems

Ease of deployment and scaling to various platforms

Full A.I. workflows that cannot be easily

replicated by other toolchains

Page 14: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

14

Why MATLAB for A.I. Tasks?

Increased productivity with interactive tools

Full A.I. workflows that cannot be easily

replicated by other toolchains

Labeling TrainingModel

Exchange

Page 15: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

15

Labeling for deep learning is repetitive,

tedious, and time-consuming…

but necessary

Page 16: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

16

Page 17: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

17

Page 18: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

18

Page 19: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

19

Signal Labeler

Define

Labels

Interactively

Label Signals

View

properties

of labels

Page 20: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

20

User Story – Veoneer (Autoliv)

▪ Automotive

– Software and hardware for active safety,

autonomous driving, occupant protection,

and brake control

▪ Building radar sensor – check

accuracy using LiDAR-based

verification

▪ Human analyzes hours of recorded

data

▪ Used MATLAB to semi-automate

labeling and tracking of 3D LiDAR

point clouds.

Page 21: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

21

Manual Labeling for 25 events took over 20 minutes.

After full automation with MATLAB’s tools, it took 5 minutes

Page 22: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

22

Use Deep Network Designer to Create Networks

Page 23: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

23

Transfer Learning with Pre-trained Models

Inception-v3Inception-

ResNet-v2ResNet-18

SqueezeNet ResNet-50

DenseNet-201

VGG-16

AlexNet

GoogLeNet

ResNet-101

VGG-19

Import & Export Models Between Frameworks

Keras-Tensorflow

Importer

Caffe Model

ImporterONNX Model

Converter

Page 24: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

24

Model Exchange with MATLAB

PyTorch

Caffe2

MXNet

Core ML

CNTK

Keras-

Tensorflow

Caffe

MATLABONNX

Open Neural Network Exchange

(…)

Page 25: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

25

Why MATLAB for A.I. Tasks?

Increased productivity with interactive tools

Generate simulation data for complex models and systems

Ease of deployment and scaling to various platforms

Full A.I. workflows that cannot be easily

replicated by other toolchains

Page 26: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

26

Why MATLAB for A.I. Tasks?

Generate simulation data for complex models and systems

Full A.I. workflows that cannot be easily

replicated by other toolchains

Reinforcement

Learning

Page 27: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

27

Unsupervised

Learning[No Labeled Data]

Supervised Learning

[Labeled Data]

Clustering Classification Regression

Machine Learning

Reinforcement Learning vs Machine Learning vs

Deep Learning

Deep Learning

Supervised learning typically involves

feature extraction

Deep learning typically simplifies

feature extraction

Page 28: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

28

Unsupervised

Learning[No Labeled Data]

Supervised Learning

[Labeled Data]

Clustering Classification Regression

Deep Learning

Machine Learning

Reinforcement

Learning

[Interaction Data]

Decision

MakingControls

Reinforcement Learning vs Machine Learning vs

Deep Learning

Reinforcement learning:

▪ Learning through trial & error

[interaction]

▪ It’s about learning a

behavior or accomplishing a

task

Page 29: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

29

What is Reinforcement Learning?

▪ What is Reinforcement

Learning?

– Type of machine learning

that trains an ‘agent’

through repeated

interactions with an

environment

▪ How does it work?

– Through a trial & error

process that uses a reward

system to maximize

success

Page 30: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

30

Reinforcement Learning enables the use of Deep Learning for

Controls and Decision Making Applications

A.I. Gameplay

Controls

Robotics

Autonomous driving

Page 31: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

31

How Does Reinforcement Learning Work?

AGENT

ENVIRONMENT

ACTION

REWARD

STATE

Page 32: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

32

A Practical Example of Reinforcement LearningTraining a Self-Driving Car

▪ Vehicle’s computer learns how to drive…

(agent)

▪ using sensor readings from LIDAR, cameras,…

(state)

▪ that represent road conditions, vehicle position,…

(environment)

▪ by generating steering, braking, throttle commands,…

(action)

▪ to avoid collisions and lane deviation…

(reward).

AGENT

ENVIRONMENT

ACTION

REWARD

STATE

The goal of Reinforcement learning is for the agent to find an optimal algorithm for

performing a task

Page 33: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

33

Deep Networks are commonly found in the agent, because

they can model complex problems.

AGENT

• Turn left

• Turn right

• Brake

• Accelerate

Page 34: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

34

Reinforcement Learning Workflow

Train ModelGenerate Data Deployment

Developing reward

system to optimize

performance

Training agent to

perform task

Scenario Design

Simulation-based

data generation

Enterprise

Deployment

Edge deployment

Reinforcement learningMultiplatform code

generation (CPU,

GPU)

Simulink –

generate data for

dynamic systems

(planes, cars,

robots, etc.)

Ground truth labeling

Prepare Data

Data access and

preprocessing

Page 35: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

35

Why MATLAB and Simulink for

Reinforcement Learning?

Virtual models allow you to

simulate conditions hard to

emulate in the real world.

Page 36: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

36

Using MATLAB and Simulink for

Reinforcement Learning

▪ Reinforcement learning is a

dynamic process

▪ Decision making problems

– Financial trading, calibration, etc.

▪ Controls-based problems

– Lane-keep assist, adaptive cruise

control, robotics, etc.

Page 37: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

37

Why MATLAB for A.I. Tasks?

Increased productivity with interactive tools

Ease of deployment and scaling to various platforms

Generate simulation data for complex models and systems

Full A.I. workflows that cannot be easily

replicated by other toolchains

Page 38: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

38

Why MATLAB for A.I. Tasks?

Full A.I. workflows that cannot be easily

replicated by other toolchains

Code

GenerationEmbedded

Devices

Enterprise

Systems

Increased productivity with interactive tools

Ease of deployment and scaling to various platforms

Generate simulation data for complex models and systems

Page 39: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

39

Deployment and Scaling for A.I.

Embedded Devices Enterprise Systems

MATLAB

Page 40: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

40

Embedded Devices – Automatic Code Generation

MATLAB Code Deployment

Target

Auto-generated

Code

(C/C++/CUDA)

Page 41: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

41

Deploying Deep Learning Models for Inference

Coder

Products

Deep Learning

Networks

NVIDIA

TensorRT &

cuDNN

Libraries

ARM

Compute

Library

Intel

MKL-DNN

Library

Page 42: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

42

With GPU Coder, MATLAB is fast

Intel® Xeon® CPU 3.6 GHz - NVIDIA libraries: CUDA10 - cuDNN 7 - Frameworks: TensorFlow 1.13.0, MXNet 1.4.0 PyTorch 1.0.0

GPU Coder is faster

than TensorFlow,

MXNet and Pytorch

TensorFlow

MXNet

GPU Coder

PyTorch

Page 43: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

43

Enterprise Deployment

Run thousands of simulations in parallel with MATLAB Parallel Server to save hours of

training time.

MATLAB Parallel

Server

MATLAB

+

Parallel Computing

Toolbox

Cloud

GPU

Multicore

CPU

Page 44: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

44

Enterprise Deployment

Deployment to the cloud with MATLAB Compiler and MATLAB Production Server

Page 45: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

45

Musashi Seimitsu Industry Co.,Ltd.Detect Abnormalities in Automotive Parts

MATLAB use in project:

▪ Preprocessing of captured images

▪ Image annotation for training

▪ Deep learning based analysis

– Various transfer learning methods

(Combinations of CNN models, Classifiers)

– Estimation of defect area using Class Activation Map

(CAM)

– Abnormality/defect classification

▪ Deployment to NVIDIA Jetson using GPU CoderAutomated visual inspection of 1.3 million

bevel gear per month

Page 46: Why MATLAB for Artificial Intelligence? · Artificial Intelligence Development of computer systems to perform tasks that normally require human intelligence Machine Learning K-means

46

Why MATLAB for A.I. Tasks?

Increased productivity with interactive tools

Generate simulation data for complex models and systems

Ease of deployment and scaling to various platforms

Full A.I. workflows that cannot be easily

replicated by other toolchains