Attention-based End-to-End Models for Small-Footprint Keyword Spotting

Changhao Shan, Junbo Zhang, Yujun Wang, Lei Xie

Introduction

Keyword spotting (KWS) is the foundational technology enabling "always-on" voice assistants like "Hey Siri" or "OK Google." The primary challenge in KWS is a difficult balancing act: maintaining high accuracy (minimizing both false alarms and missed triggers) while operating within the strict memory and battery constraints of mobile devices.

Traditional KWS systems often rely on complex pipelines, such as Large Vocabulary Continuous Speech Recognition (LVCSR) systems which are computationally heavy, or Hidden Markov Models (HMMs) that require expensive Viterbi decoding. Even modern "Deep KWS" systems typically require frame-level alignments during training—a process where every millisecond of audio must be manually or automatically labeled to correspond with specific syllables. This paper introduces a streamlined, attention-based end-to-end neural network that simplifies this process while achieving state-of-the-art performance.

The End-to-End Architecture

The proposed system replaces complex pipelines with a simple "Encoder + Attention" architecture. This end-to-end approach allows the model to learn to detect keywords directly from audio without needing pre-aligned labels or complex search graphs.

The proposed attention-based end-to-end architecture consisting of an encoder, attention mechanism, and classifier.

Core Components

  1. The Encoder: A Recurrent Neural Network (RNN)—using LSTM, GRU, or a Convolutional Recurrent Neural Network (CRNN)—processes input audio features (Mel-spectrograms) into high-level representations.
  2. The Attention Mechanism: This is the system's "secret sauce." Rather than treating every audio frame as equally important, the attention layer learns to assign weights ($\alpha_t$) to different parts of the audio. It effectively "focuses" on the keyword syllables while ignoring background noise or silence. The authors found that Soft Attention (learned non-linear weighting) significantly outperformed uniform Average Attention.
  3. The Classifier: A simple linear layer and softmax function take the weighted summary ($c$) from the attention layer to output a final detection score.

During inference, the system utilizes a sliding window approach, processing one new frame at a time to maintain the low latency required for real-time applications.

Experimental Setup

The models were evaluated using a large-scale, real-world dataset from the Mi AI Speaker, focusing on the four-syllable Mandarin wake-up word "xiao-ai-tong-xue."

  • Data: The training set included approximately 100 hours of positive examples and over 1,500 hours of negative examples.
  • Features: The system uses 40-channel Mel-filterbank features converted to Per-Channel Energy Normalized (PCEN) spectrograms, which enhance robustness against varying environmental noise.

Key Results and Insights

The attention-based models demonstrated a significant leap in performance over standard baselines. The "Soft Attention" mechanism acts as a filter, mimicking human hearing by focusing on high-resolution focal points in the audio stream.

Performance comparison (ROC curves) showing the impact of attention mechanisms on DNN, LSTM, and GRU models.

Performance Highlights

  • Accuracy: The best-performing model, a CRNN with soft attention, achieved a 1.02% False Rejection Rate (FRR) at 1.0 False Alarm (FA) per hour.
  • The Power of Attention: Adding soft attention to a standard GRU-based system slashed the error rate from 6.38% to 1.93% while maintaining a similar parameter count.
  • Efficiency: The architecture is highly optimized for low-power digital signal processors (DSPs), with the best models requiring only ~84K parameters and ~83.3K multiplies per frame. This is significantly more efficient than many CNN-only architectures.
  • Encoder Comparison: GRU encoders generally outperformed LSTMs in this task, providing superior accuracy with a smaller footprint.

Conclusion

By moving to an end-to-end attention-based model, the authors have simplified the KWS training pipeline while simultaneously improving accuracy and efficiency. While the current model is trained for a fixed vocabulary, its small footprint and high performance make it an ideal candidate for next-generation mobile and IoT devices. Future work may focus on further optimizing the trade-off between the attention window size and trigger latency, as well as testing robustness in more extreme far-field acoustic environments.

Summary updated

BibTeX
@inproceedings{shan2018attention,
  author = {Changhao Shan and Junbo Zhang and Yujun Wang and Lei Xie},
  title = {{Attention-based End-to-End Models for Small-Footprint Keyword Spotting}},
  booktitle = {Interspeech},
  year = {2018},
  doi = {10.21437/interspeech.2018-1777},
}
Figure