Next Article in Journal
CFD Investigation of Cavitation Effects on High-Speed Propeller Performance
Previous Article in Journal
Dynamic Earth Observation for Landslide Susceptibility Mapping Using Machine Learning and InSAR-Derived Deformation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Efficient Polish-Language Keyword Spotting on Microcontrollers: Compact Neural Architectures, Quantization, and On-Device Validation on the Raspberry Pi Pico 2

Faculty of Electronics, Photonics and Microsystems, Wrocław University of Science and Technology, Janiszewskiego Street 11/17, 50-372 Wrocław, Poland
*
Author to whom correspondence should be addressed.
Appl. Sci. 2026, 16(15), 7844; https://doi.org/10.3390/app16157844
Submission received: 5 July 2026 / Revised: 20 July 2026 / Accepted: 24 July 2026 / Published: 6 August 2026

Abstract

Keyword spotting (KWS) is the always-on front end of voice interfaces; running it directly on microcontrollers, rather than streaming audio to the cloud, is essential for low-latency, privacy-preserving, and energy-efficient operation, yet it must reconcile high accuracy with severe memory, compute, and energy limits. Existing small-footprint KWS solutions are developed and benchmarked almost exclusively on English and are seldom validated on physical hardware or under quantization for other languages; their transferability to typologically different, consonant-rich languages such as Polish therefore remains largely unverified. We present a KWS pipeline for Polish, deployed and benchmarked on the RP2350 microcontroller (Raspberry Pi Pico 2, Raspberry Pi Ltd., Cambridge, Great Britain).We propose three compact architectures from the convolutional (CNN), convolutional recurrent (CRNN), and depthwise separable neural network (DS-CNN) families and benchmark them against the state-of-the-art BC-ResNet on a 25-keyword Polish vocabulary using MFCC features. All models are evaluated in full precision (Float32) and after eight-bit integer (INT8) post-training quantization, with inference latency measured directly on the target hardware. BC-ResNet attains the highest full-precision accuracy (97.81%) but is the most fragile under quantization, whereas the proposed CRNN is the most accurate quantized model (94.28%), the DS-CNN the smallest (46.15 KB), and the CNN the fastest (107.5 ms); all quantized models meet a one-second real-time budget. We further show that the accuracy ranking inverts after quantization, that memory savings are highly architecture-dependent, and that phonetically similar Polish words are the dominant source of error. These results offer practical guidance for deploying small-footprint KWS in Polish and other underrepresented languages.

1. Introduction

Voice interfaces have become one of the most natural and ergonomic methods of human–machine interaction. Keyword Spotting (KWS) is the task of detecting predefined words or short phrases in a continuous audio stream. It constitutes the foundation of modern virtual assistants, such as Amazon Alexa, Apple Siri, and Google Assistant, where a lightweight, always-on detector listens for a wake word before activating more complex processing pipelines.
With the rapid expansion of the Internet of Things (IoT), there is a growing demand for touchless operation of smart-home appliances and industrial automation systems. However, streaming audio to remote cloud servers introduces critical challenges, including unacceptable latency, high network bandwidth usage, increased power consumption, and privacy concerns regarding user data [1]. A remedy is offered by Edge Computing and the TinyML paradigm, which shift acoustic analysis directly onto low-cost microcontrollers at the edge of the network.
Historically, speech recognition was dominated by Hidden Markov Models (HMMs) combined with Gaussian Mixture Models (GMMs), which successfully captured the sequential and stochastic nature of speech [2]. For microcontrollers operating in an always-on listening mode with only hundreds of kilobytes of RAM, however, these classical models proved too resource-hungry and energy-inefficient [3].
These limitations were largely overcome by deep learning, which replaced HMM decoding with neural networks that predict keyword probabilities directly from acoustic features, such as Mel-Frequency Cepstral Coefficients (MFCCs) [3]. Over the past decade, a range of specialized small-footprint architecture families has emerged: convolutional (CNN), convolutional recurrent (CRNN), and depthwise-separable neural networks (DS-CNN) as well as broadcasted residual networks (BC-ResNets), all of which are reviewed in detail in Section 2.
The overwhelming majority of small-footprint KWS studies have been developed and evaluated on English data, most notably on the Google Speech Commandsdataset [4], and the transferability of their conclusions to typologically different languages remains largely unverified. Here, we target Polish, a West Slavic language spoken by approximately 40 million people, whose phonological profile differs considerably from that of English. Polish is characterized by a consonant-rich phonology with long and dense consonant clusters (e.g., the keyword “wstecz”, “backward”, begins with a three-consonant cluster) and an unusually large inventory of fricatives and affricates, including a typologically rare three-way place contrast among dental, retroflex, and alveolo-palatal sibilants [5]. In addition, its rich inflectional morphology gives rise to numerous phonetically similar word forms. These properties make Polish keywords particularly difficult to discriminate when the effective spectral resolution is reduced, as exemplified in our experiments by near-minimal pairs such as “ptak” (“bird”) and “tak” (“yes”); they thus make Polish a demanding and informative test case for resource-constrained KWS.
In this work, we present a KWS pipeline for the Polish language, deployed and benchmarked on a device with severely constrained resources. Throughout the paper, we distinguish among an architecture family (a general class of network designs established in the literature, e.g., the CRNN family), an architecture (a concrete instantiation of a family, i.e., a specific configuration of layers, their dimensions, and the resulting parameter count), and a model (a trained instance of an architecture). The main contributions of this paper are as follows:
  • Three compact, task-specific architectures for Polish KWS. We propose three original architectures that instantiate the convolutional (CNN), convolutional recurrent (CRNN), and depthwise separable neural network (DS-CNN) families under a common microcontroller-oriented budget on the order of 10 4 parameters. Building on the respective family designs [3,6,7], we adapt their layer configurations, channel widths, and classification head to the 25-class Polish task (Section 4). Benchmarked against the state-of-the-art BC-ResNet reference [8], our CRNN attains the highest quantized accuracy (94.28%) and our DS-CNN the smallest quantized footprint (46.15 KB).
  • The first systematic small-footprint KWS study for Polish. We curate a 25-keyword Polish dataset from a multilingual corpus of speech commands [9] and, to the best of our knowledge, provide the first systematic small-footprint KWS evaluation for Polish, a consonant-rich language that is absent from the English-dominated KWS literature.
  • On-device analysis of INT8 quantization. We quantify the effect of post-training eight-bit integer (INT8) quantization [1,10] on accuracy, model size, and measured on-device latency. We show that the accuracy ranking of the architectures inverts after quantization and that the most parameter-efficient architecture (BC-ResNet) is neither the fastest nor the most robust once quantized, a result that is not apparent from full-precision accuracy or parameter count alone.
  • Hardware-validated deployment. We deploy the complete pipeline on custom-designed hardware, a dedicated dual-layer printed circuit board (PCB) integrating the Raspberry Pi Pico 2 (RP2350) with an electret-microphone front end, and report all inference latencies as measured directly on the device rather than estimated.
The novelty of this work lies less in a new network operator than in a first-of-its-kind empirical and systems study: to our knowledge, it is the first work to design and benchmark compact KWS architectures for the Polish language and to evaluate them jointly in full precision and after INT8 quantization with latency measured on physical microcontroller hardware. This joint, on-device evaluation surfaces a finding that is not visible from full-precision accuracy or parameter counts alone, namely, that the accuracy ranking of the architectures reverses under quantization and that the most parameter-efficient model is neither the fastest nor the most robust on the device.
The remainder of this paper is organized as follows. Section 2 reviews related work on small-footprint KWS. Section 3 introduces the necessary background: the KWS problem, MFCC feature extraction, TinyML, model quantization, and inference frameworks for microcontrollers. Section 4 describes the proposed network architectures. Section 5 presents the hardware platform and the experimental results, and Section 6 discusses the findings. Finally, Section 7 concludes the paper.

2. Related Works

Early speech recognition systems employed statistical sequence modeling, which led to the long-standing dominance of Hidden Markov Models (HMMs). HMMs successfully captured the sequential and stochastic nature of speech [2]. In HMM-based KWS systems, a keyword model is compared against a background noise or filler model, and the Viterbi search algorithm is used to find the optimal path through the decoding graph. However, deploying HMM-based models on microcontrollers is demanding, as Viterbi decoding requires considerable computational and memory resources [1].
In 2014, Chen et al. demonstrated that Deep Neural Networks (DNNs) can effectively replace HMMs for small-footprint KWS [11]. Their system predicts keyword probabilities directly from acoustic features, eliminating the need for complex sequence search algorithms such as Viterbi decoding. This reduced latency and simplified the computational requirements, making the approach attractive for real-time applications. The main drawback of plain DNNs, however, is their inability to exploit the local temporal and spectral correlations present in the speech signal.
To overcome this limitation, Sainath and Parada introduced convolutional neural networks (CNNs) to the KWS domain [6]. By treating the extracted acoustic features as two-dimensional images, CNNs effectively capture local time–frequency patterns and achieve higher accuracy with fewer parameters than DNNs.
Arik et al. proposed the convolutional recurrent neural network (CRNN) for KWS [7], in which convolutional layers first extract local features and recurrent layers subsequently encode the global temporal context. This combination achieves high accuracy and noise robustness with a relatively small memory footprint [1].
A further step towards efficiency was the depthwise separable convolutional neural network (DS-CNN), inspired by the MobileNet architecture [12]. Zhang et al., in their “Hello Edge” study [3], demonstrated that factorizing standard convolutions into separate depthwise and pointwise (1 × 1) operations drastically reduces the parameter count and computational load. Their DS-CNN model achieved 95.4% accuracy on the Google Speech Commands dataset [3,4].
More recently, Kim et al. introduced broadcasted residual learning and the BC-ResNet architecture to address the computational trade-off between 1D and 2D convolutions [8]. Standard 1D temporal convolutions are efficient but lack invariance along the frequency dimension, whereas 2D convolutions are computationally demanding. BC-ResNet resolves this by performing frequencywise convolutions on 2D features, averaging them into 1D temporal features, and then broadcasting the 1D residual information back onto the 2D spatial dimensions. The BC-ResNet-1 model achieved state-of-the-art performance (96.6% accuracy) with fewer than 10k parameters on the Google Speech Commands dataset [1,8].
Notably, all of the above milestones were established on English data, with the Google Speech Commands dataset [4] serving as the de facto standard benchmark. Research on KWS for other languages has gained momentum only recently. Mazumder et al. released the Multilingual Spoken Words Corpus, covering more than 340,000 keywords in 50 languages [13], and proposed a few-shot transfer-learning approach that enables keyword spotting in a new language from only a handful of training examples [14]. Multilingual speech-command collections derived from crowdsourced recordings, such as the 15-language dataset used in this work [9], follow the same direction. Nevertheless, Slavic languages, including Polish (whose consonant-rich phonology and dense consonant clusters [5] pose specific challenges for acoustic modeling), remain scarcely represented in the small-footprint KWS literature. To the best of our knowledge, no prior work has systematically benchmarked small-footprint KWS architectures for Polish, covering both full-precision and quantized models together with latency measurements on physical microcontroller hardware. The present study addresses this gap, providing a Polish-language benchmark that evaluates both full-precision and INT8 models with latency measured directly on microcontroller hardware and compares four architecture families under a common parameter budget.

3. Preliminaries

3.1. Keyword Spotting Problem

The workflow of a deep learning-based KWS system involves three main stages: extraction of acoustic features from the raw speech signal, application of a deep neural network model that generates probabilities for the individual keywords, and a decision stage that detects the presence of the target keywords [1].
KWS is a dynamic process in which the system continuously monitors the input audio signal and produces a sequence of posterior probabilities in real time. The feature extraction function converts the raw signal into a concise spectral representation: a two-dimensional matrix containing a temporal series of K-dimensional feature vectors, of which the model sequentially processes overlapping segments [1].
Formally, let X R T × K denote the two-dimensional MFCC representation of an input segment, comprising T time frames of K cepstral coefficients. A neural network f θ with parameters θ maps this input to a vector of class scores (logits) z = f θ ( X ) R N over the N keyword classes. The scores are normalized into a posterior distribution by the softmax function,
p i = exp ( z i ) j = 1 N exp ( z j ) , i = 1 , , N ,
so that p i estimates the probability of class i. The system selects the most likely class and applies a confidence threshold τ ,
y ^ = arg max i p i , decision = y ^ , p y ^ τ , reject , p y ^ < τ ,
where a rejected segment is treated as background noise or an unknown word. The parameters θ are learned by minimizing the categorical cross-entropy between the predicted distribution p and the one-hot ground-truth label y over the M training examples,
L ( θ ) = 1 M m = 1 M i = 1 N y i ( m ) log p i ( m ) .
The deep learning model maps each temporal input segment to an N-dimensional vector representing the probability distribution over N keyword classes. The system then selects the class with the highest probability; if the score of the targeted keyword class exceeds a preset threshold, the keyword is detected, and otherwise, the segment is rejected as background noise or an unknown word [1].

3.2. Feature Extraction

Raw audio waveforms must first be transformed into a compact and reliable representation. The most widely adopted feature extraction method in speech processing is Mel-Frequency Cepstral Coefficients (MFCCs). These acoustic features mimic human sound perception by reflecting the nonlinear frequency sensitivity of the human ear [15,16].
The standard feature extraction pipeline is shown in Figure 1. It consists of several sequential digital signal processing blocks: pre-emphasis, framing, windowing, the Fast Fourier Transform (FFT), the application of a Mel filter bank, logarithmic compression, and the Discrete Cosine Transform (DCT) [15,16].
Figure 2 shows the MFCC representation of a real one-second Polish keyword recording, which is the compact two-dimensional input actually provided to the networks: its horizontal axis corresponds to the 61 time frames and its vertical axis to the 40 cepstral coefficients.
First, a pre-emphasis filter is applied to the raw audio signal to boost its high-frequency components, since speech energy is concentrated in the low-frequency band; this balances the spectrum and increases the amount of information available to the model. Next, the signal is segmented into overlapping frames (typically 30–40 ms long with a 25–75% shift), which captures the quasi-stationary nature of speech. Each frame is then multiplied by a window function (most commonly a Hamming window) to reduce spectral leakage, and the FFT is applied to compute the power spectrum. The spectrum is subsequently passed through a bank of triangular band-pass filters spaced according to the Mel scale, and a logarithmic scale is applied to the filter bank outputs to imitate the loudness perception of the human ear. Finally, the DCT is applied to decorrelate the log-energies and reduce their dimensionality, yielding the MFCC matrix. The resulting features are treated as two-dimensional images and used as the input to the neural networks [15].

3.3. TinyML and Model Quantization

Tiny Machine Learning (TinyML) is a subfield of artificial intelligence and edge computing that focuses on deploying machine learning and deep learning models directly on ultra-low-power, resource-constrained embedded devices, especially microcontrollers. Such platforms often feature less than 500 KB of SRAM, less than 2 MB of Flash storage, and severe energy constraints [17].
To fit deep neural networks onto microcontrollers, neural network quantization is commonly applied as an optimization step. Quantization reduces the numerical precision of the network weights and intermediate activation maps: during the conversion of a trained model, 32-bit floating-point values are mapped to lower-precision formats, such as signed eight-bit integers. This conversion shrinks the model size and removes the dependence on a Floating-Point Unit (FPU), drastically reducing inference latency and energy consumption [10].

3.4. Inference Frameworks

The deployment of models on edge hardware relies on specialized software frameworks. Several libraries are available for running neural network models on microcontrollers. In this work, we use TensorFlow 2.10.1 Lite for Microcontrollers (TFLM, now part of LiteRT), an open-source library developed by Google as a reduced version of TensorFlow Lite [18]. It does not require an underlying operating system and is designed specifically for model inference on microcontrollers and other edge devices.
To execute a model, a FlatBuffer is created from the .tflite file and loaded into an interpreter, together with a pre-allocated tensor arena (a static memory buffer used for the input, output, and working tensors during inference). TFLM relies heavily on optimized back-end libraries, such as the Cortex Microcontroller Software Interface Standard Neural Network (CMSIS-NN) library provided by ARM [19,20], which offers highly optimized implementations of neural network kernels for ARM Cortex-M processors.

4. Implementation

4.1. Neural Network Architectures

Three original, compact architectures were designed, trained, and evaluated: a CNN, belonging to the family introduced by Sainath and Parada [6]; a CRNN, following the design of Arik et al. [7]; and a DS-CNN inspired by the architecture proposed in [3]. In addition, the BC-ResNet architecture [8] was reimplemented as a state-of-the-art reference for benchmarking. All models were engineered to process two-dimensional MFCC features as input. Each architecture was kept within a small-footprint budget suitable for microcontroller deployment, ranging from approximately 13k parameters for the BC-ResNet reference to 76k for the CNN (Table 1). As discussed in Section 5, parameter count alone is not predictive of accuracy in this regime: the largest model (CNN) is in fact the least accurate, indicating that the inductive bias of each architecture family, rather than raw capacity, is the dominant factor.
The CNN model is designed to function as an acoustic feature extractor. The model architecture is shown in Figure 3. The architecture utilizes standard two-dimensional convolutional layers to capture local time–frequency correlations, such as formants and pitch shifts. The multidimensional output is subsequently flattened and processed through fully connected dense layers, culminating in a softmax classifier that outputs the target vocabulary probabilities.
To better capture the sequential nature of speech, a hybrid CRNN architecture was implemented (Figure 4). The initial convolutional layer forms a spatial front end that reduces the input dimensionality. Next, the spatial dimensions are flattened while the temporal axis is preserved, forming a time-series representation. This is fed into a single GRU layer with 32 units (see Figure 4), which allows the model to capture long-term phonetic dependencies. The final layer is a dense classification layer with a softmax activation function.
The DS-CNN architecture design is based on [3]. Model structure is shown in Figure 5. The model contains 4 DS blocks (Figure 6). Each block consists of a depthwise phase and a pointwise phase. In the depthwise part, a spatial filtering step applies a 3 × 3 kernel independently to each input channel. It is followed by batch normalization for training stabilization and a ReLU activation function. In the pointwise part, a 1 × 1 convolution is used to linearly combine the feature maps generated by the depthwise phase into output channels. As in the first phase, it is followed by batch normalization and a ReLU activation function. Formally, a depthwise separable convolution factorizes a standard convolution into a depthwise and a pointwise step. For an input with C in channels, C out output channels, and a D k × D k kernel applied to feature maps of spatial size D f × D f , a standard convolution costs D k 2 C in C out D f 2 multiply–accumulate operations, whereas the depthwise separable form costs D k 2 C in D f 2 + C in C out D f 2 . The resulting reduction factor is
D k 2 C in D f 2 + C in C out D f 2 D k 2 C in C out D f 2 = 1 C out + 1 D k 2 ,
which, for the 3 × 3 kernels used here, gives close to a ninefold reduction in cost and motivates the use of the DS-CNN for microcontroller deployment.
For completeness, we give the forward-propagation equations of the three proposed models, using the notation of Section 3 (input X R T × K , logits z , and posteriors p = softmax ( z ) from Equation (1)).
CNN. With A ( 0 ) = X , each convolutional layer l = 1 , 2 , 3 computes
A ( l ) = ReLU W ( l ) A ( l 1 ) + b ( l ) ,
where ∗ denotes two-dimensional convolution. Max pooling and flattening yield v = flatten MaxPool ( A ( 3 ) ) , which two fully connected layers map to the logits,
h = ReLU ( W 1 v + b 1 ) , z = W 2 h + b 2 .
CRNN. A single convolution and pooling stage produces a feature map that is reshaped along the time axis into a sequence ( x 1 , , x T ) with x t R d . For t = 1 , , T , the 32-unit GRU with hidden state h t updates
r t = σ ( W r x t + U r h t 1 + b r ) ,
u t = σ ( W u x t + U u h t 1 + b u ) ,
h ˜ t = tanh W h x t + U h ( r t h t 1 ) + b h ,
h t = ( 1 u t ) h ˜ t + u t h t 1 ,
where σ is the logistic sigmoid and ⊙ the Hadamard product. The final hidden state gives the logits z = W o h T + b o .
DS-CNN. An initial standard convolution produces A ( 0 ) . Each DS block b = 1 , , 4 applies a depthwise ( DW ) and then a pointwise ( PW ) convolution, each followed by batch normalization ( BN ) and a ReLU activation,
U ( b ) = ReLU BN DW ( A ( b 1 ) ) ,
A ( b ) = ReLU BN PW ( U ( b ) ) .
Global average pooling over the spatial dimensions H × W yields g = 1 H W i , j A i , j , : ( 4 ) , which a dense layer maps to the logits z = W o g + b o .
While each architecture follows an established family, the specific instantiations reported here constitute our design contribution. For the CNN, we adopt a three-layer convolutional stack with decreasing channel widths (16, 8, 5) followed by a two-layer classifier, trading depth for a small parameter count. For the CRNN, we reduce the convolutional front end to a single convolution–pooling stage feeding a single 32-unit GRU, which we found sufficient to model the temporal context of one-second commands at minimal cost. For the DS-CNN, we fix four depthwise-separable blocks with a channel multiplier of 64 and no inter-block spatial downsampling, prioritizing accuracy retention under quantization. All three architectures were tuned to a comparable budget on the order of 10 4 parameters, such that the cross-architecture comparison in Section 5 reflects inductive bias rather than raw capacity. The exact per-layer configurations, which are the design variables we set, are given in Figure 3, Figure 4 and Figure 5, and the resulting parameter counts in Table 1.
The feature-extraction and input hyperparameters were chosen to match the dataset and the microcontroller budget rather than tuned to the target language. Each one-second clip is represented by a 61 × 40 MFCC matrix (61 time frames of 40 coefficients). The MFCC front end uses 40 Mel filter banks spanning 64–8000 Hz, a 512-point FFT at a 16 kHz sampling rate, and 50% frame overlap; the 512-point window corresponds to a frame length of 32 ms, and the 50% overlap gives a frame shift of 16 ms, which yields ( 1000 ms 32 ms ) / 16 ms + 1 = 61 frames per one-second clip. A single static feature stream, without delta or delta-delta coefficients, was retained to limit the input size and the resulting model and tensor-arena memory on the RP2350. We did not tune the number of Mel filters, the number of coefficients, or the frame length and shift to the Polish phoneme inventory, nor did we evaluate dynamic (delta) features. Because Polish phoneme confusability is concentrated in fine spectral detail (owing to its rich fricative and sibilant inventory), a targeted study of these feature choices, including a higher Mel resolution and the addition of delta coefficients, is a promising route to better discrimination of pairs such as “ptak”/“tak” and is left for future work. Similarly, the 32-unit GRU of the CRNN was sized to meet the shared parameter budget rather than selected by an exhaustive search; we did not systematically explore whether a larger recurrent state would improve accuracy at the cost of latency or whether performance is already saturated on this 25-word vocabulary.
The complete on-device inference pipeline is summarized in Algorithm 1; the Float32 and INT8 variants differ only in the input-quantization step.
The CNN, CRNN, and DS-CNN models were trained using the Adam optimizer with sparse categorical cross-entropy loss over a maximum of 20 epochs, with a batch size of 64 or 128 (model-dependent) and early stopping (patience = 3, restoring best weights). Because early stopping restored the weights from the epoch of lowest validation loss, the 20-epoch cap acts only as an upper bound: the reported accuracies correspond to the best-validation (converged) checkpoint rather than to premature stopping. The learning curves are available in Appendix B.
Algorithm 1 On-device keyword-spotting inference on the RP2350.
Require: raw audio frame s (1 s, 16 kHz); trained model f θ (Float32 or INT8); threshold τ ; for the INT8 model, input scale S and zero point Z
Ensure: recognized keyword or reject
  1:
X E x t r a c t M F C C ( s ) ▹ pre-emphasis, framing, windowing, FFT, Mel filter bank, log, DCT (CMSIS-DSP)
  2:
if  f θ is INT8 then
  3:
     X round ( X / S ) + Z      ▹ quantize MFCC input to 8-bit
  4:
     z f θ ( X ) ▹ integer forward pass (TFLite Micro/CMSIS-NN); logits dequantized to R N
  5:
else
  6:
     z f θ ( X )           ▹ floating-point forward pass
  7:
end if
  8:
p ← softmax ( z )                ▹ Equation (1)
  9:
y ^ arg max i p i
10:
if  p y ^ τ  then
11:
    return keyword y ^
12:
else
13:
    return reject       ▹ background noise or unknown word
14:
end if
The BC-ResNet model followed the training procedure from the original paper [8]: an SGD optimizer with momentum 0.9, L2 weight decay 0.001, an initial learning rate of 0.1 with a 2-epoch warmup and cosine/stepwise decay, over 20 epochs with a batch size of 128. The three proposed models were thus trained under identical conditions so that comparisons among them (the primary object of this study) are controlled. The BC-ResNet reference was instead trained according to its authors’ procedure to reproduce its reported state-of-the-art behavior faithfully; imposing our generic training setup on it could have handicapped the reference and caused its performance to be underestimated. We note that this difference in training protocol is a confounding factor for the BC-ResNet comparison specifically, which we discuss further in the limitations (Section 6).
The dataset was partitioned into a training subset (80%, 112,677 samples) and a test subset (20%, 28,169 samples) using a fixed random seed. The split was not explicitly speaker-independent. Fivefold cross-validation was applied on the training subset for model selection; final accuracy was evaluated on the shared test set.
Regularization was applied in the form of early stopping on validation loss (CNN, CRNN, DS-CNN) and L2 weight decay (BC-ResNet). Data augmentation in the form of white noise injection was applied to the training set only; additional augmentations (pitch shifting, time stretching, and noise) were provided by the dataset authors. All training was performed in TensorFlow 2.10.1/Keras 2.10.0 (CNN, CRNN, DS-CNN) and PyTorch 2.5.1 (BC-ResNet) on a single NVIDIA GeForce GTX 1050 Ti GPU. The BC-ResNet model was subsequently exported to TensorFlow, such that all four models share an identical conversion, INT8 quantization, and on-device inference path; the only difference for BC-ResNet is thus on the training side (framework and procedure), not in the quantization or inference pipeline.
The total number of parameters for each architecture is summarized in Table 1.

4.2. Use of Generative AI Tools

A generative AI–based assistant (Claude 4.8; product details are given in the Acknowledgments) was used to support several parts of this work. In the software development, it assisted with debugging, with drafting helper functions and scripts, and with code validation; all AI-generated code was carefully reviewed and tested by the authors before use. In the preparation of the manuscript, it was used to improve the language of the text (grammar, vocabulary, and overall readability); to assist with the layout and style of the document; to help validate the mathematical formulas, and to perform final consistency checks across the text, figures, and tables. All AI-assisted code, text, and derivations were reviewed and verified by the authors, who take full responsibility for the content, the methods, and the results reported in this paper. The product details of the tools used are given in the Acknowledgments.

5. Results

5.1. Hardware Architecture

In order to investigate the performance of the proposed neural networks in a real-world scenario, a dedicated hardware platform was developed. The system architecture revolves around the Raspberry Pi Pico 2 development board, which features the RP2350 microcontroller (Figure 7). The RP2350 is a high-performance system on a chip (SoC) that employs a unique dual-core, dual-architecture design, providing two Arm Cortex-M33 cores and two RISC-V Hazard3 cores, both operating at a nominal frequency of 150 MHz [21].
In this research, the Arm Cortex-M33 cores were selected due to support for TinyML workloads, such as CMSIS-DSP [22] and Tensorflow Lite for Microcontrollers [18]. The Cortex-M33 implements the Armv8-M architecture, which includes Digital Signal Processing (DSP) instructions and a Single-Precision Floating-Point Unit (FPU). These hardware features are critical for efficient keyword spotting (KWS), as they allow the accelerated computation of Mel-frequency cepstral coefficients (MFCCs) and optimize the execution of quantized neural network kernels. The microcontroller is equipped with 520 KB of on-chip SRAM. The Pico 2 board also provides 4 MB of external QSPI Flash memory [21].
The hardware implementation includes a custom dual-layer printed circuit board (PCB) designed and fabricated to interface the Raspberry Pi Pico 2 with an analog audio front end. This front end utilizes an electret microphone coupled with a low-noise pre-amplifier stage [23] to capture voice commands.

5.2. Testing on the Database

For testing the models, the dataset described in [9] was used. The database contains 1 s voice recordings of single words in 15 languages. All records have been augmented using time shifting, noise injection, pitch variation, etc. [9]. For testing, only Polish words were selected. The models were trained to recognize 25 classes, which are shown in Table 2.
The overall performance and memory requirements of the evaluated neural network architectures were measured in their Float32 format and after integer quantization (INT8). Table 3 and Table 4 summarize the accuracy, F1-score, model size, and on-device inference time for the Float32 and INT8 variants, respectively. For all reported F1-scores, the weighted-averaged was computed across classes (each class’s F1 weighted by its number of samples), and no class weighting or oversampling was applied during training. Because the dataset is markedly imbalanced (e.g., “no”(“nie”) with 31,086 samples versus “backward” (“wstecz”) with 918), both the overall accuracy and the weighted F1-score are dominated by the most frequent classes and can mask poor performance on rare keywords; the per-class analysis of Figure 8 is therefore reported to give a more balanced view of per-keyword performance. As point estimates on a test set of roughly 28 , 000 samples, the reported accuracies are statistically stable: the half-width of the 95 % Wald confidence interval does not exceed ± 0.4 percentage points (for example, ± 0.27 pp at 94 % accuracy), and so overlapping intervals do not affect the reported rankings.
The highest accuracy in Float32 format was achieved by the BC-ResNet model (97.81%), followed closely by DS-CNN (97.06%) and CRNN (96.19%). The CNN architecture exhibited the lowest Float32 accuracy at 88.68%. After INT8 quantization, the CRNN model retained the highest accuracy (94.28%), while BC-ResNet experienced the largest absolute accuracy drop (5.08 percentage points). Quantization significantly reduced the model size for the CNN (from 300.64 KB to 79.44 KB) and DS-CNN (from 98.85 KB to 46.15 KB). The file sizes of the CRNN and BC-ResNet architectures remained largely unaffected by the quantization process. Inference time was measured directly on the target hardware platform, the Raspberry Pi Pico 2 microcontroller, as the mean over 100 consecutive inferences per model; all programs were compiled with Releaseoptimization settings. The reported times measure the neural-network forward pass only and exclude MFCC feature extraction, which is a fixed additive cost common to all models; a full end-to-end budget would add this constant term to every entry. The standard deviation did not exceed 0.5   m s for any configuration and is therefore omitted. The resulting on-device latencies are reported alongside the accuracy and memory metrics in Table 3 and Table 4.
The shortest mean inference time was recorded for the CNN model in INT8 format ( 107.5   m s ). The DS-CNN architecture exhibited the greatest relative speedup following INT8 quantization, with the mean inference time reduced from 1693.7   m s to 311.3   m s (approximately 5.4-fold). In contrast, the BC-ResNet architecture showed the smallest relative improvement after quantization, with execution time decreasing from 579.1   m s to 501.9   m s . Relative to the one-second analysis window of the input frame, all INT8 models meet the real-time constraint, with inference well below 1 s . In Float32, only the CNN and CRNN remain within this budget, whereas the DS-CNN ( 1693.7   m s ) exceeds it and is therefore unsuitable for continuous, always-on operation unless quantized.

5.3. Comparison with Prior Work

To the best of our knowledge, no prior small-footprint KWS results exist for Polish, and so a direct, controlled comparison is not possible. Table 5 instead places our full-precision results in the context of representative English-language small-footprint KWS studies evaluated on the Google Speech Commands benchmark. Two observations follow. First, our reimplementation of BC-ResNet reaches 97.81% on the 25-class Polish task, in the same range as the 96.6% reported by its authors on the 12-class English benchmark [8], which supports the validity of our training and evaluation setup. Second, the proposed CRNN and DS-CNN attain accuracies comparable to these state-of-the-art English models while operating on a larger (25-class) and phonetically harder vocabulary. We stress that these numbers are not directly comparable, as the language, vocabulary size, and recording conditions differ; the table is intended for context rather than as a head-to-head benchmark.

5.4. Confusion Matrix

Confusion matrices were generated for all evaluated models to assess prediction stability across individual voice commands. In every matrix, rows correspond to the true class and columns to the predicted class, and so a strong diagonal indicates correct predictions. For readability, the main text summarizes per-class behavior through the accuracy view of Figure 8, while the full per-model confusion matrices, for all four models in both Float32 and INT8 formats, are collected in Appendix A.
To compare per-class behavior across all models and formats at a glance, Figure 8 reports the per-class accuracy, that is, the diagonal of each confusion matrix, with keywords ordered from hardest to easiest. It shows that a small set of phonetically confusable keywords, led by “ptak” (“bird”), concentrates the errors, and that INT8 quantization amplifies these weaknesses most severely for BC-ResNet (whose accuracy on “ptak” falls to 40%) and for the CNN, whereas the CRNN and DS-CNN degrade more gracefully. This view also highlights that the unweighted (macro) per-class accuracy is lower than the sample-weighted accuracy of Table 4 for the fragile models, confirming that their degradation is concentrated in the rarer, phonetically hard classes.
The BC-ResNet model demonstrated robust word recognition performance across the majority of classes in Float32 format. A notable exception was the keyword “bird” (“ptak”), which achieved 83.5% per-class accuracy and was most frequently misclassified as “yes” (tak) in 7.4% of cases and as “two” (“dwa”) in 4.9% of cases.
In the Float32 CNN model, the lowest classification accuracy was recorded for the command “bird” (“ptak”) at 70.8%, which was misclassified as yes (tak) in 16.9% of instances. A further notable error involved the keyword “seven” (“siedem”), which achieved only 72.7% accuracy and was most frequently confused with “four” (“cztery”) in 13.3% of cases.
The Float32 CRNN model exhibited generally strong per-class performance. The weakest classes were “yes” (“tak”) at 89.1%, “one” (“jeden”) at 91.7%, and “go” (“iść”) at 92.6%; the latter was occasionally misclassified as “five” (“pięć”) in 3.6% of cases.
In the Float32 DS-CNN model, the weakest class was “go” (“iść”) at 88.8%, which was most frequently misclassified as five (pięć) in 6.7% of instances. The remaining classes maintained uniformly high per-class accuracy.
Following INT8 quantization, the BC-ResNet model exhibited a substantial accuracy degradation for the keyword “bird” (“ptak”), which fell to 39.9%. This word was most frequently recognized as “yes” (“tak”) (24.3%), “two” (“dwa”) (16.9%), and “four” (“cztery”) (7.4%), representing the most pronounced per-class degradation observed across all quantized models.
In the quantized CNN model, the keyword “bird” (“ptak”) dropped to 61.7%, with “yes” (“tak”) accounting for 21.0% of misclassifications. The class “seven” (“siedem”) also declined to 68.7% accuracy, primarily due to confusion with “four” (“cztery”) in 14.7% of cases.
For the quantized CRNN architecture, the majority of classes maintained satisfactory accuracy. The weakest classes were “yes” (“tak”) at 85.9%, “seven” (“siedem”) at 87.7% (confused with “one” (“jeden”) in 4.1% of cases), and “go” (“iść”) at 87.8% (confused with “five” (“pięć”) in 5.9% of cases).
In the quantized DS-CNN model, the weakest class was “go” (“iść”) at 80.9%, most frequently misclassified as “five” (“pięć”) in 13.4% of instances. The class “dog” (“pies”) also declined to 82.6% accuracy, with the primary source of confusion being “five” (“pięć”) in 10.6% of cases.

6. Discussion

Experimental results demonstrate that deploying high-accuracy keyword spotting (KWS) on a resource-constrained microcontroller like the RP2350 requires navigating various trade-offs. No single model excelled across all metrics, which included full-precision accuracy, robustness to INT8 quantization, memory footprint, and inference speed. Instead, each architecture offers distinct advantages, meaning the best choice depends heavily on the specific constraints of the target application.
In the full-precision (Float32) tests, the BC-ResNet model achieved the highest accuracy at 97.81% while remaining highly parameter-efficient, utilizing only 13,450 parameters. The DS-CNN and CRNN followed closely with scores of 97.06% and 96.19%, respectively. Conversely, the standard CNN lagged significantly at 88.68%, despite containing a massive 75,982 parameters. This confirms that architectures specifically designed for the time and frequency structures of speech, such as DS-CNN [3] and BC-ResNet [8], capture audio patterns far more effectively than generic convolutional layers.
When INT8 quantization was applied to compress the models, the robustness rankings inverted. The CRNN proved most resilient, losing only 1.91 percentage points (96.19% → 94.28%), making it the most accurate quantized model. The DS-CNN experienced a moderate drop (97.06% → 93.13%). The BC-ResNet, however, suffered the most significant decrease, losing 5.08 percentage points (97.81% → 92.73%). This fragility was particularly noticeable with phonetically similar keywords; for instance, the Polish command “ptak” (“bird”) dropped to a 39.9% accuracy rate, frequently being confused with “tak” (“yes”) and “dwa” (“two”) (see Figure A1b). All four models share the same inference and quantization pipeline: each was exported to TensorFlow, quantized to INT8 with the same post-training TensorFlow Lite converter and calibration procedure, and executed under the same TensorFlow Lite Micro runtime. Quantization tooling and inference-time numerical handling are therefore controlled across models, and the observed robustness differences are not attributable to different converters, calibration sets, or runtimes. The BC-ResNet reference does, however, differ on the training side, having been trained in PyTorch with its authors’ procedure rather than in TensorFlow/Keras; this may shape its learned weight and activation distributions and hence its quantization sensitivity, and we acknowledge it as a training-side confound, although it does not arise from the quantization pipeline itself. We further note that we did not isolate the individual contributions of layerwise quantization sensitivity or specific integer kernels. The architectural interpretation we offer is thus a plausible hypothesis rather than an established cause: BC-ResNet’s broadcasted residual operations rely on frequencywise spectral mappings whose reduced dynamic range under eight-bit arithmetic may erode fine spectral detail, whereas the CRNN’s reliance on temporal dynamics may be more tolerant of rounding. A controlled attribution, together with quantization-aware training and a layerwise sensitivity analysis, is left for future work.
The impact of quantization on memory footprint also varied by architecture. The CNN and DS-CNN compressed significantly, shrinking down to 79.44 KB and 46.15 KB, respectively, making the DS-CNN the smallest deployed model in the study. The CRNN compressed only modestly by 16.5% to 182.62 KB, remaining the largest quantized model, as a significant portion of its footprint is attributable to metadata and structural elements rather than core weights. Strikingly, the BC-ResNet barely compressed at all, merely changing from 104.98 KB to 101.97 KB. Because it already relies on very few parameters, its overall size is dominated by structural overhead rather than weight storage, meaning eight-bit weights offer almost no space savings. This demonstrates that quantization does not uniformly result in a fourfold size reduction; the actual savings depend heavily on the model’s architectural design.
Inference latency, measured directly on the RP2350 (Table 3 and Table 4), revealed further differences. The DS-CNN experienced the most significant speed improvement from quantization, dropping from 1693.7   m s to 311.3   m s (a 5.4× speedup). The standard CNN achieved the fastest quantized inference at 107.5   m s ; however, given its lower accuracy of 85.32%, it is better suited as a low-power trigger than as a primary recognizer. The CRNN provided a strong balance, combining the highest quantized accuracy with a competitive 150.3   m s latency. Conversely, the BC-ResNet gained minimal speed, shifting by a factor of only 1.15, from 579.1   m s to 501.9   m s .
These differences are explained by the computational and memory profiles of the models, reported in Table 6: INT8 quantization mainly accelerates arithmetic, and so its benefit is largest for arithmetic-bound models and smallest for memory-bound ones. The DS-CNN performs by far the most arithmetic (26.35 M operations per inference), and so replacing floating-point with integer arithmetic yields a large gain, consistent with its 5.4-fold speed increase; its intermediate buffers also shrink substantially (from 1561.5 KiB to 398.1 KiB). In contrast, BC-ResNet performs comparatively few operations (4.20 M) yet allocates by far the largest intermediate buffers ( 5797.7 KiB in Float32), indicating that its runtime is dominated by memory movement rather than computation; quantization therefore yields only a modest 1.15-fold improvement despite its low parameter count. The CNN and CRNN lie between these extremes. This profile-based account replaces the earlier qualitative statement and directly attributes the differing latency reductions to the balance between arithmetic and memory operations in each architecture.
An analysis of classification errors across all architectures revealed a tendency to confuse words with similar phonetic structures. In the Polish dataset, “ptak” (“bird”) and “tak” (“yes”) share a near-identical vocalic nucleus and coda, while “iść” (“go”) was frequently confused with “pięć” (“five”). Such pairs become increasingly difficult to distinguish as the effective spectral resolution is lowered by quantization. This pattern suggests that while post-training quantization is sufficient for more robust architectures, quantization-aware training [10] would likely be necessary for sensitive models such as the BC-ResNet to preserve the subtle acoustic cues needed to separate these similar words.
Although this study targets Polish, the proposed pipeline is language-agnostic. The MFCC front end, the network architectures, and the quantization and deployment workflow do not depend on the target language; retargeting to another language requires only a labeled keyword corpus in that language and a change in the output vocabulary size N in Equation (1), with no change in the model structure. What varies across languages is the intrinsic difficulty of the vocabulary: as our error analysis shows, phonetically close keywords, which are especially abundant in consonant-rich Slavic languages such as Polish, are the main driver of errors and of quantization sensitivity. We therefore expect the architectural and quantization trends reported here to transfer to other languages, whereas the absolute accuracies will depend on the phonetic separability of the chosen keyword set.
The successful implementation on the custom PCB validated the RP2350 as a robust platform for TinyML. The ARM Cortex-M33 cores provided sufficient computational power, in particular by exploiting the DSP extension instructions of the Armv8-M architecture, which accelerate both the MFCC feature extraction (via the CMSIS-DSP library) and the quantized neural-network kernels (via the CMSIS-NN back end used by TensorFlow Lite for Microcontrollers). Future research could explore utilizing the dual-core capability of the RP2350 to pipeline the MFCC extraction and neural network inference stages, potentially decreasing latency further.
A key limitation of this study is that all reported metrics were obtained on the pre-recorded, augmented evaluation corpus rather than on live audio captured through the on-board acquisition chain. Consequently, the accuracy and F1-scores characterize the models together with the INT8 quantization and on-device latency behavior but not the complete microphone-to-decision pipeline. Preliminary tests using live input from the electret-microphone front end exhibited a marked degradation in recognition accuracy relative to the dataset evaluation. We attribute this gap primarily to a domain mismatch between the crowdsourced training corpus and the audio captured by the custom front end, rather than to the network architectures themselves, which performed consistently on in-domain data. Acoustic analysis of the raw recordings (Table 7) is consistent with this attribution along two dimensions: the SNR, estimated from the lowest-energy decile of 20 ms frames (used as a noise-floor proxy in the absence of explicit silence segments), averaged 9.7 dB ( σ = 1.7 dB , range 6.3 11.8 dB ), well below the 20 dB threshold commonly required for reliable speech processing, and spectral analysis revealed a mean 20 dB roll-off at 1.5 kHz ( σ = 0.4 kHz ), far below the 4 kHz lower bound expected for narrowband-grade speech capture. Consistent RMS levels across recordings (range 4.9 dB ) and the absence of clipping make gain misconfiguration and front-end saturation unlikely as primary factors. We stress, however, that these measurements characterize the captured signal rather than isolate the individual contributions of the microphone, the analog front-end, the MFCC extraction, and ambient noise; we did not perform a controlled ablation that varies each factor independently, and so the attribution should be read as strongly supported by the signal statistics rather than as a fully isolated causal decomposition. Closing this gap will require a controlled front-end characterization that separates these factors, the collection of an in-domain dataset recorded directly through the target hardware, and the application of domain-adaptation techniques together with quantization-aware training; we regard this microphone-level validation as essential future work before the prototype can serve as a consumer-grade voice interface.
Beyond this microphone-level validation, several methodological factors bound the strength of our conclusions. First, the evaluation corpus is aggregated from crowdsourced recordings and does not expose speaker identifiers, and so a strictly speaker-disjoint training/test split was not possible; we therefore cannot fully exclude the possibility that some per-speaker characteristics are shared between the two partitions, which is known to inflate apparent accuracy in keyword spotting. The large and diverse pool of contributors and the heavy data augmentation mitigate but do not eliminate this risk, and a speaker-independent evaluation is an important direction for future work. Second, because all accuracies were obtained on this in-domain corpus, they should be interpreted as a controlled comparison of architectures and quantization schemes and as an upper bound on deployed performance, rather than as a prediction of live-microphone accuracy, which, as noted above, is currently degraded by the acquisition chain. Third, as discussed in Section 4, the BC-ResNet reference was trained with its authors’ procedure rather than our common protocol; this keeps the comparison fair to the reference but introduces a training-protocol confound, and so the relative findings among the three proposed models, which share an identical training setup, constitute the more controlled comparison. Fourth, we applied post-training quantization only, as the standard low-effort deployment path; quantization-aware training, which could recover much of the accuracy lost by sensitive models such as BC-ResNet, was outside the scope of this study and is a natural next step, ideally guided by a per-layer analysis of activation ranges and outlier weights to identify the most quantization-sensitive layers. Finally, we report inference latency but did not perform direct power profiling on the RP2350; for always-on operation, energy per inference (approximately the product of power and latency) is the ultimate metric, and a direct power characterization is an important complement to the latency measurements reported here.

7. Conclusions

This work presented a keyword-spotting pipeline for the Polish language, deployed and benchmarked on a severely resource-constrained microcontroller. Three compact architectures from the CNN, CRNN, and DS-CNN families were designed and benchmarked against the state-of-the-art BC-ResNet reference, both in full precision and after INT8 quantization, with latency measured directly on the Raspberry Pi Pico 2 (RP2350).
The results show that no single architecture is optimal across all deployment criteria. BC-ResNet achieved the highest full-precision accuracy (97.81%) but proved the most fragile under quantization, whereas the proposed CRNN was the most robust and the most accurate quantized model (94.28%), the DS-CNN yielded the smallest INT8 footprint (46.15 KB), and the CNN delivered the lowest latency ( 107.5   m s ). Notably, the accuracy ranking inverted after quantization, the memory savings were highly non-uniform across architectures, and all quantized models met the one-second real-time budget on the target device. Error analysis further revealed that the dominant failure mode was the confusion of phonetically similar Polish words (e.g., “ptak”/“tak”, “iść”/“pięć”), which is exacerbated by the reduced numerical precision of INT8 arithmetic.
These findings provide practical guidance for selecting and quantizing small-footprint KWS models for Polish and other consonant-rich, morphologically rich languages. The principal open challenge is to bridge the gap between dataset-based evaluation and live microphone operation; addressing the acquisition-chain and domain-mismatch limitations discussed above, together with quantization-aware training, is the natural next step toward a deployable, always-on Polish voice interface.

Author Contributions

Conceptualization, J.S. and K.F.; methodology, J.S.; software, J.S.; validation, J.S.; formal analysis, J.S.; investigation, J.S.; resources, K.F.; data curation, J.S.; writing—original draft preparation, J.S.; writing—review and editing, J.S. and K.F.; visualization, J.S.; supervision, K.F.; project administration, K.F. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The Polish keyword recordings used in this study were derived from the publicly available multilingual speech-command dataset of [9]. The specific Polish keyword subset used in this work, which is not merely a subset of that corpus but a modified version augmented with additional white-noise injection, has been released as a public dataset at https://huggingface.co/datasets/Winderth/pl-kws, accessed on 6 July 2026. The model definitions, training scripts, and the configuration used to reproduce the reported results are available at https://github.com/Winderth/Polish_KWS_RPI_PICO, accessed on 16 June 2026.

Acknowledgments

During this work, the authors used a generative AI–based tool, whose use is described in Section 4 (Use of Generative AI Tools). The tool used was Claude (Anthropic, PBC, San Francisco, CA, USA). The authors have reviewed and edited all AI-assisted output and take full responsibility for the content of the publication.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
BC-ResNetBroadcasted Residual Network
CMSISCortex Microcontroller Software Interface Standard
CNNConvolutional Neural Network
CRNNConvolutional Recurrent Neural Network
DCTDiscrete Cosine Transform
DNNDeep Neural Network
DS-CNNDepthwise Separable Convolutional Neural Network
DSPDigital Signal Processing
FFTFast Fourier Transform
FPUFloating-Point Unit
GMMGaussian Mixture Model
GRUGated Recurrent Unit
HMMHidden Markov Model
INT88-bit Integer (precision)
IoTInternet of Things
KWSKeyword Spotting
MFCCMel-Frequency Cepstral Coefficients
PCBPrinted Circuit Board
QATQuantization-Aware Training
RMSRoot Mean Square
SGDStochastic Gradient Descent
SNRSignal-to-Noise Ratio
SoCSystem on a Chip
SRAMStatic Random-Access Memory
TFLMTensorFlow Lite for Microcontrollers
TinyMLTiny Machine Learning

Appendix A. Confusion Matrices for All Evaluated Models

For completeness, this appendix reports the full confusion matrices of all four evaluated models in both Float32 and INT8 formats: the BC-ResNet reference (Figure A1), the CNN (Figure A2), the CRNN (Figure A3), and the DS-CNN (Figure A4). These matrices are collected here because the main text replaces them, for better readability, with the compact per-class accuracy summary of Figure 8. In every matrix, rows correspond to the true class and columns to the predicted class; thus, a strong diagonal indicates correct predictions.
Figure A1. Confusion matrices of the BC-ResNet model in (a) Float32 and (b) INT8 formats. The pronounced degradation of the keyword “bird” (“ptak”) under INT8 quantization is visible as a weakened diagonal entry.
Figure A1. Confusion matrices of the BC-ResNet model in (a) Float32 and (b) INT8 formats. The pronounced degradation of the keyword “bird” (“ptak”) under INT8 quantization is visible as a weakened diagonal entry.
Applsci 16 07844 g0a1
Figure A2. Confusion matrices of the CNN model in (a) Float32 and (b) INT8 formats.
Figure A2. Confusion matrices of the CNN model in (a) Float32 and (b) INT8 formats.
Applsci 16 07844 g0a2
Figure A3. Confusion matrices of the CRNN model in (a) Float32 and (b) INT8 formats.
Figure A3. Confusion matrices of the CRNN model in (a) Float32 and (b) INT8 formats.
Applsci 16 07844 g0a3
Figure A4. Confusion matrices of the DS-CNN model in (a) Float32 and (b) INT8 formats.
Figure A4. Confusion matrices of the DS-CNN model in (a) Float32 and (b) INT8 formats.
Applsci 16 07844 g0a4

Appendix B. Learning Curves for All Evaluated Models

This appendix reports the full learning curves for all models. The training and validation loss and accuracy curves for all four models are shown in Figure A5, Figure A6, Figure A7 and Figure A8.
Figure A5. Training history of the CNN model: loss (left) and accuracy (right) over epochs.
Figure A5. Training history of the CNN model: loss (left) and accuracy (right) over epochs.
Applsci 16 07844 g0a5
Figure A6. Training history of the CRNN model: loss (left) and accuracy (right) over epochs.
Figure A6. Training history of the CRNN model: loss (left) and accuracy (right) over epochs.
Applsci 16 07844 g0a6
Figure A7. Training history of the DS-CNN model: loss (left) and accuracy (right) over epochs.
Figure A7. Training history of the DS-CNN model: loss (left) and accuracy (right) over epochs.
Applsci 16 07844 g0a7
Figure A8. Training history of the BC-ResNet model: loss (left) and accuracy (right) over epochs. Note that BC-ResNet uses a warmup-plus-decay learning-rate schedule (SGD), hence the different loss profile compared with the Adam-trained models.
Figure A8. Training history of the BC-ResNet model: loss (left) and accuracy (right) over epochs. Note that BC-ResNet uses a warmup-plus-decay learning-rate schedule (SGD), hence the different loss profile compared with the Adam-trained models.
Applsci 16 07844 g0a8

References

  1. Garai, S.; Samui, S. Advances in Small-Footprint Keyword Spotting: A Comprehensive Review of Efficient Models and Algorithms. arXiv 2025, arXiv:2506.11169. [Google Scholar]
  2. Rabiner, L. A tutorial on hidden Markov models and selected applications in speech recognition. Proc. IEEE 1989, 77, 257–286. [Google Scholar] [CrossRef] [PubMed]
  3. Zhang, Y.; Suda, N.; Lai, L.; Chandra, V. Hello Edge: Keyword Spotting on Microcontrollers. arXiv 2018, arXiv:1711.07128v3. [Google Scholar]
  4. Warden, P. Speech Commands: A Dataset for Limited-Vocabulary Speech Recognition. arXiv 2018, arXiv:1804.03209. [Google Scholar]
  5. Jassem, W. Polish. J. Int. Phon. Assoc. 2003, 33, 103–107. [Google Scholar] [CrossRef]
  6. Sainath, T.N.; Parada, C. Convolutional neural networks for small-footprint keyword spotting. In Proceedings of the Interspeech 2015, Dresden, Germany, 6–10 September 2015; IEEE: New York, NY, USA, 2015; pp. 1478–1482. [Google Scholar] [CrossRef]
  7. Arik, S.O.; Kliegl, M.; Child, R.; Hestness, J.; Gibiansky, A.; Fougner, C.; Prenger, R.; Coates, A. Convolutional recurrent neural networks for small-footprint keyword spotting. arXiv 2017, arXiv:1703.05390. [Google Scholar]
  8. Kim, B.; Chang, S.; Lee, J.; Sung, D. Broadcasted Residual Learning for Efficient Keyword Spotting. arXiv 2023, arXiv:2106.04140. [Google Scholar]
  9. Muratov, A. Multilingual-Speech-Commands-15lang-zip [Dataset]. 2025. Available online: https://huggingface.co/datasets/artur-muratov/multilingual-speech-commands-15lang-zip (accessed on 10 March 2026).
  10. Jacob, B.; Kligys, S.; Chen, B.; Zhu, M.; Tang, M.; Howard, A.; Adam, H.; Kalenichenko, D. Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference. arXiv 2017, arXiv:1712.05877. [Google Scholar]
  11. Chen, G.; Parada, C.; Heigold, G. Small-footprint keyword spotting using deep neural networks. In Proceedings of the 2014 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Florence, Italy, 4–9 May 2014; IEEE: New York, NY, USA, 2014; pp. 4087–4091. [Google Scholar] [CrossRef]
  12. Howard, A.G.; Zhu, M.; Chen, B.; Kalenichenko, D.; Wang, W.; Weyand, T.; Andreetto, M.; Adam, H. MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications. arXiv 2017, arXiv:1704.04861. [Google Scholar]
  13. Mazumder, M.; Chitlangia, S.; Banbury, C.; Kang, Y.; Ciro, J.M.; Achorn, K.; Galvez, D.; Sabini, M.; Mattson, P.; Kanter, D.; et al. Multilingual Spoken Words Corpus. In Proceedings of the NeurIPS Track on Datasets and Benchmarks, Virtual, 4–8 August 2021. [Google Scholar]
  14. Mazumder, M.; Banbury, C.; Meyer, J.; Warden, P.; Reddi, V.J. Few-Shot Keyword Spotting in Any Language. In Proceedings of the Interspeech 2021, Brno, Czechia, 30 August–3 September 2021; pp. 4214–4218. [Google Scholar] [CrossRef]
  15. Abdulsatar, A.A.; Davydov, V.V.; Yushkova, V.V.; Glinushkin, A.P.; Rud, V.Y. Age and gender recognition from speech signals. J. Phys. Conf. Ser. 2019, 1410, 012073. [Google Scholar] [CrossRef]
  16. Davis, S.; Mermelstein, P. Comparison of parametric representations for monosyllabic word recognition in continuously spoken sentences. IEEE Trans. Acoust. Speech Signal Process. 1980, 28, 357–366. [Google Scholar] [CrossRef]
  17. Ray, P.P. A review on TinyML: State-of-the-art and prospects. J. King Saud Univ. Comput. Inf. Sci. 2022, 34, 1595–1623. [Google Scholar] [CrossRef]
  18. TensorFlow Developers. TensorFlow Lite for Microcontrollers. 2026. Dostęp: 12.05.2026. Available online: https://developers.google.com/edge/litert/microcontrollers/overview (accessed on 15 May 2026).
  19. Lai, L.; Suda, N.; Chandra, V. CMSIS-NN: Efficient Neural Network Kernels for Arm Cortex-M CPUs. arXiv 2018, arXiv:1801.06601. [Google Scholar]
  20. David, R.; Duke, J.; Jain, A.; Reddi, V.J.; Jeffries, N.; Li, J.; Kreeger, N.; Nappier, I.; Natraj, M.; Regev, S.; et al. TensorFlow Lite Micro: Embedded Machine Learning on TinyML Systems. Proc. Mach. Learn. Syst. 2021, 3, 800–811. [Google Scholar]
  21. Raspberry Pi Ltd. Raspberry Pi Pico 2 Datasheet; An RP2350-Based Microcontroller Board; Raspberry Pi Ltd.: Cambridge, Wielka Brytania, 2024. [Google Scholar]
  22. Arm Limited. CMSIS-DSP Documentation; Version CMSIS 6; Arm Limited: Cambridge, UK, 2026; Available online: https://pip-assets.raspberrypi.com/categories/1005-raspberry-pi-pico-2/documents/RP-008299-DS-3-pico-2-datasheet.pdf (accessed on 1 March 2026).
  23. Caldwell, J. Single-Supply, Electret Microphone Pre-Amplifier Reference Design. TI Designs-Precision: Verified Design TIDU765, Texas Instruments. 2015. Available online: https://www.ti.com/lit/ug/tidu765/tidu765.pdf (accessed on 1 March 2026).
Figure 1. Block diagram of the MFCC extraction process.
Figure 1. Block diagram of the MFCC extraction process.
Applsci 16 07844 g001
Figure 2. MFCC features of a real one-second Polish keyword recording (40 coefficients × 61 frames), which form the two-dimensional input provided to the networks. The horizontal axis is the frame (time) index, and the vertical axis is the cepstral-coefficient index. The lowest coefficient (index 0) captures the frame log-energy and therefore spans a much larger range than the higher coefficients, appearing as the dark band at the bottom.
Figure 2. MFCC features of a real one-second Polish keyword recording (40 coefficients × 61 frames), which form the two-dimensional input provided to the networks. The horizontal axis is the frame (time) index, and the vertical axis is the cepstral-coefficient index. The lowest coefficient (index 0) captures the frame log-energy and therefore spans a much larger range than the higher coefficients, appearing as the dark band at the bottom.
Applsci 16 07844 g002
Figure 3. Architecture of the proposed CNN model, read as a two-column fold from top to bottom. The left column is a convolutional feature extractor that applies three successive 2D convolutional layers (16, 8, and 5 filters) to the 61 × 40 MFCC input and downsamples them with max pooling. The right column flattens the resulting feature maps and classifies them through two fully connected layers, terminating in a 25-unit softmax output, one per keyword class.
Figure 3. Architecture of the proposed CNN model, read as a two-column fold from top to bottom. The left column is a convolutional feature extractor that applies three successive 2D convolutional layers (16, 8, and 5 filters) to the 61 × 40 MFCC input and downsamples them with max pooling. The right column flattens the resulting feature maps and classifies them through two fully connected layers, terminating in a 25-unit softmax output, one per keyword class.
Applsci 16 07844 g003
Figure 4. Architecture of the proposed CRNN model. The left column is a convolutional front-end (Conv2D followed by max pooling) that reduces the 61 × 40 MFCC input; the feature maps are then reshaped into a time series and passed to the right column, where a single 32-unit GRU layer models the temporal dependencies of speech before a 25-unit softmax classification layer produces the per-keyword probabilities.
Figure 4. Architecture of the proposed CRNN model. The left column is a convolutional front-end (Conv2D followed by max pooling) that reduces the 61 × 40 MFCC input; the feature maps are then reshaped into a time series and passed to the right column, where a single 32-unit GRU layer models the temporal dependencies of speech before a 25-unit softmax classification layer produces the per-keyword probabilities.
Applsci 16 07844 g004
Figure 5. Architecture of the proposed DS-CNN model, shown folded across two columns. An initial standard convolution (stem) processes the 61 × 40 MFCC input, after which four stacked depthwise separable blocks (DS Blocks 1–4, each detailed in Figure 6) extract features. The final feature maps are aggregated by global average pooling and mapped to the 25 keyword classes by a softmax-activated dense layer.
Figure 5. Architecture of the proposed DS-CNN model, shown folded across two columns. An initial standard convolution (stem) processes the 61 × 40 MFCC input, after which four stacked depthwise separable blocks (DS Blocks 1–4, each detailed in Figure 6) extract features. The final feature maps are aggregated by global average pooling and mapped to the 25 keyword classes by a softmax-activated dense layer.
Applsci 16 07844 g005
Figure 6. Internal structure of a single depthwise separable (DS) block, which factorizes a standard convolution into two phases. In the depthwise phase (left, blue), a 3 × 3 kernel filters each input channel independently; in the pointwise phase (right, orange), a 1 × 1 convolution linearly combines the channels into the output feature maps. Each phase is followed by batch normalization and a ReLU activation.
Figure 6. Internal structure of a single depthwise separable (DS) block, which factorizes a standard convolution into two phases. In the depthwise phase (left, blue), a 3 × 3 kernel filters each input channel independently; in the pointwise phase (right, orange), a 1 × 1 convolution linearly combines the channels into the output feature maps. Each phase is followed by batch normalization and a ReLU activation.
Applsci 16 07844 g006
Figure 7. PCB with Raspberry Pi Pico 2 microcontroller.
Figure 7. PCB with Raspberry Pi Pico 2 microcontroller.
Applsci 16 07844 g007
Figure 8. Per-class accuracy (%) for every model in Float32 and INT8 formats, equal to the diagonal of the corresponding confusion matrix. Each row is a keyword (English gloss), ordered with the hardest classes at the top; each column is one of the eight model–precision combinations, with vertical lines separating the model pairs. The phonetically confusable keyword “ptak” (“bird”) is the hardest class and collapses to 40% for the INT8 BC-ResNet.
Figure 8. Per-class accuracy (%) for every model in Float32 and INT8 formats, equal to the diagonal of the corresponding confusion matrix. Each row is a keyword (English gloss), ordered with the hardest classes at the top; each column is one of the eight model–precision combinations, with vertical lines separating the model pairs. The phonetically confusable keyword “ptak” (“bird”) is the hardest class and collapses to 40% for the INT8 BC-ResNet.
Applsci 16 07844 g008
Table 1. Summary of the total numbers of parameters (trainable and non-trainable) for the evaluated neural network architectures. BC-ResNet is included as a state-of-the-art reference architecture; the remaining three are the proposed designs.
Table 1. Summary of the total numbers of parameters (trainable and non-trainable) for the evaluated neural network architectures. BC-ResNet is included as a state-of-the-art reference architecture; the remaining three are the proposed designs.
Model ArchitectureNumber of Parameters
BC-ResNet13,450
DS-CNN25,177
CRNN33,433
CNN75,982
Table 2. List of Polish words used in experiments.
Table 2. List of Polish words used in experiments.
Word (in English)Word (in Polish)Count
backwardwstecz918
bedłóżko4908
birdptak1224
catkot4362
dogpies5152
eightosiem4884
fivepięć5164
fourcztery5086
goiść5130
happyszczęśliwy4902
housedom5004
leftpo lewej1020
ninedziewięć4896
nonie31,086
offwyłączono3236
onejeden5612
readczytać4882
sevensiedem4986
sixsześć5008
threetrzy5266
treedrzewo4380
twodwa5320
writepisać4816
yestak8480
zerozero5124
Table 3. Performance of the evaluated models in Float32 (full-precision) format: classification accuracy, F1-score, model size, and mean on-device inference time on the Raspberry Pi Pico 2 (mean of 100 trials per model). The best value in each column is shown in bold.
Table 3. Performance of the evaluated models in Float32 (full-precision) format: classification accuracy, F1-score, model size, and mean on-device inference time on the Raspberry Pi Pico 2 (mean of 100 trials per model). The best value in each column is shown in bold.
ModelAccuracy (%)F1-ScoreSize (KB)Inference Time (ms)
BC-ResNet97.810.9780104.98579.1
DS-CNN97.060.970798.851693.7
CRNN96.190.9620218.79347.9
CNN88.680.8869300.64357.7
Table 4. Performance of the evaluated models after INT8 quantization: classification accuracy, F1-score, model size, and mean on-device inference time on the Raspberry Pi Pico 2 (mean of 100 trials per model). The best value in each column is shown in bold.
Table 4. Performance of the evaluated models after INT8 quantization: classification accuracy, F1-score, model size, and mean on-device inference time on the Raspberry Pi Pico 2 (mean of 100 trials per model). The best value in each column is shown in bold.
ModelAccuracy (%)F1-ScoreSize (KB)Inference Time (ms)
BC-ResNet92.730.9258101.97501.9
DS-CNN93.130.933146.15311.3
CRNN94.280.9431182.62150.3
CNN85.320.854279.44107.5
Table 5. Contextual comparison with representative small-footprint KWS studies. Prior results are on the English Google Speech Commands (GSC) dataset; the present work targets a 25-class Polish vocabulary. Accuracies refer to full-precision (Float32) models and are not directly comparable across datasets and languages.
Table 5. Contextual comparison with representative small-footprint KWS studies. Prior results are on the English Google Speech Commands (GSC) dataset; the present work targets a 25-class Polish vocabulary. Accuracies refer to full-precision (Float32) models and are not directly comparable across datasets and languages.
StudyArchitectureDataset (Language, Classes)Accuracy (%)
Zhang et al. [3]DS-CNNGSC (English, 12)95.4
Kim et al. [8]BC-ResNet-1GSC (English, 12)96.6
This workBC-ResNet (reference)Polish, 2597.81
This workDS-CNN (proposed)Polish, 2597.06
This workCRNN (proposed)Polish, 2596.19
This workCNN (proposed)Polish, 2588.68
Table 6. Computational and memory characteristics of the evaluated TFLite models. “Operations” is the number of multiply–accumulate operations per inference, which is identical for the Float32 and INT8 variants of a model. “Intermediate buffers” is the total size of the intermediate tensors (a proxy for memory traffic), and “Peak buffer” is the largest single intermediate tensor (a proxy for the tensor-arena size). File sizes are reported in Table 3 and Table 4.
Table 6. Computational and memory characteristics of the evaluated TFLite models. “Operations” is the number of multiply–accumulate operations per inference, which is identical for the Float32 and INT8 variants of a model. “Intermediate buffers” is the total size of the intermediate tensors (a proxy for memory traffic), and “Peak buffer” is the largest single intermediate tensor (a proxy for the tensor-arena size). File sizes are reported in Table 3 and Table 4.
ModelVariantOperations (M)Intermediate Buffers (KiB)Peak Buffer (KiB)
BC-ResNetFloat324.205797.795.3
INT81474.429.8
DS-CNNFloat3226.351561.5155.0
INT8398.138.8
CRNNFloat322.52492.8140.1
INT8167.535.0
CNNFloat326.87562.3286.9
INT8579.0288.6
Table 7. Per-sample acoustic measurements obtained from the electret-microphone front-end recordings. SNR was estimated using the lowest-energy decile of 20 ms frames as a noise-floor proxy. Roll-off denotes the highest frequency bin within 20 dB of the spectral peak. No clipping was detected in any sample (<0.001%).
Table 7. Per-sample acoustic measurements obtained from the electret-microphone front-end recordings. SNR was estimated using the lowest-energy decile of 20 ms frames as a noise-floor proxy. Roll-off denotes the highest frequency bin within 20 dB of the spectral peak. No clipping was detected in any sample (<0.001%).
Sample (Polish)Sample (English)RMS (dBFS)SNR (dB)Roll-Off (Hz)
jedenone 27.7 10.7 1875
dwatwo 27.0 11.8 1109
czteryfour 27.7 10.7 1516
pięćfive 31.9 6.3 1898
osiemeight 29.4 8.7 1586
dziewięćnine 28.9 9.0 1719
łóżkobed 27.0 10.6 742
Mean ± SD 28.6 ± 1.5 9.7 ± 1.7 1492 ± 393
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Sobczyk, J.; Fonał, K. Efficient Polish-Language Keyword Spotting on Microcontrollers: Compact Neural Architectures, Quantization, and On-Device Validation on the Raspberry Pi Pico 2. Appl. Sci. 2026, 16, 7844. https://doi.org/10.3390/app16157844

AMA Style

Sobczyk J, Fonał K. Efficient Polish-Language Keyword Spotting on Microcontrollers: Compact Neural Architectures, Quantization, and On-Device Validation on the Raspberry Pi Pico 2. Applied Sciences. 2026; 16(15):7844. https://doi.org/10.3390/app16157844

Chicago/Turabian Style

Sobczyk, Jakub, and Krzysztof Fonał. 2026. "Efficient Polish-Language Keyword Spotting on Microcontrollers: Compact Neural Architectures, Quantization, and On-Device Validation on the Raspberry Pi Pico 2" Applied Sciences 16, no. 15: 7844. https://doi.org/10.3390/app16157844

APA Style

Sobczyk, J., & Fonał, K. (2026). Efficient Polish-Language Keyword Spotting on Microcontrollers: Compact Neural Architectures, Quantization, and On-Device Validation on the Raspberry Pi Pico 2. Applied Sciences, 16(15), 7844. https://doi.org/10.3390/app16157844

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop