Speech & Audio AI Lab

Interactive labs for speech recognition, speech synthesis, and audio in general: in-browser DSP experiments, algorithms, datasets, and a learning path, without storing any recording.

43experiments

x-vectors

x-vectors

AdvancedSpeaker Recognition

Educational content in the form of a scientific draft that needs expert review before being adopted as an academic reference. No experimental result that was not actually run is shown here.

Definition

Fixed-length speaker representations extracted from a TDNN network trained to discriminate speakers, and used in verification with a back-end classifier such as PLDA.

Mathematical Idea

TDNN layers operate on frames with temporal context, then a statistics pooling layer aggregates the mean and standard deviation of their outputs over time, producing a fixed-length vector regardless of segment length. The following segment-level layers are trained by speaker classification, and the embedding is taken from one of them.

How It Works

  1. Extract frame-level features such as MFCC
  2. TDNN layers with graded temporal context
  3. Statistics pooling: mean and standard deviation
  4. Segment-level layers and speaker classification
  5. Take the embedding from an intermediate layer
  6. Back-end classifier such as PLDA or cosine similarity

Stages Diagram

  1. MFCC
  2. TDNN layers
  3. Statistics pooling
  4. Segment-level layers
  5. x-vector embedding

Equations

$$\mu=\frac1T\sum_{t=1}^{T}h_t,\quad \sigma=\sqrt{\frac1T\sum_t h_t^{2}-\mu^{2}}$$

Statistics pooling; $h_t$ is the output of frame $t$.

$$s=[\mu;\sigma]\in\mathbb{R}^{2D}$$

The pooling output has a fixed size of $2D$.

Advantages

  • Fixed embedding size regardless of segment length
  • Good performance with large data and augmentation
  • Standard architecture in verification systems

Limitations

  • Sensitive to channel and domain mismatch
  • Requires data from many speakers
  • Usually weaker than ECAPA-TDNN in recent studies

Use Cases

  • Educational speaker verification
  • Speaker Diarization
  • Curating data by speaker

Applied Example

A pooling layer over 16 dimensions always gives 32 values regardless of the number of frames, for example 200 or 57.

Code Example

PythonImplemented and Tested
import numpy as np
rng = np.random.default_rng(0)
T, D = 200, 16
frames = rng.normal(loc=1.0, scale=2.0, size=(T, D))     # TDNN layer outputs on frames
mu = frames.mean(axis=0)
sigma = np.sqrt((frames**2).mean(axis=0) - mu**2)
stats = np.concatenate([mu, sigma])                      # statistics pooling: 2D
print(stats.shape)                                       # (32,)
# variable length (T) does not change the output size
short = frames[:57]
print(np.concatenate([short.mean(0), short.std(0)]).shape)  # (32,)

References

  1. Snyder, Garcia-Romero, Sell, Povey, Khudanpur. X-Vectors: Robust DNN Embeddings for Speaker Recognition. 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP) (2018). DOI
  2. Desplanques et al.. ECAPA-TDNN: Emphasized Channel Attention, Propagation and Aggregation in TDNN Based Speaker Verification. arXiv (2020). DOI
  3. Nagrani et al.. VoxCeleb: a large-scale speaker identification dataset (2017). Source

Audio processing in the experiments takes place inside your browser. Audio, texts, and conversations are not saved on the server. Privacy Policy