Blogs

Is Machine Learning Ready for Microcontroller-based Systems?

Jacob BeningoSeptember 22, 2022

Machine learning” is currently technologies number one hype word. Mention machine learning and venture capitalists open their checkbooks with visions of riches and grandeur. Developers froth at the mouth with opportunities and dreams of potential applications. Managers cringe at the near ridiculous salaries paid for someone working in machine learning.

Despite the hype, machine learning has already been a significant technology driver that has delivered results and innovations in industries from automotive and industrial controls through the IoT and space systems technologies. In many cases, machine learning has focused on high-end, compute-heavy applications with backend servers or application processors. Still, increasing interest has been in deploying machine learning algorithms to microcontrollers. Is machine learning ready for microcontroller-based systems?

Use cases for machine learning in microcontroller-based systems

This article is available in PDF format for easy printing

Whether machine learning is ready for microcontrollers or not is partially dependent on the application. For example, if a team wants to deploy an adaptive ML algorithm to a microcontroller, the processing power is beyond today’s technology. However, several use cases are very interesting for microcontroller-based systems, and the list is growing steadily.

One interesting use case many readers are probably familiar with is keyword spotting. Voice is becoming a powerful user interface, and microcontrollers can assist in that interface. For example, a low-power microcontroller can run a machine learning inference that watches for a single keyword. Upon detecting the keyword, the microcontroller can wake an application processor that can manage additional keywords and the main application.

Object detection and classification are also additional use case areas that excite developers. Another 2H7 microcontroller can efficiently run an object classification application. For example, the OpenMV platform, based on the STM32H7, is designed to simplify imaging applications that can use machine learning.

One last application for us to consider is preventative maintenance. When a machine goes down in many industrial and home applications, it can be very costly and inconvenient. In many instances, the machine doesn’t just suddenly break. Instead, a slight decrease in performance flags an issue based on detectable data points like vibration, airflow, etc. Simple machine learning models can detect normal behavior and alert the user if the system appears to be approaching the need for maintenance. Scheduling maintenance rather than having a line down can save money and hassle and optimize travel costs.      

Machine Learning Technologies for Microcontrollers

Once a team has identified a use case for which they want to use machine learning, they need to make sure that they have the right tools and technologies available to build it. When you look at the larger machine learning space, many tools are available to aid developers working in machine learning. When it comes to the microcontroller space, there are fewer options, but the options are quickly growing.

There are several tools that developers might leverage to train machine learning models for their applications. First, Tensorflow Lite for Microcontrollers runs machine learning models on microcontrollers and other devices with only a few kilobytes of memory. The core runtime fits 16 KB on an Arm Cortex M3 and can run many basic models. It doesn't require operating system support, standard C or C++ libraries, or dynamic memory allocation.

Next, depending on the microcontroller selected, developers might be able to leverage their microcontroller ecosystem. For example, ST Microelectronics has its X-CUBE-AI plug-in that allows a developer to import a machine learning model, analyze it, and optimize it to run on a microcontroller. There are also tools like the NanoEdgeAiStudio that allow software developers with little to no experience to train and deploy machine learning models to microcontrollers.

Finally, some tools like Edge Impulse allow developers to import data sets, select machine learning parameters, create a model, analyze it, and then deploy it to their target. These tools can help developers rapidly experiment with and develop their machine learning models for microcontroller-based systems. 

Is machine learning ready for microcontroller-based systems?

Yes and no. Whether you can leverage machine learning for your application on a microcontroller depends on your end-use cases. Some tools can support machine learning for microcontrollers, but the availability of these tools is limited depending on the microcontroller you select. I’ve also found that not all devices are equal, and some produce more efficient and memory-constrained models better than others.

When deploying a machine learning model to a microcontroller, developers may need to make trade-offs that affect the accuracy of their model. Whether you are ready for machine learning to be deployed to microcontrollers or not, the technology is coming quickly. Machine learning may not be ready for your microcontroller-based application today, but it may be tomorrow. 


To post reply to a comment, click on the 'reply' button attached to each comment. To post a new comment (not a reply to a comment) check out the 'Write a Comment' tab at the top of the comments.

Please login (on the right) if you already have an account on this platform.

Otherwise, please use this form to register (free) an join one of the largest online community for Electrical/Embedded/DSP/FPGA/ML engineers: