Introducing AIfES – A TinyML Framework for Machine Learning on Arduino Microcontrollers
AIfES, short for Artificial Intelligence for Embedded Systems, is a new open-source machine learning framework for microcontrollers developed by the Fraunhofer Institute for Microelectronic Circuits and Systems (IMS). Join us in this article to find out just what this means for tinyML and embedded machine learning!
What does AIfES bring to the table?
AIfES is a platform-independent and standalone AI framework, much like the popular Python frameworks TensorFlow, PyTorch & Keras.
AIfES currently includes implementations of feedforward neural networks that can be freely configured, along with common activation functions like ReLu, sigmoid and softmax, as well as the usual training tools found in other frameworks like Stochastic Gradient Descent (SGD) and the adam optimiser – with more to come.
Written fully in C, AIfES yields lightweight and efficient performance, allowing even low-end 8-bit microcontrollers such as the Arduino Uno to run neural networks. In addition, because it uses only standard libraries based on the GNU Compiler Collection (GCC), AIfES can also run on almost any kind of hardware, from microcontrollers like the Arduino to SBCs and even mobile phones!
While embedded machine learning on microcontrollers has leap-frogged in recent years, AIfES improves on two specific pain points:
- Machine learning models must be trained off-device on a separate computer. On-device training and tuning is not possible.
- Most tinyML implementations are merely optimised versions of their heavier counterparts, meaning that relatively powerful microcontrollers are still needed to run machine learning models effectively.
AIfES will allow local, on-device training on microcontroller devices, which is huge for edge computing!
The benefits of edge computing are well-known by many, but what AIfES offers is an even greater means of distributed computing. Now, even your tiny, battery-powered microcontrollers can process data, learn from it, and improve its own processes all by itself!
Platform Independent & Modular for Flexible Use
AIfES is platform independent, meaning that you can easily import the structure and weights of a model trained in another framework for further training and deployment. At the same time, a single device can load in different models at runtime, or send model information to the cloud to share with other different devices – enabling a wide variety of possibilities for edge deployment!
In addition to being optimised for microcontrollers, AIfES also includes memory management features, such as the ability to define the amount of memory that is allocated to the machine learning model. It has also been developed in a modular way to take advantage of accelerated hardware available on specific processor families; for instance, it can utilise the CMSIS DSP properties of the ARM Cortex controllers for faster deep learning inference.
AIfES Framework in Action
AIfES has been in development for awhile, and there’s been several exciting examples of it in action. For example, check out this handwriting recognition system that runs on an Arduino Uno, or this gesture recognition system – all running on and enabled by AIfES!
A more notable demonstration, however, is none other than this gesture recognition system that was entirely trained on an Arduino Nano 33 BLE Sense itself, with none other than AIfES! In the video below, the data processing occurs entirely in the microcontroller: When a “1” is drawn, the corresponding command is sent to the robotic arm!
Getting Started
AIfES is available under a dual license model, the full details of which you can view on their GitHub page. The good news is that the framework is free to use for developers and private projects, so you can get your hands on it to experiment at no cost.
If you’re keen to know more about the brand new AIfES embedded machine learning framework, check out their Arduino GitHub repository or download it from the Arduino library manager and start tinkering!
To get started, AIfES also includes many examples that can be run on Arduino-compatible microcontrollers. Apart from inference and training, they also show you how to import an existing model from other frameworks, namely Keras. View them here!