cs.HCJun 10, 2025
SaveImplementing Keyword Spotting on the MCXN947 Microcontroller with Integrated NPU
Organizations: Faculty of Electrical Engineering and Computing, Zagreb, Croatia
Abstract
This paper presents a keyword spotting (KWS) system implemented on the NXP MCXN947 microcontroller with an integrated Neural Processing Unit (NPU), enabling real-time voice interaction on resource-constrained devices. The system combines MFCC feature extraction with a CNN classifier, optimized using Quantization Aware Training to reduce model size with minimal accuracy drop. Experimental results demonstrate a 59x speedup in inference time when leveraging the NPU compared to CPU-only execution, achieving 97.06% accuracy with a model size of 30.58 KB, demonstrating the feasibility of efficient, low-power voice interfaces on embedded platforms.
Figures & tables
Figure 1: MFCC original signal and frames.
Figure 2: Frames after applying Hamming function.
Figure 3: Power spectrum.
Figure 4: Frames Mel spectrums.
Figure 5: MFCC spectogram.
| Layer (type) | Output Shape | Param # |
| input (InputLayer) | (None, 98, 20, 1) | 0 |
| conv1 (Conv2D) | (None, 96, 18, 32) | 320 |
| bn1 (BatchNormalization) | (None, 96, 18, 32) | 128 |
| pool1 (MaxPooling2D) | (None, 48, 9, 32) | 0 |
| conv2 (Conv2D) | (None, 46, 7, 64) | 18496 |
| bn2 (BatchNormalization) | (None, 46, 7, 64) | 256 |
Table I: Regular Neural Network Architecture
| Layer (type) | Output Shape | Param # |
| input (InputLayer) | (None, 98, 20, 1) | 0 |
| quantize_layer (QuantizeLayer) | (None, 98, 20, 1) | 3 |
| quant_conv1 (QuantizeWrapperV2) | (None, 96, 18, 32) | 387 |
| quant_bn1 (QuantizeWrapperV2) | (None, 96, 18, 32) | 129 |
| quant_pool1 (QuantizeWrapperV2) | (None, 48, 9, 32) | 1 |
| quant_conv2 (QuantizeWrapperV2) | (None, 46, 7, 64) | 18627 |
Table II: QAT Prepared Neural Network Architecture
| Layer (type) | Output Shape | Param # |
| InputLayer | [-1, 98, 20, 1] | 0 |
| Conv2D | [-1, 96, 18, 32] | 320 weights |
| + 32 biases | ||
| MUL, ADD (BatchNorm) | [-1, 96, 18, 32] | 64 scale |
| + 32 offset | ||
| MaxPool2D | [-1, 48, 9, 32] | 0 |
Table III: Quantized Model Architecture
Figure 6: Model architecture after NPU conversion [ 13 ] .
| Predicted Non-Marvin | Predicted Marvin | |
|---|---|---|
| Real Non-Marvin | 10746 | 64 |
| Real Marvin | 31 | 164 |
Table IV: Regular model confusion matrix
| Predicted Non-Marvin | Predicted Marvin | |
|---|---|---|
| Real Non-Marvin | 10501 | 309 |
| Real Marvin | 15 | 180 |
Table V: Quantized model confusion matrix
| Size [B] | Acc. [%] | i5 [ms] | MCXN947 [µs] | |
|---|---|---|---|---|
| Regular | 383674 | 99.14 | 50.67 | - |
| Quantized | 35744 | 97.06 | 0.42 | 228210 |
| NPU | 30576 | 97.06 | - | 3847 |
Table VI: Model statistics
Keyword Spotting (KWS) is becoming increasingly important as voice-controlled devices grow more widespread. While voice interaction with smartphones and smart TVs is already common, deploying KWS on heavily resource-constrained edge devices such as wearables remains challenging. These systems must meet high accuracy requirements while operating under strict constraints on computational power, memory footprint, and real-time latency. In this work, we present an application of the STMC (Short-Term Memory Convolutions) framework to adapt a modular CNN model for online, LSTM-like inference. Our approach reduces power consumption and redundant computations while maintaining the stability and simplicity of training CNNs. We achieve up to 82% and 46% MCPS reduction compared to equivalently frequent standard CNN execution and vanilla STMC, respectively. The best configuration achieves 93.8% accuracy on the 11-class Google Speech Commands task and 97.1% on the same task with zero-padded data.
A Multiplication-Free Feature Extractor for Signal Classification: Keyword Spotting Case Study
A very low complexity feature extractor called next iRDT is proposed and evaluated for the problem of keyword spotting (KWS). Unlike any other types of feature extractors including the widely used MFCC, or adaptive, CNN-based ones, our algorithm is multiplier-free and it employs only simple, energy-efficient arithmetic operators. Since keyword-spotting of speech commands (KWS) is a typical application for TinyML platforms requiring low complexity for the signal classification chain, we consider it as a case study to evaluate complexity and functional performance. If properly tuned, iRDT demonstrates similar accuracy to solutions based on MFCC or CNN-based extractors using baseline classifiers on Google's KWS 12-classes dataset. With a different classifier the system achieved 94.7% validation accuracy. Processing times on CPU for the proposed feature extractor, are at least one order of magnitude smaller than for the MFCC. The proposed algorithm has a very low hardware footprint, making it ideal for ultra-low power edge devices. Code and demo are available [18].
End-to-End Keyword Spotting on FPGA Using Graph Neural Networks with a Neuromorphic Auditory Sensor
With the rapid growth of mobile robotics and embedded intelligence, there is an increasing demand for efficient on-device data processing on edge platforms. A promising research direction is the use of neuromorphic sensors inspired by human sensory systems, which generate sparse, event-based data encoding changes in the environment. In this work, we present the first end-to-end FPGA implementation of a keyword spotting system that integrates a Neuromorphic Auditory Sensor (NAS) and a graph neural network (GNN) on a single FPGA device, enabling real-time processing of raw audio data. The proposed architecture eliminates conventional signal preprocessing and operates directly on event-based audio streams. Leveraging a compute-near-memory network architecture, the system achieves efficient inference with low latency and low power consumption. Experimental results demonstrate an accuracy of 87.43% after quantization on the Google Speech Commands v2 dataset processed through the neuromorphic sensor, with end-to-end latency below 35 us and average power consumption of 1.12 W. The processed datasets, software models, and hardware modules are available at https://github.com/vision-agh/NAS-GNN-KWS.