AdvancedTopic 89 of 104Electronics & Embedded

TinyML

Running machine-learning inference on microcontrollers.

In depth

TinyML runs quantised neural networks on microcontrollers in kilobytes of memory: keyword spotting, anomaly detection, gesture recognition. Workflow: collect data, train, quantise (int8), convert (TFLite Micro), deploy and test. Power in milliwatts.

Key points

  • Model size vs accuracy
  • CMSIS-NN
  • Always-on sensing
Example

A wake-word detector runs continuously on a coin-cell device.

Why it matters

TinyML brings machine learning to microcontrollers, which enables local sensing, such as detecting a sound or motion without the cloud.

Where this is used

  • Detecting a keyword in audio on a battery-powered device.
  • Recognising a gesture from an accelerometer on a wearable.
  • Detecting abnormal motor vibration with a small neural network.

Frequently asked questions

What is TinyML?

Running machine-learning inference on microcontrollers.

Why is it important to understand tinyML?

TinyML brings machine learning to microcontrollers, which enables local sensing, such as detecting a sound or motion without the cloud.

What limits TinyML?

Memory, compute and energy, so models must be small, quantised and carefully designed for the target device.

How are models run on microcontrollers?

They are trained on a computer, converted to a compact format, and executed by a small inference engine on the device.

How is TinyML used in practice?

Typical applications include detecting a keyword in audio on a battery-powered device, recognising a gesture from an accelerometer on a wearable and detecting abnormal motor vibration with a small neural network.

What should I learn before TinyML?

Study "Edge computing" first (topic 88 of 104 in Electronics & Embedded). It covers the groundwork this topic builds on.

What are the key points of TinyML?

Model size vs accuracy. CMSIS-NN. Always-on sensing.

Can you give an example of TinyML?

A wake-word detector runs continuously on a coin-cell device.

What comes after TinyML?

The next topic is "Digital signal processors", which builds directly on this one.

How difficult is TinyML?

It is classed as Advanced in Electronics & Embedded (topic 89 of 104). It is an advanced topic. It assumes you are comfortable with the intermediate topics in Electronics & Embedded.

Learning path

Want to practise? Open the interactive course for quick checks, quizzes, simulations and progress tracking.