In this example we illustrate a MATLAB and Simulink workflow on how to train and deploy a machine learning model to a low-power microcontroller on the edge. We demonstrate how to train a shallow neural network for a regression problem, how to generate readable single precision floating point or Fixed-point code and how to deploy to an ARM cortex M microcontroller such as an Arduino Uno.
We use the engine dataset for estimating engine emission levels based on measurements of fuel consumption and speed. This is a regression problem and we use a shallow neural network to model the system.
The download contains the example dataset, the trained model exported as a MATLAB function and an equivalent Simulink model and a detailed article explaining the workflow steps. It also contains all the required scripts to automate some of the tasks.
MathWorks Fixed Point Team (2022). Deploying shallow Neural Networks on low power ARM Cortex M (https://www.mathworks.com/matlabcentral/fileexchange/67799-deploying-shallow-neural-networks-on-low-power-arm-cortex-m), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!