Introduction to tinyML

September 9, 2022 ยท View on GitHub

What is TinyML? TinyML is mostly meaning run deep learning model on MCUs.

If you are AI algorithm engineer, you may run models with 1M~1G params on server/PC/SBCs,
they have at least hundreds MB system memory,
it is hard to image running deep learning model on MCUs which have less 1MB ram.

If you are Embedded Engineer, you may want take advantages of deep learning in your offline or Bandwidth tension project,
but likely your project have Cost/Space/Power/Stable limit,
you can't switch to Expensive/Large/HighPowerConsumption/New platform.

TinyML is useful in those situation, it makes your MCU smarter in the edge.
The most common TinyML application scenarios are:

  1. KWS: Keyword Spotting, or Voice Wake Words, for voice control applications.
  2. VWW: Visual Wake Words, for video intrusion detection
  3. Image Classification: Identify different pictures and act accordingly
  4. Object Detection: Detect target object position
  5. Object Counting: Count target object
  6. Anomaly/Defect Detection: Recognize Anomaly/Defect feature in sensor data
  7. Feature Recognition: Recognize single-sensor or multi-sensor-fusing feature
  8. ...

Compare TinyML with other AI deploy platform

PlatformLevelAI-BoxAI-CameraAIoTTinyML
Storage MediaeMMC/SSDeMMC/Nand/NorNor/SIP FlashNor/SIP Flash
Storage Size>=8GB16MB~8GB1~16MB16KB~16MB
Memory MediaDDR4mostly DDR3SRAM/PSRAMSRAM/PSRAM
Memory Size>=2GB64MB~2GB0.5~64MB2KB~8MB
CPU Freq>=1.5G0.5~1.5G100~500M16~500M
Computing Power>=2TOPS0.2~1TOPS50~200GOPS<1GOPS
Deploy Languagepython/c++python/c++mpy/Cmostly C
Typical DeviceJetsonNanoRV1109 IPCBL808/K210ESP32/BL618
Typical Board Price>$100$20~$100$5~$20<$5
Typical Chip Price>$10$4~$10$2~$5$1~$3

Comparison of TinyML Inference Framework

NameModel TypeArch supportPortingCode SizeMemory SizeInfer TimeOther Feature
TinyMaixINT8/FP16/FP32/FP8*ARM SIMD/NEON/MVEI
RISC-V P/V extend
Easy3~10KB1.3~2X1.1~1.5Xsupport full static memory,
Maixhub online Model Training
NNoMINT8/INT16ARM SIMDEasy~10KB1.3~2X1.2~1.5Xsupport full static memory,RNN
tinyengineINT8/FP32ARM SIMDonly for ARM---1X1XStrong optimization for ARM,
on device training
MicroTVMINT8/FP32ARM SIMD------~3X1.2~2.5Xsupport autotune
CMSIS-NNINT8/INT16ARM SIMD/MVEonly for ARM---1.3~2X1.1~1.5X
TFlite-microINT8ARM SIMD/XtensaMedium20~100KB~2.5X~5X
NCNNINT8/FP32ARM SIMD/NEON/RVV/...Need code clipping200~1000KB------support many ops