Paper · 2026-06-16 · cs.LG, cs.AI, cs.AR, eess.AS, eess.SP
Embedded Machine Learning for Microcontroller-Class Edge Devices: Data, Feature, Evaluation, and Deployment Pipelines
Systems synthesis, with no experiments or measured results, of how to build an on-device ML pipeline for microcontrollers: fixed-rate sampling into bounded windows, features as compression (a 2 s accelerometer window to 33 RMS/PSD features), MFCCs into a small 1D CNN for keyword spotting, deployment metrics, quantized runtimes, and eight design rules.
Keyword spottingSpectrogramPost-training quantizationConvolutional neural networkembedded-mltinymlmicrocontrolleredge-inferencekeyword-spottingsurvey
AI-compiled by claude-haiku-5-5 on 2026-11-07, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
Running machine learning on a microcontroller, a small chip with little memory and often no operating system, means designing the whole path together. The device must read its sensor at a steady rate, cut the stream into fixed-size chunks, turn each chunk into a few useful numbers, run a small model, and turn the model's output into an action. The paper argues that the choices that generic introductions skip, such as how often to sample, how large the buffers are, how to split test data and how to shrink the model, decide whether the device works in the field.
It works through two examples: recognising hand motions from an accelerometer, and spotting a spoken keyword in sound. In both, raw signals are compressed into compact features before the model sees them. Accuracy alone is not enough to judge a model, and the deployed product includes its preprocessing and thresholds, not just the network. The paper ends with eight practical rules and a list of open problems.
TL;DR
A six-page systems synthesis with no experiments of its own. Use it as a checklist for an on-device classifier: fixed-rate sampling into bounded windows, compact features, validation split by session or user, quantized inference checked on the target hardware, and deployment metrics next to accuracy. Its two worked examples give input sizes and features, but no measured results and no training hyperparameters.
Problem
Generic ML introductions leave out the engineering choices that decide whether a model can run on a microcontroller: sampling, buffering, feature extraction, validation under class imbalance, model and runtime co-design, and streaming deployment p. 1. A microcontroller may run bare metal or a small real-time operating system, has no virtual memory, and has a few tens or hundreds of kilobytes of RAM p. 1. The paper treats embedded ML as a co-design problem across signal acquisition, feature representation, architecture, runtime and application logic p. 1 fig. 1.
The paper's assumptions: the target is a microcontroller-class device rather than a single-board computer p. 1 p. 2, and the deployed system is closed loop, so field observations feed back into data collection and model revision fig. 1 p. 1.
Headings in this paper are unnumbered, so citations give PDF page numbers.
Method
The paper gives no new algorithm. It describes a six-stage lifecycle (Fig. 1): acquire sensor data, preprocess and window, extract compact features, train and validate, deploy the runtime, and monitor and update fig. 1 p. 1. Its two signal paths are summarised below.
Input size of a windowed pipeline p. 2
The raw input size of a windowed sensor pipeline is the sampling frequency times the window length times the number of channels:
N_{raw} = f_s \cdot T \cdot C p. 2
where f_s is the sampling frequency, T is the window length in seconds and C is the number of channels p. 2. The inertial example gives 375 raw values for 62.5 Hz over 2 s on three axes. At 16 bits per value, the raw buffer alone is 750 bytes, before double buffering, feature memory, weights, activations and the runtime arena p. 2.
Sampling and buffering p. 4 tab. 3 fig. 2
- At 62.5 Hz the device takes one sample every 16 ms p. 4.
- Sampling can be paced by a timer interrupt, an RTOS task or DMA tab. 3 fig. 2.
- Inference runs on a completed buffer while acquisition fills the next one p. 4. Rolling buffers or double or triple buffers are the options in tab. 3.
- If feature extraction plus inference takes longer than the window stride, the system drops samples, adds latency or must reduce model cost p. 4.
Inertial path p. 2 fig. 2 tab. 1
- Accumulate three-axis accelerometer samples into bounded buffers fig. 2.
- Compute, per axis, one RMS value, three peak amplitudes, three peak frequencies and four spectral-band powers (PSD) p. 2. That is 11 values per axis and 33 in total p. 2 fig. 2.
- Classify the 33-value vector with a small dense network and a Softmax output tab. 1 p. 3.
Peak-detection rules and band edges are not stated.
Audio path p. 2 p. 3 fig. 3 tab. 1
- Band-limit the microphone signal before or around the ADC to avoid aliasing. The sampling rate must exceed twice the highest relevant frequency component, and the paper motivates a kilohertz-scale rate for voice p. 2. The example uses a 16 kHz ADC stream fig. 3.
- Compute a short-time Fourier transform or spectrogram of the signal p. 2.
- Compute mel-frequency cepstral coefficients (MFCCs): mel-spaced filterbank, logarithm and discrete cosine transform p. 2. A one-second window becomes a 49 × 13 matrix (frames by coefficients) fig. 3 tab. 1.
- Run one or more one-dimensional convolution and max-pooling blocks, flatten, and apply a Softmax over noise, unknown and target keywords p. 3.
Frame length, hop size and number of mel filters are not stated.
Streaming keyword spotting p. 3 p. 4 fig. 3
Fig. 3 and the text describe a streaming update: keep the most recent MFCC frames, drop the oldest chunk and insert the newest, so the MFCC matrix is not recomputed in full fig. 3 p. 4. The reconstruction below is ours, and its helper names are not the paper's.
# Streaming keyword-spotting loop [fig. 3] [p. 3] [p. 4]
# Input: anti-aliased samples at a fixed rate (16 kHz in fig. 3)
# Output: class scores, one set per update
def stream_keyword_spotting(chunks, model):
# 1. Hold the last 1 s of MFCC frames, 49 by 13 [fig. 3] [tab. 1]
mfcc_matrix = empty_matrix(49, 13) # (frames, coefficients)
for chunk in chunks:
# 2. Compute MFCCs for the new chunk only [p. 2] [p. 4]
new_frames = mfcc(chunk)
# 3. Drop the oldest frames and append the newest [fig. 3] [p. 4]
mfcc_matrix = slide(mfcc_matrix, new_frames)
# 4. Run the compact 1D CNN and the Softmax [p. 3]
scores = model(mfcc_matrix)
yield scoresProbability-to-action logic p. 3 p. 4
- A Softmax output is a normalised score, not a calibrated probability p. 3.
- The application sets a decision rule. Example: trigger an action only if P(left-right) > 0.5 or P(circle) > 0.8 p. 3.
- Options named for a set of class scores: pick the maximum, apply class-specific thresholds, require repeated agreement across windows, or enter an anomaly state when no class reaches a minimum confidence p. 4.
- Worked example output: P(left-right) = 0.9143, P(up-down) = 0.0032, P(circle) = 0.0581, P(idle) = 0.0244 p. 4.
Training and validation p. 2 p. 3
- Holdout example: 60 percent training, 20 percent validation, 20 percent test. The test set is meaningful only if the split prevents leakage across users, sessions, environments or near-duplicate windows p. 2. Randomly splitting neighbouring windows from one recording can overstate field performance p. 2.
- Class balance: an imbalanced test set can score well with a majority-class predictor p. 2. The paper recommends balanced data, representative unknown or noise classes and anomaly detection p. 2.
- Diagnostics: judge training from both loss and accuracy curves p. 3. Underfitting (poor training and validation) calls for more informative features, longer training or a more expressive model. Overfitting (validation worsens while training improves) calls for more data, early stopping, lower complexity, regularisation, dropout or stronger augmentation p. 3.
- Learning rate: too low wastes training time, too high can make loss unstable p. 3.
Evaluation metrics p. 3 tab. 2
- Per-class F1: F1_k = 2TP_k / (2TP_k + FP_k + FN_k) p. 3. The formula is inline and unnumbered in the paper.
- Macro-averaged F1 is often more useful than accuracy when idle, unknown or background conditions dominate the stream p. 3.
- Confusion matrix: rows are actual classes, columns are predicted classes p. 3.
- Review false-positive and false-negative rates before choosing thresholds, especially when different classes trigger different actions p. 3.
- Temporal behaviour is part of evaluation: smoothing, refractory intervals and state machines p. 3.
- Table II lists deployment metrics: accuracy, precision, recall, F1, confusion matrix, latency, RAM and flash, MACs or CPU cycles, and energy per inference tab. 2.
Runtime and quantization p. 4 tab. 3
- TensorFlow Lite Micro converts the model to a FlatBuffer, linked into a C or C++ runtime. Many embedded runtimes use static memory allocation p. 4.
- Integer-only inference reduces memory footprint and suits integer hardware. The paper cites Jacob et al. for it p. 4 p. 6, ref. 8.
- Quantization changes numerical behaviour. Calibration data and post-quantization validation are required p. 4.
- Acceptance criteria to set: flash size, peak RAM, mean and worst-case latency, energy per inference and task-level accuracy under realistic noise and sampling conditions p. 4.
- CMSIS-NN kernels can cut latency and energy on Arm Cortex-M, but they do not remove the need for careful tensor sizing and operator selection p. 4.
- Table III lists the decision points: model format, memory allocation, sensor acquisition, window management, feature extraction, inference runtime, decision logic and field update tab. 3.
Case study patterns p. 4 p. 5 tab. 4
- Inertial gestures (left-right, up-down, circle, idle). Risks: orientation mismatch, sensor saturation, inconsistent gesture speed and transition windows between actions. Mitigations: augmentation, subject- or session-aware validation and state-machine filtering p. 4.
- Keyword spotting. Training data needs target words, unknown words and background noise. Background recordings can be mixed in to simulate deployment conditions p. 4.
- Table IV maps six patterns to the paper's examples: windowed motion recognition, streaming keyword spotting, sensor-paced acquisition, feature compression, probability-to-action logic and field monitoring tab. 4.
Design rules p. 5 p. 6
- Start with a resource and timing budget: flash, RAM, sampling rate, window length, stride, maximum latency, energy per inference and expected class priors p. 5.
- Treat the dataset as a product test artifact. Match sensor mounting, enclosure, drivers, preprocessing and sampling settings. Curate negatives as carefully as positives p. 5.
- Validate across realistic variation: new sessions, users, devices and placements. Use the final test set once p. 5.
- Design the runtime as a real-time subsystem: bounded buffers, deterministic acquisition and static allocation where possible. Profile on the target hardware with its clock, compiler and power settings p. 5.
- Version the whole deployed pipeline: model, preprocessing constants, quantization settings, probability thresholds and post-processing logic p. 5.
- Evaluate predictive and deployment metrics together. High offline accuracy is not enough if memory or latency budgets are exceeded p. 5.
- Plan field monitoring before deployment: aggregate confidence, rejection rates, event counts and failure modes, logged without storing raw personal data p. 5.
- Pair on-device inference with safeguards for data minimisation, robust thresholds, failure handling and update traceability p. 5 p. 6.
Open problems p. 6
The paper lists these as directions, not as solved: continual learning on constrained devices; uncertainty calibration and out-of-distribution detection; verification of threshold and rejection logic; application-specific acceleration of filtering, MFCC and windowing; and fuller reporting of device, numerics, memory and latency.
Hyperparameters
The paper gives no training hyperparameters. The values below are its examples, not tuned settings.
| Name | Value | Where | Notes |
|---|---|---|---|
| sampling rate, inertial example | 62.5 Hz | p. 2 p. 4 fig. 2 | one sample every 16 ms p. 4 |
| window, inertial example | 2 s, 3 axes, 125 samples per axis | p. 2 tab. 1 | 375 raw values |
| raw sample width, example | 16-bit integer | p. 2 | used for the 750-byte buffer figure |
| features per axis | 11: 1 RMS, 3 peak amplitudes, 3 peak frequencies, 4 band powers | p. 2 | 33 features in total |
| ADC stream, keyword spotting | 16 kHz | fig. 3 | fixed-rate sampling |
| audio window | 1 s | tab. 1 fig. 3 | |
| MFCC matrix | 49 × 13 | fig. 3 tab. 1 | frames by coefficients; frame length, hop and mel count not stated |
| data split, example | 60 / 20 / 20 | p. 2 | "a common split", with the leakage caveat |
| decision thresholds, example | P(left-right) > 0.5; P(circle) > 0.8 | p. 3 | illustrative; to be tuned against FP and FN costs |
| quantization | integer-only; bit width not stated | p. 4 | calibration set size not stated |
| learning rate | not stated | only diagnostics given p. 3 | |
| optimiser, epochs, batch size | not stated | ||
| CNN layers, filters, kernels, pooling, dense units | not stated | p. 3 | "one or more" convolution and pooling blocks |
| anti-alias filter order or cutoff | not stated | p. 2 | only the sampling-rate rule |
| window stride | not stated | p. 4 | stride limits compute time p. 4 |
| augmentation parameters | not stated | p. 4 | |
| latency and energy budgets | not stated | p. 5 | set per design p. 5 |
Results
No experiments, so the paper reports no measured accuracy, latency, memory or energy figures. Its numbers are worked examples and design summaries. Author-reported, with no baseline:
| Quantity | Value | Source |
|---|---|---|
| raw inertial input | 375 values; 750 bytes at 16 bits, before double buffering | p. 2 |
| inertial features | 33 (11 per axis) | p. 2 fig. 2 |
| example class probabilities | 0.9143 / 0.0032 / 0.0581 / 0.0244 (sum 1.0000) | p. 4 |
| sampling period | 16 ms (62.5 Hz) | p. 4 |
| keyword-spotting input | 1 s window; 49 × 13 MFCC matrix | fig. 3 tab. 1 |
Tables I to IV summarise design choices and deployment patterns. They report no experiments.
Paper vs code
No official code. The paper contains no code, repository or project-page link (all six pages, including references). A GitHub repository search for "darvishi embedded machine learning" and for "tinyml keyword spotting darvishi" returned zero results. A GitHub user search for "mostafa darvishi" returned five accounts (MDarvishi, MostafaDr, mostafadarvishy, msdarvishi, drdarvishi). None is linked from the paper, so none could be verified as the author's, and none was used. The paper has no method implementation to compare against, so there is no discrepancy check.
Pitfalls
- The paper runs no experiments. Its probabilities, sizes and thresholds are examples. Do not cite them as performance evidence.
- Most training details are missing: learning rate, optimiser, epochs, CNN architecture, MFCC framing, anti-alias filter, quantization bit width, calibration size and stride. An implementer must choose these and measure on the target hardware. Do not read the examples as settings.
- Softmax outputs are not calibrated probabilities p. 3. Thresholds such as 0.5 and 0.8 are illustrative and need validation on field-like data.
- The 750-byte raw buffer is a lower bound. It excludes double buffering, features, weights, activations and the runtime arena p. 2.
- If inference takes longer than the window stride, samples are dropped or latency grows p. 4. Profile on the target device before fixing the stride.
- Random window splits from one recording overstate field performance p. 2.
- Quantization changes numerical behaviour. The paper names calibration and post-quantization validation but gives no scheme p. 4.
- The paper has no numbered equations and no numbered algorithms. Its F1 formula is inline. Cite it as p. 3.
- Headings are unnumbered, so the citations in this card are PDF page numbers rather than section numbers.
Lineage
- Builds on: TensorFlow Lite Micro p. 4 p. 6, ref. 3; CMSIS-NN p. 4 p. 6, ref. 4; the keyword-spotting CNN of Sainath and Parada p. 3 p. 6, ref. 6; integer-only quantization of Jacob et al. p. 4 p. 6, ref. 8; MCUNet p. 6, ref. 9 (cited as the path to tiny inference).
- Compared against: not stated. The paper is a design synthesis, not a benchmark.
- Superseded by: not stated.
Source and license
Adapted from “Embedded Machine Learning for Microcontroller-Class Edge Devices: Data, Feature, Evaluation, and Deployment Pipelines” by Mostafa Darvishi (arXiv:2606.18122), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors.