TinyML Overview

developer_board

What is TinyML?

TinyML Definition

TinyML is the practice of training, compressing, and deploying machine learning models on microcontrollers (MCUs) — devices with as little as 2 KB of RAM and 16 KB of Flash, running on microwatt budgets. The goal is always-on, battery-powered intelligence at the sensor.

Key Features
  • Target: Cortex-M, RISC-V, AVR, Xtensa MCUs
  • RAM budget: 2 KB – 512 KB
  • Flash budget: 16 KB – 2 MB
  • Power: typically < 1 mW during inference
  • No operating system required
Similar Technologies
Edge AI (RPi, Jetson)Mobile AI (iOS, Android)Cloud inference
Why Microcontrollers?

MCUs are the most abundant compute platform on Earth — billions ship per year in sensors, appliances, wearables, and industrial equipment. Bringing ML to MCUs unlocks intelligence at zero connectivity cost, long battery life, and privacy-preserving local inference.

Key Features
  • Cost: $0.50 – $5 per unit
  • Battery: months to years on a coin cell
  • Always-on keyword detect at <1 mW
  • No cloud dependency or data egress
  • Deterministic, hard real-time capable
Similar Technologies
Single-board computersFPGAsCustom ASICs
Inference vs Training on MCU

Almost all TinyML work runs inference only on the MCU — training happens on a workstation or cloud with standard frameworks. A few research projects explore on-device fine-tuning (backprop on MCU) but RAM demands make full training impractical today.

Key Features
  • Inference: fully practical on MCU
  • Fine-tuning: possible on larger MCUs (>256 KB RAM)
  • Full training: not feasible on MCU
  • Transfer learning done off-device
  • Personalization via federated or split learning
Similar Technologies
On-device training (mobile)Federated learningSplit inference
Accuracy–Memory–Latency Trade-off

Every TinyML design navigates a three-way tension. Shrinking the model to fit RAM reduces accuracy. Reducing quantization bit-width saves memory and speeds up integer ops but hurts accuracy. Understanding your accuracy floor and latency ceiling determines which compression techniques to apply.

Key Features
  • Profile target MCU RAM/Flash first
  • Set minimum acceptable accuracy threshold
  • Establish latency budget from application
  • Iterate: quantize → prune → distill as needed
  • Benchmark on real hardware, not simulator
Similar Technologies
Hierarchical inferenceCascaded modelsFeature reduction
change_history

The TinyML Constraint Triangle

ConstraintTypical Budget (MCU)Typical Budget (Mobile)Primary Lever
Flash (model storage)16 KB – 1 MB10 – 200 MBQuantization, pruning
RAM (activations)2 KB – 256 KB256 MB – 4 GBLayer-by-layer scheduling, streaming
Power (inference)1 µW – 1 mW100 mW – 2 WClock gating, duty cycling, int ops
Latency1 ms – 500 ms<100 msModel architecture, CMSIS-NN kernels
AccuracyModerate (task-specific)HighData quality, distillation
compare

TinyML vs Edge AI vs Cloud AI

DimensionTinyML (MCU)Edge AI (SBC / NPU)Cloud AI
ComputeMHz CPUs, no OSGHz CPUs + NPU/GPUDatacenter GPUs/TPUs
PowerµW – mW0.5 – 10 WHundreds of watts
Battery lifeMonths – yearsHours – daysN/A (plugged)
Model sizeKB rangeMB – hundreds MBGB – TB (LLMs)
Connectivity requiredNoneOptionalAlways
Latencyms (local)ms (local)50 – 500 ms (network)
Unit cost$1 – $10$10 – $200Pay-per-inference
lightbulb

TinyML Design Principles

Memory-First Design

Size the model to the RAM constraint before optimizing for accuracy. Activation memory (intermediate tensors) often exceeds weight memory. Use streaming/tiling to process inputs in chunks.

Key Features
  • Profile activation RAM, not just weights
  • Depthwise-separable convolutions save RAM
  • Single-buffer scheduling reuses memory
  • Avoid residual connections that double buffer
Integer-Only Arithmetic

Most MCUs lack an FPU or have a very slow one. INT8 inference runs 4–8× faster than FP32 and consumes significantly less power. Quantization-aware training preserves accuracy while enabling integer-only kernels.

Key Features
  • INT8 is the TinyML workhorse
  • INT4 / binary for extreme constraints
  • CMSIS-NN provides optimised ARM kernels
  • No FP required at inference time
Duty-Cycling & Wake Words

Run a tiny always-on detector (keyword spotter, motion trigger) that wakes a more capable stage only when needed. Two-stage inference lets the system sleep >99% of the time and dramatically extends battery life.

Key Features
  • Stage 1: µW always-on detector
  • Stage 2: full inference on trigger
  • Sensor hardware gating (PDM mic, accelerometer)
  • Sleep modes between inference windows
Hardware-Aware Training

Co-design the model architecture with the target hardware. Use Neural Architecture Search (NAS) constrained by MCU FLOP and memory budgets. Train with quantization from the start rather than applying it post-hoc.

Key Features
  • MCUNet / MicroNAS for automated search
  • Quantization-aware training (QAT)
  • Target FLOP count from day one
  • Validate on-device, not just simulator