Keyword spotting on a microcontroller

A small model that recognises two or three keywords on a microcontroller with a microphone, int8 quantized.

AdvancedAudio

Educational draft content that needs expert review before it is used as an academic reference. Specifications, versions and licences change; check the official source. No experimental result is shown here unless it was actually run.

A classic TinyML project: extract MFCC or mel features, run a small CNN, and deploy int8 on a microcontroller. It teaches the memory budget and latency on real hardware.

Hardware

  • Arduino Nano 33 BLE Sense (built-in microphone)
  • Or ESP32-S3 with an I2S microphone

Software

  • TensorFlow Lite for Microcontrollers
  • CMSIS-NN
  • Python

Architecture

Microphone → 1-second window → mel features → small int8 CNN → word probabilities + an "other" class.

Suggested datasets (check their licences)

  • Speech Commands (check the licence)
  • Your own recordings with the speakers' consent

Implementation steps

  1. Collect balanced data with a noise class and an "other" class
  2. Train a small CNN and measure it on a separate test set
  3. Quantize to int8 with a representative set
  4. Convert to a C array and embed it
  5. Measure memory and latency on the device

Expected deliverables

A microcontroller program that lights an indicator when it hears a word, with a memory and latency report.

Evaluation metrics

  • Precision and recall per class
  • False alarms per hour
  • Memory use and latency

Limits

  • Sensitive to noise and accents
  • Ready-made datasets may not represent your environment

Ideas to extend

  • Add a VAD before the model to save power
  • Try Arabic words
  • Compare with Edge Impulse

Do not record other people without their consent; do not store raw recordings unless necessary.

Image and audio processing in the experiments runs inside your browser. Your images and audio are never uploaded and conversations are not stored. Privacy