Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2020 May 5;20(9):2638.
doi: 10.3390/s20092638.

Machine Learning on Mainstream Microcontrollers

Affiliations

Machine Learning on Mainstream Microcontrollers

Fouad Sakr et al. Sensors (Basel). .

Abstract

This paper presents the Edge Learning Machine (ELM), a machine learning framework for edge devices, which manages the training phase on a desktop computer and performs inferences on microcontrollers. The framework implements, in a platform-independent C language, three supervised machine learning algorithms (Support Vector Machine (SVM) with a linear kernel, k-Nearest Neighbors (K-NN), and Decision Tree (DT)), and exploits STM X-Cube-AI to implement Artificial Neural Networks (ANNs) on STM32 Nucleo boards. We investigated the performance of these algorithms on six embedded boards and six datasets (four classifications and two regression). Our analysis-which aims to plug a gap in the literature-shows that the target platforms allow us to achieve the same performance score as a desktop machine, with a similar time latency. ANN performs better than the other algorithms in most cases, with no difference among the target devices. We observed that increasing the depth of an NN improves performance, up to a saturation level. k-NN performs similarly to ANN and, in one case, even better, but requires all the training sets to be kept in the inference phase, posing a significant memory demand, which can be afforded only by high-end edge devices. DT performance has a larger variance across datasets. In general, several factors impact performance in different ways across datasets. This highlights the importance of a framework like ELM, which is able to train and compare different algorithms. To support the developer community, ELM is released on an open-source basis.

Keywords: ANN; ARM; STM32 Nucleo; SVM; X-Cube-AI; decision trees; edge analytics; edge computing; embedded devices; k-NN; machine learning.

PubMed Disclaimer

Conflict of interest statement

The authors declare no conflict of interest.

Figures

Figure 1
Figure 1
Block diagram of the Edge Learning Machine system architecture.
Figure 2
Figure 2
Supported workflow.
Figure 3
Figure 3
Accuracy vs. Epochs for (a) Heart, (b) Virus, (c) Sonar, (d) Peugeot target 14, and (e) Peugeot target 15.
Figure 4
Figure 4
Mean Squared Error vs. Epochs for (a) EnviroCar, and (b) air quality index (AQI).
Figure 5
Figure 5
Number of occurrences of each DT parameter.

References

    1. Lin L., Liao X., Jin H., Li P. Computation offloading toward edge computing. Proc. IEEE. 2019;107:1584–1607. doi: 10.1109/JPROC.2019.2922285. - DOI
    1. Gubbi J., Buyya R., Marusic S., Palaniswami M. Internet of Things (IoT): A vision, architectural elements, and future directions. Future Gener. Comput. Syst. 2013;29:1645–1660. doi: 10.1016/j.future.2013.01.010. - DOI
    1. Shi W., Cao J., Zhang Q., Li Y., Xu L. Edge computing: Vision and challenges. IEEE Internet Things J. 2016;3:637–646. doi: 10.1109/JIOT.2016.2579198. - DOI
    1. Zuboff S. The Age of Surveillance Capitalism: The Fight for a Human Future at the New Frontier of Power. PublicAffairs; New York, NY, USA: 2019.
    1. TensorFlow Lite. [(accessed on 10 February 2020)]; Available online: http://www.tensorflow.org/lite.

LinkOut - more resources