24
July 02 | Europe Advanced Capabilities for Embedding Machine Learning into ECUs Christoph Stockhammer

Advanced Capabilities for Embedding Machine Learning into …

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Advanced Capabilities for Embedding Machine Learning into …

July 02 | Europe

Advanced Capabilities for Embedding Machine Learning into ECUs

Christoph Stockhammer

Page 2: Advanced Capabilities for Embedding Machine Learning into …

2

BMW designs, tests and deploys data-driven systems that

enhance vehicles’ capabilities with MATLAB & Simulink

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

> 95% accuracy

Page 3: Advanced Capabilities for Embedding Machine Learning into …

3

MathWorks provides tools to design and verify smart, data-driven

machine learning systems

𝑓 𝑥 = 𝑦

መ𝑓 𝑥𝑛𝑒𝑤 = ො𝑦 ✔

⋆መ𝑓 𝑥𝑡𝑟𝑎𝑖𝑛 = 𝑦𝑡𝑟𝑎𝑖𝑛𝑥𝑡𝑟𝑎𝑖𝑛 𝑦𝑡𝑟𝑎𝑖𝑛

Page 4: Advanced Capabilities for Embedding Machine Learning into …

4

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

Page 5: Advanced Capabilities for Embedding Machine Learning into …

5

Deploy machine learning models

in MATLAB & Simulink

Deploy reduced precision

machine learning models

In-place modification of

deployed models

Machine Learning algorithms are supported for a variety of

embedded systems workflows

Page 6: Advanced Capabilities for Embedding Machine Learning into …

6

Learner Apps provide convenient ways to compare and iterate over

different machine learning algorithms

Page 7: Advanced Capabilities for Embedding Machine Learning into …

7

Classification learner App demonstration

Page 8: Advanced Capabilities for Embedding Machine Learning into …

9

Model trained using Learner App can be saved for deployment

Extract Trained Model

Save Trained Model for

Deployment

Page 9: Advanced Capabilities for Embedding Machine Learning into …

10

Saved models can be used in Simulink models

openExample('stats/SystemObjectsForClassificationAndCodeGenerationExample')

Page 10: Advanced Capabilities for Embedding Machine Learning into …

11

Saved models can be used in Simulink models

Page 11: Advanced Capabilities for Embedding Machine Learning into …

12

Saved models can be used in Simulink models via System

Blocks

Page 12: Advanced Capabilities for Embedding Machine Learning into …

13

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 models

• Regression

Simulink

• MATLAB Function Block

• MATLAB System Block

• Stateflow

Deploy machine learning models

in MATLAB & Simulink

Page 13: Advanced Capabilities for Embedding Machine Learning into …

14

Deploy machine learning models

in MATLAB & Simulink

Deploy reduced precision

machine learning models

In-place modification of

deployed models

Page 14: Advanced Capabilities for Embedding Machine Learning into …

15

Deploy reduced precision machine learning models

Minimize energy consumption on EV’s

Reduce cost

Page 15: Advanced Capabilities for Embedding Machine Learning into …

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

Reduced precision workflows allow conversion to fixed-point

and deployment of models with small memory footprint

Page 16: Advanced Capabilities for Embedding Machine Learning into …

17

Fixed-point conversion is a trade-off between resource usage

optimization and accuracy

Page 17: Advanced Capabilities for Embedding Machine Learning into …

18

Most Popular machine learning models are supported

for fixed-point workflows

Deploy reduced precision

machine learning modelsReduced Precision: Supported Models

• SVM

• Multi-class not supported

• Decision Trees

• Ensembles of Decision Trees

Page 18: Advanced Capabilities for Embedding Machine Learning into …

19

Deploy machine learning models

in MATLAB & Simulink

Deploy reduced precision

machine learning models

In-place modification of

deployed models

Page 19: Advanced Capabilities for Embedding Machine Learning into …

20

In-place modification of deployed models

Update running model

No code regeneration, no redeployment

SIL/HIL Verification of models

OTA Update of models on remote vehicles

Page 20: Advanced Capabilities for Embedding Machine Learning into …

21

In-place modification of deployed models allows model updates

without code regeneration

Page 21: Advanced Capabilities for Embedding Machine Learning into …

22

In-place modification workflow is agnostic to

communication method, works in Simulink

Modified version of openExample('stats/HARDeploymentExample')

Page 22: Advanced Capabilities for Embedding Machine Learning into …

23

Most Popular machine learning models are supported for in-place

modification workflows

In-place modification of

deployed modelsIn-place modification: Supported Models

• SVM

• Linear Models

• Decision Trees

Page 23: Advanced Capabilities for Embedding Machine Learning into …

24

Deploy machine learning models

in MATLAB & Simulink

Deploy reduced precision

machine learning models

In-place modification of

deployed models

Machine Learning algorithms are supported for a variety of

embedded systems workflows

Page 24: Advanced Capabilities for Embedding Machine Learning into …

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

B

YES

NO