Motivation

使用预训练模型提取语音声学特征从而提高当前说话人识别系统的性能。

Self-Supervised Pretrain speech representation for Speaker Recogntion

The goal of speech representation learning is to find a transformation from the surface features that makes high-level properties of speech more accessible to downstream tasks.

avatar

Backgroud

在说话人识别任务中,第一步大多都是对语音进行声学特征提取,从语音信号中提取例如 mfcc, fbank 这样的声学特征。通过提取声学特征,一帧高维度的语音信号(waveform)可以号用一个12~40维向量简洁地表示出来;一整段语音信号,就被表示为这种向量的一个序列。例如,梅尔刻度 (Mel scale)是一种基于人耳对等距的音高(pitch)变化的感官判断而定的非线性频率刻度,它与频率关系如下:

$$M(f) = 2595 \cdot log_{10}(1+\frac{f}{700})$$

MFCC 的性能表现可能会受到如下因素的影响:

  1. the number of filters
  2. the shape of filters
  3. the way that filters are spaced
  4. the way that the power spectrum is warped

这些传统的声学特征是根据人耳的感知机理,例如掩蔽效应,人为设计的特征提取方法。这类方法可能并不适用于计算机的模式识别,使用传统的声学特征用于说话人识别可能存在一定的不合理性。例如:

  1. 声学特征提取过程中可能会存在一定的信息损失,导致识别性能降低。
  2. 声学特征参数的选取往往依赖于人的经验。不同的参数设置,会导致不同的系统识别的性能。
  3. 提取特征的过程中可能没有考虑人说话的上下文 context 信息。

What is self-supervised learning?

最近,self-supervised learning 逐渐成为科研工作者们的关注重点。self-supervised learning 是无监督学习里的一类方法,主要是希望能够学习到一种通用的特征表达用于下游任务

Yann LeCun in AAAI2020

in self-supervised learning, the systerm learns to predict part of its input from other parts of it input.

  • Goal: Learning to represent the world before learning tasks.
  • Predict any part of the input from any other part
  • Predict the future from the recent past
  • Predict the past from the present
  • Predict the top from the bottom

什么是一个好的 Representation ?

  1. high-performing on a diverse set of downstream tasks using simple models
  2. useful in transfer learning with small amounts of data for a new task

自监督学习已经在 CV 和 NLP 领域取得了极大的成功,以大名鼎鼎的 BERT 模型为例,它利用大规模无标注语料训练、获得文本的包含丰富语义信息的 Representation,然后将文本的语义表示在特定 NLP 任务中作微调后应用于该任务上。

目前self-supervised learning的主要有如下方法:

avatar

在 speech 领域,也有很多大佬进行了一系列的探索。从 interspeech2020 和 ICML2020 两个学术会议中,我们可以看出未来应该会有更多的大佬加入 self supervised learning 在 speech 领域的研究。

  1. Interspeech2020 Special Session: New Trends in self-supervised speech processing
  2. ICML2020: Self-supervision in Audio and Speech

Contrastive Predictive Coding

Contrastive Predictive Coding (CPC) 是由 Google DeepMind 出品的非常有代表性的自监督学习方法,可以用于语音、图片、文本以及强化学习。CPC的主要思想就是基于 context 信息的未来数据预测,以及通过采样的方式进行训练。

avatar

CPC 的出发点是最大化context vector $c$ 和数据输入 $x$ 之间的互信息(Mutual Information),使得 $c$ 包含足够的原始数据信息,因而可以作为新的特征表示。互信息定义如下:

$$MI(x;c) = \sum_{x,c}p(x,c)log\frac{p(x|c)}{p(x)}$$

“对比学习”中的“对比”是 positive 样本 和 negative 样本的对比。在学习到的“表示空间”内,增大某样本与其 positive 样本之间的相似度,减少与negative 样本的相似度。CPC 目标是学习一个 encoder $f$

$$\textrm{score}(f(x),f(x^{+})) >> \textrm{score}(f(x), f(x^{-}))$$

score 函数是相似度的度量,例如可以设置为 $\textrm{score}(a, b) = a^Tb$。一般在一个训练批量的 $N$ 个样本中,使用 1 个 positive 样本和 $N-1$ 个 negative 样本。

如果大量无监督但数据采样训练,最大化互信息,我们可以得到数据新的表征。非常值得一提的是,论文中对不同说话人表征在 $t-SNE$ 可视化图中展现出了不错的区分性。

avatar

WAV2VEC

依据 CPC 论文的思路,FaceBook FAIR 团队提出了 wav2vec 模型利用大量未标记的音频数据预训练的方法用于提高 ASR 系统的性能。预训练模型是在 Fairseq 工具包中的 PyTorch 中实现的。

avatar

模型由两个卷积神经网络组成:

  • Encoder Network $x \rightarrow z$ : embeds the audio signal in a latent space
  • Context Network $z \rightarrow c$ : combines multiple time-steps of the encoder to obtain contextualized representations

与 CPC 原论文里略有不同的是,在 Context Network 上,wav2vec 采用的是卷积神经网络,而 CPC 采用的 Autoregressive Model 自回归模型,因此在 infer 的速度上 wav2vec 会更快。

预训练结束后,将上下文网络 $c_i$ 生成的表示形式作为声学特征输入,而不是使用 log-mel 滤波器组特征。

Self-Supervised Feature for Speaker Recongnition

我想使用 self supervised learning 的方法改进当前说话人识别系统。创新点在于利用了大量无说话人 label 的语音数据去提高当前说话人识别系统的性能

首先通过大量没有任何标注的语音数据,依据语音时序上的上下文 context 信息,使用神经网络去重新学一个更加合理 speech 的 representation。这类 self-supervised features 对语音信号前后关系有更好地建模。可以对于说话人长时性描述更强。之后我们通过预训练好的模型,对语音进行特征提取,新的声学特征将取代 mfcc 和 fbank 这类传统的声学特征,作为说话人模型对输入。我们利用这种新的特征,和传统 i-vector 和 x-vector 表征学习相互结合。

总结来说就是使用预训练模型提取语音声学特征取代 mfcc 和 fbank 从而提高当前说话人识别系统的性能。预期可能取得如下结果:

  1. 进一步提高当前的说话人识别系统的性能,成为新的STOA。
  2. 说话人训练数据在 low resources 的情况下取得更好的性能。例如 self supervised feature+100个spk数据集训练出来的模型性能约等于甚至好于 mfcc+500个spk数据集训练出的模型。
  3. 降低当前说话人识别模型的参数量,即 x-vector 模型的网络结构不需要很深很复杂也可以达到不错的说话人识别效果。
  4. 进一步提高当前 anti-spoofing 系统的性能。

My Experiment

Toolkits

我的实验主要使用了如下两个工具:

  1. fairseq: 它是一个由 facebook AI research 团队维护的 seq2seq 模型工具包,wav2vec 是 fairseq 内的一个子项目,其中同时开源了相关的一些预训练模型
  2. Kaldi: 它是一个主要由 Danney Povey 等人主要维护的语音工具包,其中包含了经典的说话人识别模型 (i-vector, x-vector等) 的全部 pipline 代码

Dataset & Configs

为了快速验证这个想法,我在一个含有100个说话人的小规模的命令词数据集上,分别使用了几个不同的声学特征提取方法进行了3组实验。我们使用80个说话人进行说话人模型的训练,另外20个人用于测试。具体配置如下:

Group 1: Average Pooling

  • baseline MFCC average: MFCC feature with average pooling
  • wav2vec c average: wav2vec pretrain feature c with average pooling
  • wav2vec z average: wav2vec pretrain feature z with average pooling

Group 2: i-vector

  • baseline MFCC i-vector: MFCC feature with i-vector ASV system
  • wav2vec c i-vector: wav2vec pretrain feature c with i-vector ASV system
  • wav2vec z i-vector: wav2vec pretrain feature z with i-vector ASV system

Group 3: x-vector

  • baseline MFCC x-vector: MFCC feature with x-vector ASV system
  • wav2vec c x-vector: wav2vec pretrain feature c with x-vector ASV system
  • wav2vec z x-vector: wav2vec pretrain feature z with x-vector ASV system

Result

Group 1: Average Pooling

Equel Error Rate MFCC average wav2vec c average wav2vec z average
cosine 24.59 % 33.52 % 27.51 %
PLDA 11.68 % 8.697 % 5.92 %
LDA PLDA 13.25 % 8.614 % 5.981 %

Group 2: i-vector

Equel Error Rate MFCC i-vector wav2vec c i-vector wav2vec z i-vector
cosine 19.2 % 22.23 %
PLDA 10.45 % 10.35 %
LDA PLDA 9.972 % 10.4 %

Group 3: x-vector

Equel Error Rate MFCC x-vector wav2vec c x-vector wav2vec z x-vector
cosine 12.23 % 17.32 % 11.71 %
PLDA 12.04 % 15.53 % 8.926 %
LDA PLDA 11.48 % 11.71 % 8.784 %

T-SNE

avatar

Future Work

  1. Dataset: VoxCeleb dataset
  2. Dataset: VAD & Data Arguement
  3. Pretrain: center loss for pretrain
  4. Pretrain: triplet loss for pretrain

Speech Pretrain Papers

  1. [Facebook] wav2vec: Unsupervised Pre-Training for Speech Recognition, 2019
  2. [Google] Towards Learning a Universal Non-Semantic Representation of Speech, 2020
  3. [DeepMind] Representation Learning with Contrastive Predictive Coding, 2019
  4. [MIT] An Unsupervised Autoregressive Model for Speech Representation Learning, 2019
  5. [Amazon] Deep Contextualized Acoustic Representations for Semi-Supervised Speech Recognition, 2020
  6. [NTU] MOCKINGJAY: Unsupervised Speech Representation Learning with Deep Bidirectional Transformer Encoders, 2020
  1. [Yoshua Bengio] Learning Speaker Representations with Mutual Information, 2018
  2. [Google] Towards Learning a Universal Non-Semantic Representation of Speech, 2020
  3. [MIT] An Unsupervised Autoregressive Model for Speech Representation Learning, 2019
  1. [FaceBook] fairseq
  2. [Amazon] speech-representations
  3. [NTU] MOCKINGJAY
  4. [Google] non semantic speech benchmark

Reference

  1. ankeshanand Contrative SSL blog
  2. Interspeech2020 Special Session: New Trends in self-supervised speech processing
  3. ICML2020: Self-supervision in Audio and Speech