U2-KWS: Unified Two-Pass Open-Vocabulary Keyword Spotting with Keyword Bias

Ao Zhang, Pan Zhou, Kaixun Huang, Yong Zou, Ming Liu, Lei Xie

Introduction

Keyword Spotting (KWS) is the foundational technology that enables "always-on" voice activation for modern smart devices. While traditional KWS systems are hard-coded for specific phrases during training, there is a growing demand for open-vocabulary KWS, which allows users to define their own custom wake words.

Existing open-vocabulary methods typically repurpose standard Automatic Speech Recognition (ASR) models. However, because these models are trained to recognize all speech equally, they often lack the sensitivity required for specific, user-defined keywords. This "optimization gap" leads to two primary failures: missed triggers and frequent false alarms. To resolve this, we present U2-KWS, a unified two-pass framework that integrates keyword-specific bias into both a streaming detection stage and a non-streaming verification stage.

The U2-KWS Architecture

Inspired by the Unified Two-pass (U2) ASR framework, U2-KWS utilizes a shared Conformer encoder to power two distinct decoding branches within a single model.

1. First-Pass: Streaming Detection

The first pass employs a lightweight Connectionist Temporal Classification (CTC) branch. This branch operates as an "always-on" detector, processing audio frame-by-frame to identify potential keyword candidates in real-time. This ensures the system remains responsive with minimal latency.

2. Second-Pass: Non-streaming Verification

When the CTC branch detects a potential candidate, the Attention Decoder is activated. This second pass is non-streaming and processes only the specific segment of audio identified in the first pass. By looking at the entire segment with full context, the Attention Decoder acts as a high-precision filter to eliminate false alarms.

Key Innovations

Keyword Bias Modules

Rather than relying on a general-purpose ASR model, U2-KWS introduces Keyword Bias Modules using cross-attention. This forces the model to prioritize the specific phonetic patterns of the user's chosen keyword.

  • Acoustic-Query Attention: Biases the streaming encoder during the first pass.
  • Keyword-Query Attention: Verifies the audio against the text of the keyword during the second pass.

Spike-based Clipping

To maintain efficiency, the model must accurately isolate the keyword from the continuous audio stream. U2-KWS utilizes a spike-triggered method derived from the CTC branch's output. By identifying the timestamps of phonetic "spikes," the system can determine the start and end of a keyword without the need for complex external alignment data.

Experimental Results

The model was evaluated on a 1,000-hour internal Mandarin dataset (recorded in hybrid electric vehicles) and the public AISHELL-1 corpus.

Performance Gains

U2-KWS demonstrated a significant leap in performance over traditional customized KWS systems:

  • Wake-up Rate: The system achieved a 41% relative improvement in wake-up rate at a fixed false alarm rate (0.5 times per hour).
  • F1-Score: The full U2-KWS model reached an F1-score of 0.910, compared to 0.790 for the baseline CTC model.

Keyword Length Sensitivity

The research found that the system performs significantly better on longer keywords (3-4 characters) than short ones (2 characters). Longer keywords provide more phonetic context, making them easier for the model to distinguish from background noise or similar-sounding speech.

Conclusion and Future Work

U2-KWS effectively transforms a general-purpose listener into a specialized "bounty hunter" for specific keywords. By combining the efficiency of streaming detection with the accuracy of non-streaming verification, the framework offers a robust solution for open-vocabulary KWS.

While the current model is compact (4.75M parameters) and suitable for edge deployment, future research will focus on improving performance for very short keywords and expanding the phonetic modeling beyond Mandarin Chinese to support a wider range of languages.

Summary updated

BibTeX
@inproceedings{zhang2023u,
  author = {Ao Zhang and Pan Zhou and Kaixun Huang and Yong Zou and Ming Liu and Lei Xie},
  title = {{U2-KWS: Unified Two-Pass Open-Vocabulary Keyword Spotting with Keyword Bias}},
  booktitle = {ASRU},
  year = {2023},
  doi = {10.1109/asru57964.2023.10389755},
}
Figure