embedded machine learning - mathworks

25
1 © 2015 The MathWorks, Inc. Embedded Machine Learning: Enabling Workflows for Edge Devices Gokhan Atinc

Upload: others

Post on 29-Mar-2022

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Embedded Machine Learning - MathWorks

1© 2015 The MathWorks, Inc.

Embedded Machine Learning:Enabling Workflows for Edge Devices

Gokhan Atinc

Page 2: Embedded Machine Learning - MathWorks

2

BMW designs, tests and deploys data-driven systems that

enhance vehicles’ capabilities using MATLAB and Simulink

Full Story: https://www.mathworks.com/company/newsletters/articles/detecting-oversteering-in-bmw-automobiles-with-machine-learning.html

> 95% accuracy

Page 3: Embedded Machine Learning - MathWorks

3

MathWorks provides embedded machine learning workflows

that integrate nicely with Model-Based Design

MATLAB

GPU Coder

SIMULINK

Software In The Loop

Processor In The Loop

Hardware In The Loop

Simulink CoderMATLAB Coder

Embedded Machine Learning

• Data-driven, smart algorithms

capable of running on edge

devices

Embedded Systems

C/C++ CUDA

Page 4: Embedded Machine Learning - MathWorks

4

Deploy machine learning

models in MATLAB & Simulink

Deploy fixed-point

machine learning models

In-place modification of

deployed models

Machine learning algorithms are supported for a variety of

embedded systems workflows

C/C++

Page 5: Embedded Machine Learning - MathWorks

5

C/C++Learner apps provide convenient ways to compare and

iterate over different machine learning algorithms

Page 6: Embedded Machine Learning - MathWorks

6

C/C++Classification Learner App demonstration

Page 7: Embedded Machine Learning - MathWorks

7

C/C++Models trained with Learner App can be saved for

deployment

Extract Trained Model

Save Trained Model for

Deployment

Page 8: Embedded Machine Learning - MathWorks

8

C/C++Trained models can be used in Simulink

openExample('stats/SystemObjectsForClassificationAndCodeGenerationExample')

Page 9: Embedded Machine Learning - MathWorks

9

C/C++Trained models can be used in Simulink

Page 10: Embedded Machine Learning - MathWorks

10

C/C++Trained models can be used in Simulink via System

Blocks

Page 11: Embedded Machine Learning - MathWorks

11

C/C++Majority of machine learning models are supported for

deployment

Supported Models

• Linear Classification

• SVM

• Decision trees and Random Forests

• Linear Discriminant Analysis

• k-Nearest Neighbor models

• Ensemble models

• Naïve Bayes models

• Gaussian Process

• Linear/Generalized Linear Regression

Deploy machine learning

models in MATLAB & Simulink

C/C++

Page 12: Embedded Machine Learning - MathWorks

12

C/C++Native Simulink Library Blocks

Supported Models

• Binary Classification SVM

• Regression SVM

Page 13: Embedded Machine Learning - MathWorks

13

C/C++Majority of machine learning models are supported for

deployment

Simulink

• Simulink Library Blocks

• MATLAB System Block

• MATLAB Function Block

• Stateflow

Deploy machine learning

models in MATLAB & Simulink

C/C++

Supported Models

• Linear Classification

• SVM

• Decision trees and Random Forests

• Linear Discriminant Analysis

• k-Nearest Neighbor models

• Ensemble models

• Naïve Bayes models

• Gaussian Process

• Linear/Generalized Linear Regression

Page 14: Embedded Machine Learning - MathWorks

14

Deploy machine learning

models in MATLAB & Simulink

Deploy fixed-point

machine learning models

In-place modification of

deployed models

Machine learning algorithms are supported for fixed-point

workflows

C/C++

Page 15: Embedded Machine Learning - MathWorks

15

Deploy fixed-point machine learning models

Minimize energy consumption

Reduce cost

C/C++

Page 16: Embedded Machine Learning - MathWorks

16

Fixed-Point

Implementation of Predict

ModelSupervised

Learning

CLASSIFICATION

REGRESSION

Train in MATLAB

Fixed-Point

Representation of Model

New

DataPredict on low power

embedded device

Convert in Fixed-Point

Designer

Cost-effective model

Fixed-point workflows allow deployment of models with small

memory footprint

Page 17: Embedded Machine Learning - MathWorks

17

Fixed-point conversion is a trade-off between resource

usage optimization and accuracy

Page 18: Embedded Machine Learning - MathWorks

18

Popular machine learning models are supported

for fixed-point workflows

Deploy fixed-point

machine learning modelsSupported Models

• Binary SVM

• Decision Trees

• Ensembles of Decision Trees

Page 19: Embedded Machine Learning - MathWorks

19

Deploy machine learning

models in MATLAB & Simulink

Deploy fixed-point

machine learning models

In-place modification of

deployed models

Machine learning algorithms are supported for in-place

modification workflows

C/C++

Page 20: Embedded Machine Learning - MathWorks

20

In-place modification of deployed models

Update running model

SIL/HIL Verification of models

OTA Update of models on remote vehicles

C/C++

Page 21: Embedded Machine Learning - MathWorks

21

In-place modification of deployed models allows model

updates without code regeneration

C/C++

Page 22: Embedded Machine Learning - MathWorks

22

In-place modification workflow is agnostic to

communication method, supported in Simulink

Modified version of openExample('stats/HARDeploymentExample')

Page 23: Embedded Machine Learning - MathWorks

23

Popular machine learning models are supported for

in-place modification workflows

In-place modification of

deployed modelsSupported Models

• SVM

• Linear Models

• Decision Trees

Page 24: Embedded Machine Learning - MathWorks

24

Deploy machine learning

models in MATLAB & Simulink

Deploy fixed-point

machine learning models

In-place modification of

deployed models

Machine learning algorithms are supported for a variety of

embedded systems workflows

C/C++

Page 25: Embedded Machine Learning - MathWorks

25

Q & A

Are you already working on a project

that involves deploying a machine

learning model to an edge device?

If you have questions, please reach out:

[email protected]

A BYES NO

Which machine learning algorithms have you

previously used in your projects?

A BSVM Decision Trees

C DEnsembles Gaussian Process Models

E FKNN Other