Abstract
We propose a max-pooling based loss function for training Long Short-Term Memory (LSTM) networks for small-footprint keyword spotting (KWS), with low CPU, memory, and latency requirements. The max-pooling loss training can be further guided by initializing with a cross-entropy loss trained network. A posterior smoothing based evaluation approach is employed to measure keyword spotting performance. Our experimental results show that LSTM models trained using cross-entropy loss or max-pooling loss outperform a cross-entropy loss trained baseline feed-forward Deep Neural Network (DNN). In addition, max-pooling loss trained LSTM with randomly initialized network performs better compared to cross-entropy loss trained LSTM. Finally, the max-pooling loss trained LSTM initialized with a cross-entropy pre-trained network shows the best performance, which yields $67.6\%$ relative reduction compared to baseline feed-forward DNN in Area Under the Curve (AUC) measure.
Introduction
Keyword spotting (KWS) is the "always-on" technology that listens for wake words like "Alexa" or "Hey Siri." Because these systems run locally on devices with limited hardware, they must have a "small footprint"—meaning low CPU usage, minimal memory consumption, and near-instant latency.
Traditional training methods involve frame-level cross-entropy loss, which forces the model to predict the keyword for every single 10ms frame within a labeled keyword segment. However, this approach has two major flaws: human or automated alignments are often "fuzzy," leading to noisy training data, and LSTMs often reach peak confidence toward the end of a word after hearing the full context. Forcing the model to fire early can degrade overall performance. This paper introduces a "max-pooling loss" function designed to train small-footprint LSTM networks by allowing the model to focus on the most informative frames within a keyword segment.
Methods
The authors propose a system using a unidirectional LSTM paired with a projection layer to reduce the total number of parameters to approximately 118K, ensuring the model fits within strict hardware constraints.
The core innovation is the Max-Pooling Loss function. In the standard cross-entropy approach, every frame in a keyword segment is treated as a target. In contrast, the max-pooling approach identifies the single frame where the model is already most confident (the maximum posterior) within a given keyword segment. It then only back-propagates the loss for that specific frame, discarding the others in that segment. All frames labeled as "background" (silence or non-keyword speech) are still trained using standard cross-entropy to ensure the model learns what not to trigger on.
The researchers found that the most effective strategy was a "warm start": pre-training the model with standard cross-entropy first to learn basic features, then fine-tuning it with the max-pooling loss.
Datasets
The study used a large-scale, in-house far-field corpus from Amazon focusing on the keyword "Alexa." Far-field data, recorded from a distance, is significantly more challenging than close-talk data due to noise and reverberation. The dataset used is an order of magnitude larger than those in previous landmark KWS studies, providing high statistical confidence in the results.
Results and Insights
Performance was measured using Detection Error Tradeoff (DET) curves, focusing on the "miss rate" versus the "false accept rate." The results demonstrated significant improvements over traditional architectures:
- Baseline (DNN): Standard feed-forward model.
- LSTM + Cross-Entropy: Provided a 34.4% relative reduction in AUC over the baseline.
- LSTM + Max-Pooling (Random Init): Provided a 48.2% relative reduction.
- LSTM + Max-Pooling (CE Pre-trained): The clear winner, providing a 67.6% relative reduction in AUC.
The primary insight is that the model often "knows" better than the static labels. By using max-pooling, the researchers allow the LSTM to pick the most informative moment in a sequence to trigger. This leverages the LSTM's temporal memory, encouraging it to fire near the end of a keyword segment after it has accumulated enough evidence, making the system much more robust to time-alignment jitter in training data.
Conclusion
The proposed max-pooling loss allows for much higher accuracy while maintaining the same low rate of false alarms. Future work will explore weighting schemes for the max-pooling loss, performance on a wider variety of keywords, and comparisons against other segmental loss functions like Connectionist Temporal Classification (CTC).
Summary updated