TinyMaix is a lightweight machine learning library for microcontrollers

Sipeed TinyMaix open-source machine learning library is designed for microcontrollers, and lightweight enough to run on a Microchip ATmega328 MCU found in the Arduino UNO board and its many clones.

Developed during a weekend hackathon, the core code of TinyMax is about 400 lines long, with a binary size of about 3KB, and low RAM usage, enabling it to run the MNIST handwritten digit classification on an ATmega320 MCU with just 2KB SRAM and 32KB flash.

TinyMaix machine learning Arduino

TinyMax highlights

  • Small footprint
    • Core code is less than 400 lines (tm_layers.c+tm_model.c+arch_O0.h), code .text section less than 3KB
    • Low RAM consumption, with the MNIST classification running on less than 1KB RAM
  • Support INT8/FP32 model, convert from keras h5 or tflite.
  • Support multi-architecture acceleration: ARM SIMD/NEON, MVEI, RV32P, RV64V (32-bit & 64-bit RISC-V vector extensions)
  • User-friendly interfaces, just load/run models
  • Supports full static memory config
  • MaixHub Online Model Training support coming soon

Sipeed says there are already machine learning libraries such as TensorFlow Lite for microcontrollers, microTVM, or NNoM but TinyMax aims to be a simpler TinyML library, does not use libraries like CMSIS-NN, and should take about 30 minutes to understand. Considering it can run on 8-bit microcontrollers, it might be more comparable to AIfES for Arduino which was made open-source by Fraunhofer IMS in July 2021.

Potential future features of TinyMaix include the INT16 quant model for higher accuracy and better support for SIMD/RV32P acceleration, at the cost of a higher footprint, Concat OPA for Mobilenet v2 support (but uses twice the memory and may be slow), and Winograd Convolution Optimization for higher inference speeds at the cost of an increase in RAM and memory bandwidth consumption.

You’ll find the source code and instructions to get started on the Github repository for the project.

Via Hackster.io

Share this:

Support CNX Software! Donate via PayPal or cryptocurrencies, become a Patron on Patreon, or buy review samples

ROCK Pi 4C Plus
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
2 Comments
oldest
newest
Iope
Iope
1 month ago

Great article thanks you

Alex
Alex
30 days ago

Promising library, definitely need to check it.

Advertisement