Contrastive Speech Mixup for Low-resource Keyword Spotting

Dianwen Ng, Ruixi Zhang, Jia Qi Yip, Chong Zhang, Yukun Ma, Trung Hieu Nguyen, Chongjia Ni, Eng Siong Chng, Bin Ma · DOI

Introduction

Keyword Spotting (KWS) is a critical component of modern voice-activated systems, enabling devices to respond to specific wake-words like "Hey Siri" or "OK Google." While state-of-the-art deep learning models excel at KWS, they typically require vast amounts of labeled data. This data dependency poses a significant challenge for personalized KWS, where models must adapt to a specific user's voice or a new keyword using only a few samples.

To address this "low-resource" challenge, researchers have introduced CosMix (Contrastive Speech Mixup). This novel training framework combines traditional data augmentation with contrastive learning to extract richer representations from minimal audio data—as little as 2.5 minutes per keyword.

The CosMix Framework

The core innovation of CosMix is the integration of an auxiliary contrastive loss into the standard "mixup" augmentation process.

In vanilla mixup, two random audio samples ($x_i, x_j$) are linearly blended to create a virtual sample ($\tilde{x}$), with their labels mixed proportionally. While effective, this can create spatially ambiguous audio that confuses complex models like Transformers. CosMix mitigates this by enforcing a similarity constraint: the model is tasked with recognizing the relationship between the original individual samples and the resulting mixed version.

The CosMix training framework integrates shared encoding networks with a contrastive similarity loss to guide the learning of mixed samples.

As shown in Figure 1, the framework utilizes a shared encoding network. Representations are passed to a projector that maps them to a 128-dimensional space for contrastive loss calculation. A key technical detail is the use of a stop-gradient (sg) operation on the original samples' paths, ensuring the contrastive task supports the primary keyword classification without interfering with its optimization.

Experimental Setup

The researchers evaluated CosMix using the Google Speech Command V2 dataset. To simulate low-resource conditions, they created subsets representing 5%, 10%, 20%, 30%, and 50% of the training data. The 5% split is particularly aggressive, providing only approximately 2.5 minutes of audio per keyword.

Results and Performance

CosMix demonstrated consistent performance gains across multiple architectures, including ResNet18, Keyword Transformers (KWT), and ConvMixer.

Performance comparison across different models and training data sizes. CosMix consistently outperforms baseline and vanilla mixup methods.

As detailed in Figure 5, the improvements are most pronounced in the most data-constrained settings. For instance, the Transformer-based KWT-3 model saw its accuracy jump from 46.5% to 56.6% on the 5% data split when using CosMix.

Beyond raw accuracy, qualitative analysis using t-SNE visualizations revealed that CosMix leads to much tighter and more distinct clusters for different keywords compared to baseline methods. This suggests that the contrastive guidance helps the model learn more robust, separable features even when the input signal is noisy or blended.

Key Insights

  • Lightweight Robustness: The Keyword ConvMixer emerged as a standout performer. Despite having only 0.1M parameters, it achieved 90.2% accuracy on the 5% split, highlighting the efficiency of convolutional architectures for edge-device KWS.
  • Balanced Mixing: Ablation studies indicated that a $Beta(10, 10)$ distribution, which favors more equal mixing of samples, outperformed the more skewed $Beta(0.5, 0.5)$ distribution. This suggests that challenging the model with balanced mixtures forces it to learn more effectively.
  • Transformer Sensitivity: Transformer models (like KWT-3) are particularly sensitive to data scarcity. CosMix provides the necessary "supervision" to help these data-hungry models converge in low-resource environments.

Conclusion and Future Work

CosMix represents a significant step forward for low-resource keyword spotting, offering a general-purpose augmentation strategy that improves model robustness and feature separability. While highly effective on clean datasets, future research is needed to evaluate its performance against heavy environmental noise and its utility in cross-lingual transfer learning. Nonetheless, the "negligible computational overhead" of CosMix makes it a promising candidate for real-world, on-device adaptation tasks.

Summary updated

BibTeX
@inproceedings{ng2023contrastive,
  author = {Dianwen Ng and Ruixi Zhang and Jia Qi Yip and Chong Zhang and Yukun Ma and Trung Hieu Nguyen and Chongjia Ni and Eng Siong Chng and Bin Ma},
  title = {{Contrastive Speech Mixup for Low-resource Keyword Spotting}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2023},
  url = {https://openreview.net/forum?id=BosP1fJjJ0},
}
Figure