Skip to content
MathWorks - Mobile View
  • Accedere al proprio MathWorks AccountAccedere al proprio MathWorks Account
  • Access your MathWorks Account
    • Il Mio Account
    • Il mio Profilo utente
    • Associa Licenza
    • Disconnettiti
  • Prodotti
  • Soluzioni
  • Università
  • Assistenza
  • Community
  • Eventi
  • Acquista MATLAB
MathWorks
  • Prodotti
  • Soluzioni
  • Università
  • Assistenza
  • Community
  • Eventi
  • Acquista MATLAB
  • Accedere al proprio MathWorks AccountAccedere al proprio MathWorks Account
  • Access your MathWorks Account
    • Il Mio Account
    • Il mio Profilo utente
    • Associa Licenza
    • Disconnettiti

Video e Webinar

  • MathWorks
  • Video
  • Home Video
  • Cerca
  • Home Video
  • Cerca
  • Contatta l’ufficio addetto alle vendite
  • Software di prova
2:30 Video length is 2:30.
  • Description
  • Full Transcript
  • Related Resources

Applied Machine Learning, Part 4: Embedded Systems

From the series: Applied Machine Learning

Walk through several key techniques and best practices for running your machine learning model on embedded devices. 

The video discusses options for making your model faster and reducing its memory footprint, including automatic C/C++ code generation, feature selection, and model reduction.

The phrase “machine learning” brings to mind complex algorithms that use lots of computations to train a model. But computations on “embedded devices” are limited in the amount of memory and compute available. 

Now, when I say “embedded devices,” I’m referring to objects with a special-purpose computing system, so think of things like a household appliance or sensors in an autonomous vehicle.

Today, we’ll discuss the different factors to keep in mind when preparing your machine learning model for an embedded device. 

Different types of models require different amounts of memory and time in order to make a prediction. For example, single decision trees are fast and require a small amount of memory. Nearest neighbor methods are slower and require more memory, so you might not want to use them for embedded applications.

Another thing to keep in mind when determining which models to use on an embedded device is how you will get your model to the device.  

Most embedded systems are programmed in low-level languages such as C.

But machine learning is typically done in high-level interpreted languages such as MATLAB, Python, or R.

If you have to maintain code bases in 2 different languages, it is going to be very painful to keep them in sync.   

MATLAB provides tools that automatically convert a machine learning model to C code, so you don’t need to manually implement the model in C separately.

So what if, after converting a model to C, you find out that it isn’t going to meet the requirements of our system?  Maybe the memory footprint is too big, or the model takes too long to make predictions?  

You could try other types of models and see if the code meets the requirements.  Maybe start with a simple model such as a decision tree.  

Alternatively, you could go back earlier in the process and see if you can reduce the number of features in the model. You can use tools such as neighborhood component analysis, which are useful for determining the impact that the features have on the results.  If you see that some features are weighted low, you could drop them from our model, making our model more concise.

Certain types of models have different reduction techniques associated with them. For decision trees, you can use pruning techniques, where you drop nodes that provide the smallest accuracy improvement.

One other approach is to look at reducing the memory required for storing the model parameters. For example, seeing if the model can be converted to a fixed-point representation that maintains acceptable accuracy.

Depending on your use case, any of these tactics may be appropriate. Hardware considerations, network connections, and budget are all key factors that will influence design decisions.  

That was just a quick overview of embedding machine learning models. For more information on preparing models for embedded devices, see the links below.

Learn More

Generate C Code for a Machine Learning Model
Use Machine Learning Models in Simulink
Prune a Decision Tree

3 Ways to Speed Up Model Predictive Controllers

Read white paper

A Practical Guide to Deep Learning: From Data to Deployment

Read ebook

Bridging Wireless Communications Design and Testing with MATLAB

Read white paper

Deep Learning and Traditional Machine Learning: Choosing the Right Approach

Read ebook

Hardware-in-the-Loop Testing for Power Electronics Control Design

Read white paper

Predictive Maintenance with MATLAB

Read ebook

Electric Vehicle Modeling and Simulation - Architecture to Deployment : Webinar Series

Register for Free

How much do you know about power conversion control?

Start quiz
Related Information
Related Information
MATLAB for Machine Learning

Feedback

Related Videos:

43:19
Using Machine Learning to Model Complex Systems
28:30
Embedded Code Generation for Your Vehicle Control Systems
39:33
Automatic Code Generation for Embedded Control Systems
30:08
Verification and Validation of Embedded Software Systems
19:50
Requirements Modeling and Design Verification of Embedded...
MathWorks - Domain Selector

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

  • Switzerland (English)
  • Switzerland (Deutsch)
  • Switzerland (Français)
  • 中国 (简体中文)
  • 中国 (English)

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文Chinese
    • English
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contact your local office

  • Contatta l’ufficio addetto alle vendite
  • Software di prova

MathWorks

Accelerating the pace of engineering and science

MathWorks è leader nello sviluppo di software per il calcolo matematico per ingegneri e ricercatori

Scopri…

Scopri i nostri prodotti

  • MATLAB
  • Simulink
  • Software per studenti​
  • Supporto hardware
  • File Exchange

Prova o Acquista

  • Download
  • Software di prova
  • Contattaci
  • Prezzi e licenze
  • Come acquistare

Impara ad utilizzare i nostri prodotti

  • Documentazione
  • Tutorial
  • Esempi
  • Video e Webinar
  • Formazione

Ricevi supporto tecnico

  • Aiuto all'installazione
  • MATLAB Answers
  • Consulenza
  • License Center
  • Contatta l'assistenza

Informazioni su MathWorks

  • Lavora con noi
  • Sala stampa
  • Missione sociale​
  • Casi dei clienti
  • Informazioni su MathWorks
  • Select a Web Site United States
  • Centro di fiducia
  • Marchi
  • Informativa sulla privacy
  • Antipirateria
  • Stato dell'applicazione

© 1994-2022 The MathWorks, Inc.

  • Facebook
  • Twitter
  • Instagram
  • YouTube
  • LinkedIn
  • RSS

Unisciti alla discussione