{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,7,26]],"date-time":"2026-07-26T03:46:00Z","timestamp":1785037560953,"version":"3.55.0"},"reference-count":57,"publisher":"MDPI AG","issue":"9","license":[{"start":{"date-parts":[[2020,5,5]],"date-time":"2020-05-05T00:00:00Z","timestamp":1588636800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Sensors"],"abstract":"<jats:p>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\u2014which aims to plug a gap in the literature\u2014shows 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.<\/jats:p>","DOI":"10.3390\/s20092638","type":"journal-article","created":{"date-parts":[[2020,5,7]],"date-time":"2020-05-07T03:10:38Z","timestamp":1588821038000},"page":"2638","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":97,"title":["Machine Learning on Mainstream Microcontrollers"],"prefix":"10.3390","volume":"20","author":[{"given":"Fouad","family":"Sakr","sequence":"first","affiliation":[{"name":"Department of Electrical, Electronic and Telecommunication Engineering (DITEN)-University of Genoa, Via Opera Pia 11a, 16145 Genova, Italy"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-4109-4675","authenticated-orcid":false,"given":"Francesco","family":"Bellotti","sequence":"additional","affiliation":[{"name":"Department of Electrical, Electronic and Telecommunication Engineering (DITEN)-University of Genoa, Via Opera Pia 11a, 16145 Genova, Italy"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-1937-3969","authenticated-orcid":false,"given":"Riccardo","family":"Berta","sequence":"additional","affiliation":[{"name":"Department of Electrical, Electronic and Telecommunication Engineering (DITEN)-University of Genoa, Via Opera Pia 11a, 16145 Genova, Italy"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Alessandro","family":"De Gloria","sequence":"additional","affiliation":[{"name":"Department of Electrical, Electronic and Telecommunication Engineering (DITEN)-University of Genoa, Via Opera Pia 11a, 16145 Genova, Italy"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"1968","published-online":{"date-parts":[[2020,5,5]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","first-page":"1584","DOI":"10.1109\/JPROC.2019.2922285","article-title":"Computation offloading toward edge computing","volume":"107","author":"Lin","year":"2019","journal-title":"Proc. IEEE"},{"key":"ref_2","doi-asserted-by":"crossref","first-page":"1645","DOI":"10.1016\/j.future.2013.01.010","article-title":"Internet of Things (IoT): A vision, architectural elements, and future directions","volume":"29","author":"Gubbi","year":"2013","journal-title":"Future Gener. Comput. Syst."},{"key":"ref_3","doi-asserted-by":"crossref","first-page":"637","DOI":"10.1109\/JIOT.2016.2579198","article-title":"Edge computing: Vision and challenges","volume":"3","author":"Shi","year":"2016","journal-title":"IEEE Internet Things J."},{"key":"ref_4","unstructured":"Zuboff, S. (2019). The Age of Surveillance Capitalism: The Fight for a Human Future at the New Frontier of Power, PublicAffairs."},{"key":"ref_5","unstructured":"(2020, February 10). TensorFlow Lite. Available online: http:\/\/www.tensorflow.org\/lite."},{"key":"ref_6","unstructured":"Louis, M., Azad, Z., Delhadtehrani, L., Gupta, S.L., Warden, P., Reddi, V., and Joshi, A. (2019). Towards deep learning using tensorFlow lite on RISC-V. Workshop Comput. Archit. Res. RISC-V."},{"key":"ref_7","unstructured":"Dennis, D.K., Gopinath, S., Gupta, C., Kumar, A., Kusupati, A., Patil, S.G., and Simhadri, H.V. (2020, April 24). EdgeML Machine LEARNING for Resource-Constrained Edge Devices. Available online: https:\/\/github.com\/Microsoft\/EdgeML."},{"key":"ref_8","unstructured":"Suda, N., and Loh, D. (2019). Machine Learning on ARM Cortex-M Microcontrollers, Arm Ltd."},{"key":"ref_9","unstructured":"(2020, February 10). X-CUBE-AI\u2014AI Expansion Pack for STM32CubeMX\u2014STMicroelectronics. Available online: http:\/\/www.st. com\/en\/embedded-software\/x-cube-ai.html."},{"key":"ref_10","doi-asserted-by":"crossref","unstructured":"Bai, N. (2016). Practical Microcontroller Engineering with ARM Technology, Wiley-IEEE Press.","DOI":"10.1002\/9781119058397"},{"key":"ref_11","unstructured":"Goodfellow, I., Bengio, Y., and Courville, A. (2016). Deep Learning, The MIT Press."},{"key":"ref_12","doi-asserted-by":"crossref","unstructured":"Shalev-Shwartz, S., and Ben-David, S. (2014). Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press.","DOI":"10.1017\/CBO9781107298019"},{"key":"ref_13","first-page":"774","article-title":"Recognition of Patterns with help of Generalized Portraits","volume":"24","author":"Vapnik","year":"1963","journal-title":"Avtomat. Telemekh."},{"key":"ref_14","doi-asserted-by":"crossref","unstructured":"Shakhnarovich, G., Darrell, T., and Indyk, P. (2005). Nearest-Neighbor Methods in Learning and Vision, The MIT Press.","DOI":"10.7551\/mitpress\/4908.001.0001"},{"key":"ref_15","unstructured":"Breiman, L., Friedman, J., Stone, C.J., and Olshen, R. (1984). Classification and Regression Trees, Chapman and Hall\/CRC."},{"key":"ref_16","doi-asserted-by":"crossref","unstructured":"Zhang, Y., Bi, S., Dong, M., and Liu, Y. (2018, January 12\u201315). The Implementation of CNN-Based Object Detector on ARM Embedded Platforms. Proceedings of the 2018 IEEE 16th Intl Conf on Dependable, Autonomic and Secure Computing, Athens, Greece.","DOI":"10.1109\/DASC\/PiCom\/DataCom\/CyberSciTec.2018.00074"},{"key":"ref_17","doi-asserted-by":"crossref","unstructured":"Yazici, M.T., Basurra, S., and Gaber, M.M. (2018). Edge Machine learning: Enabling smart Internet of Things applications. Big Data Cogn. Comput., 2.","DOI":"10.3390\/bdcc2030026"},{"key":"ref_18","unstructured":"(2020, February 10). Embedded Machine Learning on 8-Bit Microcontrollers, Including Arduino\u2014Hackster.io. Available online: http:\/\/www.hackster.io\/news\/embedded-machine-learning-on-8-bit-microcontrollers-includingarduino-783155e7a135."},{"key":"ref_19","doi-asserted-by":"crossref","unstructured":"Cerutti, G., Prasad, R., and Farella, E. (2019, January 12\u201317). Convolutional Neural Network on Embedded Platform for People Presence Detection in Low Resolution Thermal Images. Proceedings of the ICASSP, IEEE International Conference on Acoustics, Speech and Signal Processing, Brighton, UK.","DOI":"10.1109\/ICASSP.2019.8682998"},{"key":"ref_20","unstructured":"(2020, February 11). Frequently Asked Questions | Coral. Available online: http:\/\/www.coral.ai\/docs\/edgetpu\/faq\/."},{"key":"ref_21","unstructured":"(2020, February 11). Edge TPU Python API Overview | Coral. Available online: http:\/\/www.coral.ai\/docs\/edgetpu\/api-intro."},{"key":"ref_22","unstructured":"Kusupati, A., Singh, M., Bhatia, K., Kumar, A., Jain, P., and Varma, M. (2018, January 3\u20138). FastGRNN: A Fast, Accurate, Stable and Tiny Kilobyte Sized Gated Recurrent Neural Network. Proceedings of the 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montr\u00e9al, QC, Canada."},{"key":"ref_23","doi-asserted-by":"crossref","unstructured":"Gopinath, S., Ghanathe, N., Seshadri, V., and Sharma, R. (2019, January 22\u201326). Compiling KB-Sized Machine Learning Models to Tiny IoT Devices. Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2019), Phoenix, AZ, USA.","DOI":"10.1145\/3314221.3314597"},{"key":"ref_24","unstructured":"(2020, February 10). AWS Greengrass Machine Learning Inference\u2014Amazon Web Services. Available online: http:\/\/www.aws. amazon.com\/greengrass\/ml\/."},{"key":"ref_25","doi-asserted-by":"crossref","unstructured":"Ghosh, A.M., and Grolinger, K. (2019, January 5\u20138). Deep Learning: Edge-Cloud Data Analytics for IoT. Proceedings of the IEEE Canadian Conference of Electrical and Computer Engineering (CCECE), Edmonton, AB, Canada.","DOI":"10.1109\/CCECE.2019.8861806"},{"key":"ref_26","unstructured":"(2020, February 12). AI Technology Helping Asthma Sufferers Breathe Easier\u2014Hackster.io. Available online: http:\/\/www.hackster.io\/news\/ai-technology-helping-asthma-sufferers-breathe-easier-50775aa7b89f."},{"key":"ref_27","doi-asserted-by":"crossref","unstructured":"Magno, M., Cavigelli, L., Mayer, P., von Hagen, F., and Luca Benini, F. (2019, January 15\u201318). Fanncortexm: An open source toolkit for deployment of multi-layer neural networks on arm cortex-m family microcontrollers: Performance analysis with stress detection. Proceedings of the IEEE 5th World Forum on Internet of Things, Limerick, Ireland.","DOI":"10.1109\/WF-IoT.2019.8767290"},{"key":"ref_28","doi-asserted-by":"crossref","unstructured":"Magno, M., Pritz, M., Mayer, P., and Benini, L. (2017, January 15\u201316). DeepEmote: Towards Multi-Layer Neural Networks in a Low Power Wearable Multi-Sensors Bracelet. Proceedings of the 7th IEEE International Workshop on Advances in Sensors and Interfaces (IWASI), Vieste, Italy.","DOI":"10.1109\/IWASI.2017.7974208"},{"key":"ref_29","unstructured":"(2020, February 12). FidoProject\/Fido: A lightweight C++ Machine Learning Library for Embedded Electronics and Robotics. Available online: http:\/\/www.github.com\/FidoProject\/Fido."},{"key":"ref_30","doi-asserted-by":"crossref","unstructured":"Alameh, M., Abbass, Y., Ibrahim, A., and Valle, M. (2019). Smart tactile sensing systems based on embedded CNN implementations. Micromachines, 11.","DOI":"10.3390\/mi11010103"},{"key":"ref_31","doi-asserted-by":"crossref","unstructured":"Sharma, R., Biookaghazadeh, S., Li, B., and Zhao, M. (2018, January 2\u20137). Are Existing Knowledge Transfer Techniques Effective for Deep Learning with Edge Devices?. Proceedings of the 2018 IEEE International Conference on Edge Computing (EDGE), San Francisco, CA, USA.","DOI":"10.1109\/EDGE.2018.00013"},{"key":"ref_32","unstructured":"(2020, March 02). Scikit-Learn: Machine Learning in Python\u2014Scikit-Learn 0.22.1 Documentation. Available online: http:\/\/www.scikit-learn.org\/stable\/."},{"key":"ref_33","unstructured":"(2020, March 02). Home\u2014Keras Documentation. Available online: http:\/\/www.keras.io\/."},{"key":"ref_34","doi-asserted-by":"crossref","unstructured":"Bottou, L., Chapelle, O., DeCoste, D., and Weston, J. (2007). Scaling learning algorithms towards AI. Large Scale Kernel Machines, MIT Press.","DOI":"10.7551\/mitpress\/7496.001.0001"},{"key":"ref_35","unstructured":"Kingma, D.P., and Ba, L.J. (2020, April 24). Adam: A Method for Stochastic Optimization. Available online: https:\/\/arxiv.org\/abs\/1412.6980."},{"key":"ref_36","unstructured":"(2020, March 02). The HDF5 Group. Available online: https:\/\/www.hdfgroup.org\/solutions\/hdf5."},{"key":"ref_37","unstructured":"STMicroelectronics (2020, April 24). Getting Started with X-CUBE-AI Expansion Package for Artificial Intelligence (AI) User Manual | Enhanced Reader. Available online: https:\/\/www.st.com\/en\/embedded-software\/x-cube-ai.html."},{"key":"ref_38","unstructured":"(2020, March 04). Parameters | SVMS.org. Available online: http:\/\/www.svms.org\/parameters\/."},{"key":"ref_39","unstructured":"(2020, February 13). STM32 High Performance Microcontrollers (MCUs)\u2014STMicroelectronics. Available online: http:\/\/www.st.com\/en\/microcontrollers-microprocessors\/stm32-high-performance-mcus.html."},{"key":"ref_40","unstructured":"(2020, February 13). STM32H7\u2014Arm Cortex-M7 and Cortex-M4 MCUs (480 MHz)\u2014STMicroelectronics. Available online: http: \/\/www.st.com\/en\/microcontrollers-microprocessors\/stm32h7-series.html."},{"key":"ref_41","unstructured":"(2020, February 13). STM32L4\u2014ARM Cortex-M4 ultra-low-power MCUs\u2014STMicroelectronics. Available online: http:\/\/www.st.com\/en\/microcontrollers-microprocessors\/stm32l4-series.html."},{"key":"ref_42","unstructured":"(2020, February 13). Heart Disease UCI | Kaggle. Available online: http:\/\/www.kaggle.com\/ronitf\/heart-disease-uci."},{"key":"ref_43","doi-asserted-by":"crossref","first-page":"e3225","DOI":"10.1002\/dac.3225","article-title":"Statistical fingerprint\u2014Based intrusion detection system (SF-IDS)","volume":"30","author":"Boero","year":"2017","journal-title":"Int. J. Commun. Syst."},{"key":"ref_44","doi-asserted-by":"crossref","unstructured":"Fausto, A., and Marchese, M. (2019, January 27\u201329). Implementation Details to Reduce the Latency of an SDN Statistical Fingerprint-Based IDS. Proceedings of the IEEE International Symposium on Advanced Electrical and Communication Technologies (ISAECT), Rome, Italy.","DOI":"10.1109\/ISAECT47714.2019.9069714"},{"key":"ref_45","doi-asserted-by":"crossref","unstructured":"Falbo, V., Apicella, T., Aurioso, D., Danese, L., Bellotti, F., Berta, R., and Gloria, A.D. (2019, January 26\u201327). Analyzing Machine Learning on Mainstream Microcontrollers. Proceedings of the International Conference on Applications in Electronics Pervading Industry Environment and Society (ApplePies 2019), Pisa, Italy.","DOI":"10.1007\/978-3-030-37277-4_12"},{"key":"ref_46","unstructured":"(2020, February 13). Benchmark Datasets Used for Classification: Comparison of Results. Available online: http:\/\/www.fizyka.umk.pl\/kis-old\/projects\/datasets.html#Sonar."},{"key":"ref_47","doi-asserted-by":"crossref","unstructured":"Parodi, A., Bellotti, F., Berta, R., and Gloria, A.D. (2018, January 26\u201327). Developing a machine learning library for microcontrollers. Proceedings of the International Conference on Applications in Electronics Pervading Industry, Environment and Society, Pisa, Italy.","DOI":"10.1007\/978-3-030-11973-7_36"},{"key":"ref_48","unstructured":"(2020, February 13). Traffic, Driving Style and Road Surface Condition | Kaggle. Available online: http:\/\/www.kaggle.com\/gloseto\/traffic-driving-style-road-surface-condition."},{"key":"ref_49","unstructured":"(2020, February 13). EnviroCar\u2014Datasets\u2014The Datahub. Available online: http:\/\/www.old.datahub.io\/dataset\/envirocar."},{"key":"ref_50","doi-asserted-by":"crossref","first-page":"45","DOI":"10.17083\/ijsg.v5i4.266","article-title":"A fuzzy logic module to estimate a driver\u2019s fuel consumption for reality-enhanced serious games","volume":"5","author":"Massoud","year":"2018","journal-title":"Int. J. Serious Games"},{"key":"ref_51","doi-asserted-by":"crossref","unstructured":"Liapis, A., Yannakakis, G., Gentile, M., and Ninaus, M. (2019). Towards a reality-enhanced serious game to promote eco-driving in the wild. Games and Learning Alliance. GALA 2019, Springer.","DOI":"10.1007\/978-3-030-34350-7"},{"key":"ref_52","unstructured":"(2020, February 13). Search for and download air quality data | NSW Dept of Planning, Industry and Environment, Available online: http:\/\/www.dpie.nsw.gov.au\/air-quality\/search-for-and-download-air-quality-data."},{"key":"ref_53","unstructured":"Ioffe, S., and Szegedy, C. (2020, February 17). Batch Normalization: Accelerating Deep Network Training by Reducing Internal474Covariate Shift; 2015. Available online: https:\/\/dblp.uni-trier.de\/rec\/html\/conf\/icml\/IoffeS15."},{"key":"ref_54","unstructured":"(2020, February 17). Sklearn.Preprocessing Data\u2014Scikit-Learn 0.22.2 Documentation. Available online: https:\/\/scikit-learn.org\/stable\/modules\/preprocessing.html."},{"key":"ref_55","unstructured":"(2020, February 17). Decision Trees: How to Optimize My Decision-Making Process. Available online: http:\/\/www.medium.com\/cracking-the-data-science-interview\/decision-trees-how-to-optimize-my-decision-making-process- e1f327999c7a."},{"key":"ref_56","unstructured":"Sklearn (2020, February 17). Decomposition.PCA\u2014Scikit-Learn 0.22.1 Documentation. Available online: http:\/\/www.scikit-learn.org\/stable\/modules\/generated\/sklearn.decomposition.PCA.html."},{"key":"ref_57","doi-asserted-by":"crossref","first-page":"709","DOI":"10.1109\/TNNLS.2015.2427333","article-title":"A simple method for solving the SVM regularization path for semidefinite kernels","volume":"27","author":"Sentelle","year":"2015","journal-title":"IEEE Trans. Neural Netw. Learn. Syst."}],"container-title":["Sensors"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/1424-8220\/20\/9\/2638\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,13]],"date-time":"2025-10-13T14:09:58Z","timestamp":1760364598000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/1424-8220\/20\/9\/2638"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2020,5,5]]},"references-count":57,"journal-issue":{"issue":"9","published-online":{"date-parts":[[2020,5]]}},"alternative-id":["s20092638"],"URL":"https:\/\/doi.org\/10.3390\/s20092638","relation":{},"ISSN":["1424-8220"],"issn-type":[{"value":"1424-8220","type":"electronic"}],"subject":[],"published":{"date-parts":[[2020,5,5]]}}}