Learning Speaker Embedding with Momentum Contrast

Ke Ding, Xuanji He, Guanglu WanarXiv 2020 · OpenReview

Abstract

Speaker verification can be formulated as a representation learning task, where speaker-discriminative embeddings are extracted from utterances of variable lengths. Momentum Contrast (MoCo) is a recently proposed unsupervised representation learning framework, and has shown its effectiveness for learning good feature representation for downstream vision tasks. In this work, we apply MoCo to learn speaker embedding from speech segments. We explore MoCo for both unsupervised learning and pretraining settings. In the unsupervised scenario, embedding is learned by MoCo from audio data without using any speaker specific information. On a large scale dataset with 2,500 speakers, MoCo can achieve EER 4.275% trained unsupervisedly, and the EER can decrease further to 3.58% if extra unlabelled data are used. In the pretraining scenario, encoder trained by MoCo is used to initialize the downstream supervised training. With finetuning on the MoCo trained model, the equal error rate (EER) reduces 13.7% relative (1.44% to 1.242%) compared to a carefully tuned baseline training from scratch. Comparative study confirms the effectiveness of MoCo learning good speaker embedding.

Introduction

Speaker verification (SV) relies on fixed-length mathematical representations of a person's voice, known as embeddings. Traditionally, these are learned using supervised methods like x-vectors, which require massive amounts of labeled data. Contrastive learning, which teaches a model to pull similar samples together and push different samples apart, is conceptually ideal for SV but difficult to implement due to the need for "hard negative mining"—a computationally expensive process. This paper explores adapting Momentum Contrast (MoCo), a state-of-the-art unsupervised framework from computer vision, to bypass these hurdles and learn discriminative speaker features from both labeled and unlabeled audio data.

Methodology

The authors implement the MoCo framework for audio by treating speaker verification as an instance discrimination task.

Momentum Contrast (MoCo)

Instead of comparing a sample against every other sample in a batch, MoCo maintains a large queue of representations from previous batches. It utilizes two encoders: a standard query encoder ($q$) that updates via backpropagation and a momentum encoder ($k$) that updates slowly as a moving average of the first. This architecture ensures the queue of negative samples remains consistent and large without requiring excessive GPU memory.

The MoCo framework for speaker embedding learning.

Audio Data Augmentation

To create positive pairs for contrastive learning, the authors take a single utterance and randomly select two different segments. They then apply SpecAugment, masking blocks of frequency and time in the spectrogram. This forces the model to learn speaker-invariant features despite temporal shifts and spectral distortions.

MoCo as Pretraining

Beyond standalone feature extraction, MoCo is used to initialize the weights of a supervised model using Additive Angular Margin (AAM) loss. This unsupervised "warm-starting" aims to improve final verification accuracy.

Experimental Setup

The study utilizes three primary data sources:

  • Dataset A: An internal dataset of ~3,000 speakers used for supervised training and evaluation.
  • Dataset B: A massive unlabeled dataset containing ~7.6 million utterances (~9,000 hours).
  • VoxCeleb: A standard public benchmark (VoxCeleb1 and VoxCeleb2) for validation.

Results and Discussion

MoCo allows unsupervised models to approach the performance of supervised ones. Standalone MoCo achieved an EER of 4.275%, dropping to 3.58% with additional unlabeled data.

A key finding is the synergy between MoCo and AAM loss. MoCo pretraining is significantly more effective than traditional cross-entropy pretraining when the final goal is an AAM-loss model. This is likely because both MoCo and AAM loss encourage representations to reside on a hyper-sphere, optimizing for cosine similarity.

DET curves for different speaker verification systems. The MoCo-pretrained model (blue) shows superior performance.

As shown in the DET curves, using MoCo as a pretraining step for a supervised x-vector model reduced the EER by 13.7% relative (from 1.44% down to 1.242%) compared to a model trained from scratch.

Conclusion

This work demonstrates that MoCo is a powerful framework for learning speaker embeddings. It effectively utilizes unlabeled data to boost performance and serves as an excellent pretraining strategy for supervised models. Future work will explore backend sensitivity, specifically why performance gains are less clear with PLDA compared to cosine similarity, and investigate a wider variety of data augmentations like noise injection.

Summary updated

BibTeX
@misc{ding2020learning,
  author = {Ke Ding and Xuanji He and Guanglu Wan},
  title = {{Learning Speaker Embedding with Momentum Contrast}},
  year = {2020},
  eprint = {2001.01986},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2001.01986},
}
Figure