Inspiration

Keyword spotting models spend the same compute on every frame, whether it's an obvious silence or a genuinely hard call. That felt wasteful for an always-on embedded task, so we asked a narrower question: can a model exit early on the easy cases, and does that saving actually survive deployment on real STM32 hardware through a closed, commercial toolchain -- not just on paper?

How We Built It

We shifted our focus to an existing MLCommons pretrained DS-CNN keyword spotting model rather than designing one from scratch. We split it into a backbone and a tail, and trained one small early-exit (EE) classifier on the frozen backbone features -- no retraining of the base model required.

At inference time:

$$ \text{confidence} \geq \tau \;\Rightarrow\; \text{exit early} \qquad \text{confidence} < \tau \;\Rightarrow\; \text{run the remaining layers} $$

We validated this split, and the EE model's accuracy/exit-rate tradeoff, first on PC against the full test set, then again on the STM32 board itself, before locking in results and pushing everything into the repo.

What We Learned

Small validation sets can look perfect and still be wrong -- one early run gave a suspiciously clean result that turned out to be an unrepresentative sample, not a real property of the model.

On a memory-constrained MCU, RAM discipline mattered as much as compute savings. And the closed, static nature of the on-device runtime meant our "early exit" had to be built around the toolchain, not inside it.

Challenges

The biggest challenge was trust: distinguishing a genuine result from an artifact of bad validation data, twice.

The second was memory -- fitting the split model's intermediate tensor and multiple network buffers into a tight SRAM budget.

The third was restraint -- resisting a more elegant but unverified redesign late in the timeline, and shipping the validated approach instead.

Built With

Share this project:

Updates