embedded machine learning - mathworks
TRANSCRIPT
![Page 1: Embedded Machine Learning - MathWorks](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/1.jpg)
1© 2015 The MathWorks, Inc.
Embedded Machine Learning:Enabling Workflows for Edge Devices
Gokhan Atinc
![Page 2: Embedded Machine Learning - MathWorks](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/2.jpg)
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](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/3.jpg)
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](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/4.jpg)
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](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/5.jpg)
5
C/C++Learner apps provide convenient ways to compare and
iterate over different machine learning algorithms
![Page 6: Embedded Machine Learning - MathWorks](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/6.jpg)
6
C/C++Classification Learner App demonstration
![Page 7: Embedded Machine Learning - MathWorks](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/7.jpg)
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](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/8.jpg)
8
C/C++Trained models can be used in Simulink
openExample('stats/SystemObjectsForClassificationAndCodeGenerationExample')
![Page 9: Embedded Machine Learning - MathWorks](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/9.jpg)
9
C/C++Trained models can be used in Simulink
![Page 10: Embedded Machine Learning - MathWorks](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/10.jpg)
10
C/C++Trained models can be used in Simulink via System
Blocks
![Page 11: Embedded Machine Learning - MathWorks](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/11.jpg)
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](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/12.jpg)
12
C/C++Native Simulink Library Blocks
Supported Models
• Binary Classification SVM
• Regression SVM
![Page 13: Embedded Machine Learning - MathWorks](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/13.jpg)
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](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/14.jpg)
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](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/15.jpg)
15
Deploy fixed-point machine learning models
Minimize energy consumption
Reduce cost
C/C++
![Page 16: Embedded Machine Learning - MathWorks](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/16.jpg)
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](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/17.jpg)
17
Fixed-point conversion is a trade-off between resource
usage optimization and accuracy
![Page 18: Embedded Machine Learning - MathWorks](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/18.jpg)
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](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/19.jpg)
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](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/20.jpg)
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](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/21.jpg)
21
In-place modification of deployed models allows model
updates without code regeneration
C/C++
![Page 22: Embedded Machine Learning - MathWorks](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/22.jpg)
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](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/23.jpg)
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](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/24.jpg)
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](https://reader030.vdocuments.net/reader030/viewer/2022032906/62424557239d087d831236cf/html5/thumbnails/25.jpg)
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:
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