facebook/wav2vec2-base (95 M parameters) fine-tuned with a character-level CTC head for English speech
recognition, from a study of noise-robust ASR with word-level error flagging (Group 9, DS & AI Lab project,
Nov 2026). Clean-training baseline of Milestone 4 — not noise-robust; published for comparison.
import torch, soundfile as sf
from transformers import Wav2Vec2Processor, Wav2Vec2ForCTC
repo = "kumargulshan/wav2vec2-base-ls100-clean"
processor = Wav2Vec2Processor.from_pretrained(repo)
model = Wav2Vec2ForCTC.from_pretrained(repo).eval()
audio, sr = sf.read("speech.wav") # mono, 16 kHz (resample first if needed)
inputs = processor(audio, sampling_rate=16000, return_tensors="pt")
with torch.no_grad():
ids = model(inputs.input_values).logits.argmax(-1)
print(processor.batch_decode(ids)[0]) # upper-case letters, apostrophe, spaces
Output vocabulary: the same 32 symbols as facebook/wav2vec2-base-960h (A–Z, apostrophe, | word delimiter).
For the best accuracy, decode the logits with a 4-gram LibriSpeech KenLM via pyctcdecode
(we used alpha 0.8, beta 2.0, beam 50).
| Training | from facebook/wav2vec2-base, LibriSpeech train-clean-100 (100.6 h), 36k steps (≈ 59.5 epochs), peak lr 5e-5, 8 % warm-up, linear decay, seed 42 |
| Augmentation | none (clean speech only) |
| Regularisation | SpecAugment-style masking (time p 0.4 / span 10, feature p 0.1 / span 64), LayerDrop 0.1, frozen CNN feature encoder |
| Optimiser | AdamW (β 0.9/0.98, weight decay 0.005), gradient clipping 1.0, bf16, duration-bucketed batches of ≤ 640 s of audio |
| Selection | checkpoint with the lowest mean dev WER (dev-clean + dev-other, clean and noisy): step 34000, dev WER 22.08 % |
| Hardware | 1 × NVIDIA L40S |
LibriSpeech test-clean + test-other (5,559 utterances) under 17 conditions: clean, and white / pink / brown noise and ESC-50 environmental sounds at 0, 5, 10, 15, 20 dB SNR (94,503 utterance-conditions, 182.7 h). Brown noise and ESC-50 were never used in training. Noise was mixed with fixed seeds per utterance, so all models see identical audio.
| WER (%) | greedy | + 4-gram LM |
|---|---|---|
| test-clean | 5.85 | 3.69 |
| test-other | 13.03 | 9.04 |
| all noisy conditions, pooled | – | 25.22 |
| white noise, 0–5 dB | 71.53 | 66.15 |
| pink noise, 0–5 dB | 56.05 | 50.18 |
| brown noise, 0–5 dB (unseen type) | 10.26 | 6.94 |
| ESC-50 sounds, 0–5 dB (unseen type) | 38.29 | 32.58 |
| Model | Description |
|---|---|
| B960_rev | best single model: 960 h, noise + reverb + speed + telephone augmentation |
| B960_rev_s2 | same as B960_rev, seed 7 (ensemble member) |
| B460 | 464 h + noise augmentation |
| B_noisy | Model B: 100 h + noise augmentation |
| B2_lr1e-4 | 100 h + noise augmentation, lr 1e-4 |
Apache-2.0, as the base model facebook/wav2vec2-base. Training data: LibriSpeech (CC BY 4.0) and MUSAN.
facebook/wav2vec2-base