ML-MCU: A Framework to Train ML Classifiers on MCU-Based IoT Edge Devices

The majority of IoT edge devices are embedded systems with a tiny microcontroller unit (MCU), which acts as its brain. When users want their edge devices to continuously improve for better edge-analytics results, there is a need to equip their devices with algorithms that can learn/train from the continuously evolving real-world data. Currently, such devices are not capable of executing any Machine Learning (ML)-based model training tasks due to their resource constraints such as: limited memory (SRAM, Flash and EEPROM), low operations per second, its inability to perform parallel processing, etc. In this paper, we provide ML-MCU, a framework with our novel Opt-SGD and Opt-OVO algorithms to enable both binary and multi-class ML classifier training directly on MCUs. Thus, ML-MCU enables billions of MCU-based IoT edge devices to self learn/train (offline) after their deployment, using live data from a wide range of IoT use-cases. When evaluating our algorithms on multiple popular MCUs, using various datasets of different sizes and feature dimensions, one of the most exciting findings was, our Opt-OVO algorithm trained a multi-class classifier using a dataset of size 1250 and class count 50, on a $3 resourceconstrained MCU and also performed onboard unit inference for the same 50 class data in super real-time (6.2 ms).