TinyML and Edge Inference
TinyML runs machine learning inference on microcontrollers and other tiny, low-power chips. You use it when a device must classify sound, motion, or images on the sensor itself, on milliwatts of power and kilobytes of memory, without sending data to a server.
itComputer architecture and hardware | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — TinyML and Edge Inference
TinyML is machine learning that runs on the chip inside a sensor rather than in a data center. Not a smaller cloud. A different address: the same microcontroller that reads your sensor now makes the decision about what the sensor is seeing, on kilobytes of memory and battery power measured in milliwatts.
The problem it exists to solve is the radio. Sending data costs far more energy than computing on it: a CPU operation is picojoules, while even a polite Wi-Fi radio draws tens of milliwatts when active. Before TinyML, an always-on device that needed a decision either streamed raw sensor data to a server and paid for the network trip, or shipped without intelligence at all. Inference on the device reads the sensor, computes for a few milliseconds, and transmits only a summary when something happens. Privacy, latency, and offline survival all improve for the same reason: the network is no longer in the path.
The three ideas everything else hangs off:
The model must fit. Embedded processors trail their mobile cousins by at least 100 to 1,000 times in compute, memory, and power. Training stays on your workstation, where backpropagation is affordable. Only a converted, quantized model ships to the device.
Quantization does the heavy lifting. Converting 32-bit floats to 8-bit integers shrinks the model to roughly a quarter of its size and runs faster on cores without a floating-point unit. The converter learns each tensor's numeric range from a small calibration set, then evaluates accuracy afterward; if the score holds, you ship.
The tensor arena is the budget. The runtime allocates every input, output, and intermediate tensor from one preallocated buffer that you size before building. Too small, allocation fails. Too large, you waste the one resource you cannot afford to waste. Recording builds report the exact usage, so you measure rather than guess.
The surprise: the pipeline is dull on purpose, and that is good news. Train, convert to a compact format, quantize to int8, embed the bytes as a C array in flash, invoke. The reference runtime, LiteRT for Microcontrollers, keeps its core interpreter around 16 KB, needs no operating system, and runs the same four stages on every board. The dullness means one mental model transfers across silicon vendors. What actually eats your schedule is the step nobody markets: collecting representative sensor data. The model is usually the smaller half of the work.
If a week from now you remember nothing else, remember the pattern: tiny model, always-on sensor, no radio beats big model, cloud round trip, battery death. Keyword spotting, motion classification, visual wake words, and anomaly detection all follow it.
What to read next: the Intro gives the full map, from constraints through lifecycle. The Cheatsheet holds the quantization contract and the interpreter call sequence used in real firmware. The practice session walks the hello_world build and the arena measurement. Landscape shows the runtime market if you are deciding what to adopt. Skip the Timeline when making adoption decisions; read it to feel how young the field is, which is young.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://ai.google.dev/edge/litert/microcontrollers/overview
Supports
- LiteRT for Microcontrollers formerly TensorFlow Lite for Microcontrollers
- Core runtime fits in 16 KB on Arm Cortex-M3
- No OS support, no standard C/C++ libraries, no dynamic memory allocation
- Tested on Arm Cortex-M series and ported to ESP32
- Four-stage deploy workflow train, convert, quantize, embed and run
- Person-detection example and keyword-spotting style workloads
- Quiz questions on TinyML constraints, tensor arena role, and on-device energy
- https://ai.google.dev/edge/litert/microcontrollers/get_started
Supports
- Official hello_world walkthrough of MicroMutableOpResolver, AllocateTensors, Invoke
- Explicit operator registration to keep flash footprint small
- Host-to-target deployment shape used in practice reference and exercise
- Quiz questions on op resolver and host-vs-target allocation failures
- https://ai.google.dev/edge/litert/performance/quantization_spec
Supports
- Formula real_value = (int8_value - zero_point) * scale
- Weights int8 per-axis or per-tensor in [-127, 127] with zero-point 0
- Activations int8 per-tensor in [-128, 127] with zero-point in [-128, 127]
- Float32 to int8 shrinks model size roughly 4x and enables integer math
- Calibration via representative dataset and need to re-evaluate accuracy
- Quiz questions on quantization benefits, calibration, and field outliers
- https://github.com/tensorflow/tflite-micro
Supports
- Canonical TFLM / LiteRT Micro source tree, kernels, and examples
- Standalone repository created April 2021 after the system paper
- Makefile uses -std=c++17 for the C++ interpreter path
- hello_world, person_detection, CMSIS-NN, and Ethos-U example targets
- https://github.com/tensorflow/tflite-micro/blob/main/tensorflow/lite/micro/docs/memory_management.md
Supports
- Tensor arena as preallocated buffer for inputs, outputs, and intermediates
- RecordingMicroAllocator / recording builds report exact arena usage
- AllocateTensors failure when arena is too small
- Quiz questions on arena purpose and host-vs-target RAM mismatch
- https://github.com/tensorflow/tflite-micro/blob/main/tensorflow/lite/micro/examples/person_detection/README.md
Supports
- Person-detection example runs a ~250 KB network for person presence
- https://github.com/tensorflow/tflite-micro/blob/main/tensorflow/lite/micro/examples/hello_world/hello_world_test.cc
Supports
- hello_world float and int8 paths with abs(sin(x) - y_pred) <= 0.05 tolerance
- Dequantize formula used before comparing int8 outputs
- Practice-reference and exercise numerical checks
- https://github.com/tensorflow/tflite-micro/blob/main/tensorflow/lite/micro/tools/make/Makefile
Supports
- make -f tensorflow/lite/micro/tools/make/Makefile test and generate_projects targets
- OPTIMIZED_KERNEL_DIR=cmsis_nn and TARGET/TARGET_ARCH build flags
- CXXFLAGS include -std=c++17
- https://github.com/tensorflow/tflite-micro/blob/main/tensorflow/lite/micro/kernels/cmsis_nn/README.md
Supports
- OPTIMIZED_KERNEL_DIR=cmsis_nn swaps in Arm optimized kernels
- Cortex-M generic and Corstone-300 build examples
- https://github.com/tensorflow/tflite-micro/blob/main/tensorflow/lite/micro/kernels/ethos_u/README.md
Supports
- CO_PROCESSOR=ethos_u enables Ethos-U software stack
- Vela inserts Ethos-U custom op; TFLM dispatches mid-graph
- Quiz question on Vela compiling quantized graphs to Ethos-U command streams
- https://arxiv.org/abs/2010.08678
Supports
- Embedded processors trail mobile counterparts by about 100 to 1,000x in compute, memory, and power
- Inference framework must operate in a few kilobytes without dynamic allocation or virtual memory
- TFLM architecture and allocation strategy described in the Oct 2020 system paper
- Timeline event for TFLM paper and later standalone repository
- https://developers.googleblog.com/tensorflow-lite-is-now-litert/
Supports
- TensorFlow Lite renamed LiteRT on 4 Sep 2024 under Google AI Edge
- Multi-framework deployment vision including PyTorch, JAX, and Keras
- .tflite format retained
- https://petewarden.com/2018/06/11/why-the-future-of-machine-learning-is-tiny/
Supports
- Energy argument for on-device inference versus always-on radios
- Radios draw tens to hundreds of milliwatts; CPUs and sensors can scale to microwatts
- Picojoules-per-op framing for compute versus communication cost
- Timeline event June 2018 and quiz energy-budget question
- https://github.com/ARM-software/CMSIS-NN
Supports
- Arm CMSIS-NN integer kernels for Cortex-M
- Bit-exact with TensorFlow Lite / TFLM reference kernels (follows TFLM when TFL and TFLM differ)
- Per-core tuning including DSP and MVE paths
- Landscape and cheatsheet CMSIS-NN runtime selection
- https://arxiv.org/abs/1801.06601
Supports
- CMSIS-NN kernels paper reporting about 4.6x throughput improvement on Cortex-M
- Timeline precursor event for efficient NN kernels on microcontrollers
- https://arxiv.org/abs/1711.07128
Supports
- Keyword spotting on microcontrollers with tens of kilobytes of memory
- Timeline Hello Edge event and early always-on keyword-spotting pattern
- https://arxiv.org/abs/1502.02551
Supports
- Early limited-precision deep learning training and inference work (2015)
- Timeline precursor for quantization research
- https://docs.edgeimpulse.com/studio/projects/deployment/eon-compiler
Supports
- EON Compiler emits C++ source instead of interpreting a FlatBuffer
- Documented 25 to 65 percent less RAM versus TFLite / LiteRT interpreter path
- 10 to 35 percent less flash and same accuracy as TFLite
- Quiz trade-off between interpreter and EON codegen
- https://docs.edgeimpulse.com/knowledge/metrics/inference-performance
Supports
- Reference EON workloads continuous gestures 6.4K RAM / 42.5K ROM / 17 ms on M4F 80 MHz
- Keyword spotting MFCC 13, FFT 256 at 19.6K RAM / 47.3K ROM / 225 ms on M4F 80 MHz
- Image 32x32 gray 70.2K RAM / 164.2K ROM / 186 ms on M4F 80 MHz
- Image 96x96 color 297.0K RAM / 577.5K ROM / 140 ms on M7 480 MHz and 3 ms on M55+U55
- Cheatsheet reference-workload table and products Ethos-U55 latency claim context
- https://docs.edgeimpulse.com/
Supports
- Managed pipeline from data collection through exported C++ and Arduino libraries
- Per-target RAM, flash, and latency estimates before export
- https://docs.edgeimpulse.com/knowledge/concepts/lifecycle/lifecycle-management
Supports
- Model lifecycle, drift, and redeploy after field conditions change
- Quiz question on keyword-spotting misclassification after months in the field
- https://www.edgeimpulse.com/
Supports
- Edge Impulse Studio as managed embedded-ML platform product homepage
- Awesome-links and landscape entries
- https://www.edgeimpulse.com/about
Supports
- Zach Shelby and Jan Jongboom as founders
- Qualcomm Technologies acquisition in March 2025
- Timeline Qualcomm acquisition event
- Note founding year on this page is 2019 (timeline says 2020 Apr; needs correction elsewhere)
- https://www.arm.com/products/silicon-ip-cpu/ethos/ethos-u55
Supports
- Ethos-U55 microNPU for Cortex-M class systems
- Combined with Cortex-M55 marketed as up to 480x ML performance uplift
- Timeline Ethos-U55 announcement and landscape NPU category
- https://www.arm.com/products/silicon-ip-cpu/ethos/ethos-u85
Supports
- Ethos-U85 native transformer support
- Up to 4 TOPs at 1 GHz and about 20 percent better energy efficiency than U55/U65
- Field-notes shift card and timeline Ethos-U85 event
- https://pypi.org/project/ethos-u-vela/
Supports
- Vela compiler package for rewriting quantized TFLite/TOSA graphs to Ethos-U command streams
- Landscape compilers category
- https://www.st.com/en/microcontrollers-microprocessors/stm32n6-series.html
Supports
- STM32N6 Cortex-M55 at 800 MHz with ST Neural-ART NPU
- NPU clocked at 1 GHz providing up to 600 GOPS
- Timeline STM32N6 developer-kit era and field-notes NPU shift card
- https://www.st.com/en/development-tools/stm32cubeai.html
Supports
- STM32Cube.AI converter generating optimized C for STM32 devices
- Landscape converters and codegen category
- https://www.tensorflow.org/
Supports
- TensorFlow as training-side starting point and TFLiteConverter path
- https://pytorch.org/
Supports
- PyTorch as alternate training framework feeding conversion
- https://tvm.apache.org/
Supports
- Apache TVM compiler-driven optimization path including historical microTVM
- Landscape compilers category
- https://github.com/apache/tvm/pull/17554
Supports
- microTVM phased out of TVM development main (PR merged Dec 2024)
- Component remains in past releases only
- Corrects timeline date that currently says 2022 Jul
- https://github.com/sipeed/TinyMaix
Supports
- Core code under 3 KB; MNIST on Arduino ATmega328 with 2 KB RAM
- 48-chip benchmark claim in project README
- Cheatsheet, awesome links, and landscape extreme-constraint runtime
- https://github.com/emlearn/emlearn
Supports
- Export scikit-learn and Keras models to portable C99 without dynamic allocation
- From about 2 KB flash for classical ML and small MLPs
- https://github.com/majianjia/nnom
Supports
- Layer-based MCU neural library with CMSIS-NN support and Keras deployment path
- https://github.com/uTensor/uTensor
Supports
- Early Arm inference framework with roughly 2 KB core runtime
- Historical niche runtime listed in intro, awesome links, and landscape
- https://os.mbed.com/blog/entry/uTensor-and-TensorFlow-announcement/
Supports
- 2019 announcement that uTensor and TensorFlow Lite Micro efforts would merge
- https://openmv.io/
Supports
- OpenMV machine-vision camera platform with TFLite and NPU support
- Landscape vision hardware category
- https://github.com/openmv/openmv
Supports
- Open-source OpenMV firmware repository cited in awesome links
- https://coral.ai/
Supports
- Coral Edge TPU as upper-edge accelerator above MCU-class constraints
- https://onnxruntime.ai/
Supports
- ONNX Runtime for mobile and embedded Linux scale above bare-metal TinyML
- https://arxiv.org/abs/2007.10319
Supports
- MCUNet co-design of architectures and inference for ImageNet-scale MCU classification
- Timeline July 2020 event
- https://arxiv.org/abs/2206.15472
Supports
- On-device training / fine-tuning under a 256 KB memory ceiling
- Course limit that on-device training is research-grade, not production default
- Quiz question on why on-device training is rare in production
- https://arxiv.org/abs/2112.01319
Supports
- Systematic benchmarking of TinyML systems
- Reference-links advanced reading and timeline measurement phase
- https://arxiv.org/abs/2403.19076
Supports
- Survey of TinyML progress and futures for advanced study links
- https://arxiv.org/abs/2506.18927
Supports
- ACM-oriented survey from TinyML toward tiny deep learning
- https://arxiv.org/abs/2007.00500
Supports
- LeakyPick evaluated 8 voice-assistant devices
- Echo Dot falsely triggered on 89 different words causing unexpected audio streaming
- Field-notes privacy boundary card on wake-word leakage
- https://github.com/ShawnHymel/tinyml-example-anomaly-detection
Supports
- Hymel motor-fan anomaly-detection series as field-notes spine source
- https://www.digikey.com/en/maker/projects/edge-ai-anomaly-detection-part-1-data-collection/7bb112f76ef644edaedc5e08dba5faae
Supports
- Part 1 focuses on data collection before any model exists
- Field-notes spine card on schedule allocation
- https://www.digikey.com/en/maker/projects/edge-ai-anomaly-detection-part-4-machine-learning-on-esp32-via-arduino/afacfc3dbaf24c6c94a55c4afae1afb2
Supports
- Robustness failure after moving the accelerometer mount
- Advice to move the sensor during collection to span operating states
- Robust collection softens class separation and forces threshold retuning on site
- Field-notes difficulty, mistake, tradeoff, and signal cards
- https://en.wikipedia.org/wiki/TinyML
Supports
- Term popularized in 2019 with Warden and Situnayake TinyML book and TinyML Foundation
- Timeline O'Reilly TinyML book event
- https://en.wikipedia.org/wiki/TensorFlow
Supports
- TensorFlow Lite announced May 2017 with developer preview November 2017
- LiteRT rename and uTensor merge mentions used as secondary timeline anchors
- https://github.com/gigwegbe/tinyml-papers-and-projects
Supports
- Curated index of TinyML papers and projects for awesome links
- https://github.com/AI-in-Transportation-Lab/awesome-tinyml
Supports
- Awesome-list discovery of TinyML libraries and papers
- https://github.com/bhoke/awesome-embedded-ml
Supports
- Embedded ML model-zoo style discovery list
- https://larq.dev/
Supports
- Binarized neural network training library beyond int8 quantization
- https://github.com/espressif/esp-tflite-micro
Supports
- Espressif TFLite Micro component and ESP32 family examples
- https://www.edx.org/professional-certificate/harvardx-tiny-machine-learning
Supports
- HarvardX Tiny Machine Learning professional certificate with Arduino labs
- https://www.hackster.io/dmitrywat/tinyml-course-5-anomaly-detection-for-predictive-maintenance-9efa11
Supports
- Applied anomaly-detection predictive-maintenance tutorial with Edge Impulse
- https://www.tinyml.org/
Supports
- tinyML Foundation community and field naming context
- https://docs.arduino.cc/tutorials/nano-33-ble-sense/get-started-with-machine-learning
Supports
- Arduino official machine-learning getting-started path used in TinyML education stacks
