Contrastive Learning With Audio Discrimination For Customizable Keyword Spotting In Continuous Speech

Yu Xi, Baochen Yang, Hao Li, Jiaqi Guo, Kai Yu · DOI

Introduction

Keyword Spotting (KWS) serves as the primary interface for voice-activated systems, enabling devices to respond to specific "wake-words." While fixed-keyword systems (e.g., "Hey Siri") are highly optimized, the industry is shifting toward customizable KWS, where users define their own trigger phrases. This flexibility introduces significant technical challenges, particularly in balancing computational efficiency with detection accuracy in continuous speech.

Traditional approaches generally fall into two categories: complex two-stage systems that utilize graph-based searches, and end-to-end representation matching systems. While graph-based methods are robust, they are computationally intensive and slow. Conversely, end-to-end models are lightweight but frequently struggle with "hard negatives"—audio segments that phonetically resemble the keyword—and the fluid nature of continuous speech where words often bleed into one another (co-articulation).

This paper introduces CLAD (Contrastive Learning with Audio Discrimination), an end-to-end framework designed to bridge this performance gap by achieving high-speed inference without sacrificing the ability to discriminate between similar-sounding audio segments.

The CLAD Methodology

The core innovation of CLAD is its dual-loss strategy, which moves beyond simple audio-to-text matching. Most contrastive learning models for KWS focus solely on aligning an audio representation with a text embedding. CLAD introduces a second layer of supervision: Audio-Audio Discrimination.

Dual-Loss Strategy

The model is trained using a combined InfoNCE loss function:

  1. Audio-Text Matching ($L_{at}$): Ensures that the audio representation of a keyword (e.g., "Apple") aligns closely with its corresponding text embedding.
  2. Audio-Audio Discrimination ($L_{aa}$): Forces the model to distinguish between different acoustic realizations of the same keyword and segments that are confusingly similar but incorrect.

By forcing the model to compare audio segments against one another, CLAD learns to ignore the "noise" of co-articulation and focuses on the unique phonetic signatures required for accurate detection in a continuous stream of speech.

System Architecture and Implementation

CLAD utilizes a streamlined architecture to maintain high inference speeds. The system employs a 5-layer Deep Feedforward Sequential Memory Network (DFSMN) as an acoustic extractor, followed by Bidirectional Long Short-Term Memory (BLSTM) layers to generate final embeddings for both audio and text.

To handle continuous speech, the system implements a Sliding Window Estimation. The optimal window length is calculated based on the average phoneme length of the target keyword, plus a predefined margin ($L_{margin}$) to capture necessary context and co-articulation. Because the system relies on simple vector similarity (cosine similarity) rather than a complex decoding graph, the computational overhead remains minimal.

Experimental Setup

The researchers evaluated CLAD on two primary benchmarks:

  • LibriPhrase: A dataset specifically designed for isolated KWS, containing "easy" and "hard" negative samples to test the model's discriminative power.
  • Continuous LibriSpeech: The authors adapted the 960-hour LibriSpeech corpus for continuous KWS by selecting the 50 most frequent words (minimum six phonemes) as keywords, using the remaining audio to test for false alarms.

Results and Key Insights

The experimental results demonstrate that CLAD offers a superior trade-off between speed and accuracy compared to existing baselines.

  • Efficiency: CLAD achieved a 16.95x Relative Speed Acceleration (RSA) over traditional graph-based search methods, making it highly suitable for real-time applications.
  • Robustness in Continuous Speech: On the challenging "test-other" portion of LibriSpeech—which contains higher noise levels and varied accents—CLAD outperformed both graph-based and post-processing baselines. For a set of 5 keywords, CLAD reached a 0.754 micro recall, significantly higher than the 0.696 achieved by graph-based methods.
  • Discriminative Accuracy: On the LibriPhrase "hard negatives" test, CLAD achieved an Equal Error Rate (EER) of 30.30%. This is a notable improvement over standard InfoNCE approaches (32.51%) and a massive leap over Triplet loss models (44.36%).

Furthermore, the CLAD model exhibited lower standard deviation in performance across different keywords, suggesting that the representation-based approach is more stable and less likely to fail on specific, phonetically difficult words.

Conclusion and Future Work

CLAD represents a significant advancement in customizable KWS, proving that end-to-end models can achieve high-fidelity discrimination in continuous speech while maintaining a massive speed advantage.

Future research may focus on refining the sliding window mechanism. Currently, the window length depends on a fixed phoneme-based estimate; making this margin dynamic—adjusting for speaking rates or phonetic complexity—could further enhance performance. Additionally, while the model's 2.2 million parameters are efficient, further study into the power consumption of BLSTMs on ultra-low-power digital signal processors (DSPs) will be essential for widespread on-device deployment.

Summary updated

BibTeX
@inproceedings{xi2024contrastive,
  author = {Yu Xi and Baochen Yang and Hao Li and Jiaqi Guo and Kai Yu},
  title = {{Contrastive Learning With Audio Discrimination For Customizable Keyword Spotting In Continuous Speech}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2024},
  doi = {10.1109/icassp48485.2024.10447881},
}
Figure