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.
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
A self-supervised speech model that predicts hidden units in the style of HuBERT, and adds prediction under noise or overlapping speech and a gated relative position bias, to improve non-speech tasks as well.
Mathematical Idea
During training, segments are created by mixing other speech or noise over the original segment, and the model is asked to predict the units of the original segment. This forces it to separate the target speech. Attention uses a gated relative position bias that depends on the content. The representations generalize to tasks such as speaker and separation.
How It Works
Original segment and hidden units from clustering
Mix speech or noise into part of the segment
Mask time positions
Transformer with attention that has a gated position bias
Predict the units of the original segment
Fine-tuning for downstream tasks
Stages Diagram
Waveform + mixing
Convolutional encoder
Masking
Transformer with gated bias
Unit prediction
Equations
$$\tilde{x}=\mathrm{mix}(x,x_{noise})$$
Mixed segment; the target is the units extracted from $x$.
Representations suited to multiple tasks (speech/speaker/separation)
More robust to overlap and noise
Relies on unlabeled data
Limitations
Expensive pre-training
Higher complexity than HuBERT
Results vary by task
Use Cases
Speaker embeddings and diarization
Speech recognition
Non-speech tasks
Applied Example
In the mixed segment, the prediction target matches the units extracted from the original speech, not from the added speech.
Code Example
PythonIllustrative, not implemented in testing
import torch
from transformers import AutoFeatureExtractor, WavLMModel
name = "microsoft/wavlm-base"
fe = AutoFeatureExtractor.from_pretrained(name)
model = WavLMModel.from_pretrained(name).eval()
wave = torch.randn(16000).numpy() # replace with a real 16 kHz recording
inp = fe(wave, sampling_rate=16000, return_tensors="pt")
with torch.no_grad():
out = model(**inp, output_hidden_states=True)
# time average of an intermediate layer as a discriminative vector for the segment
emb = out.hidden_states[6].mean(dim=1)
print(emb.shape)
Assistant Professor of Artificial Intelligence and Deep Learning
University of Al-Qadisiyah
About
Researcher and academic specialising in artificial intelligence (AI), deep learning, computer vision and natural language processing (NLP). The “Deep Learning in Arabic” project aims to enrich Arabic scientific and technical content with sound, free references and software for researchers and learners across the Arab world.
Smart Audio Assistant
I am the lab's Audio Assistant. Ask me about an algorithm, model, dataset, or experiment, and I will answer from the lab's content with links.
Smart Audio Assistant
Local mode: the lab's database
It answers from the lab's database only, without sending your question to any external party. Conversations and audio are not saved.
Smart assistant
Answers from the site’s content
The assistant can make mistakes, so check the attached sources.
Welcome! I am Dr. Alaa Taima, and this is my smart assistant on “Deep Learning in Arabic”. Ask it about any term or topic in artificial intelligence, and it will answer from the site's content with links to the sources.
DL Bot
Your smart assistant · Connecting…
Enter to send · Shift + Enter for a new line · The assistant can make mistakes, so check the sources.