LibriSpeech is a speech recognition corpus of about 1,000 hours of read English speech with accurate transcripts. Panayotov et al. at Johns Hopkins University created it and presented it at ICASSP 2015. All audio is 16 kHz, and it is distributed for free under CC BY 4.0.
It is built from LibriVox audiobooks, in which volunteers read and publish public-domain books, and their texts from Project Gutenberg. Since the reading and the text already correspond, automatically aligning which part of the audio reads which part of the text yields a large amount of training data without anyone transcribing from scratch.
Until then, freely available English read-speech corpora were small, and speech recognition research often used the paid WSJ corpus (read Wall Street Journal articles; its si-284 training set is 82 hours). The paper shows that acoustic models trained on LibriSpeech achieve a lower word error rate (WER) even on the WSJ test sets than models trained on WSJ itself.
The split names "clean" and "other" are based not on the presence of noise but on how easy the speakers are to recognize. Speakers with low WER when transcribed by a WSJ-trained model are "clean", and those with high WER are "other".
Contents: construction, splits, and format
Construction automatically aligns the readings with the texts and discards segments that disagree.
Normalize the text. For each book, the text is uppercased, punctuation is removed, and common abbreviations, numbers, and the like are expanded into words.
First-pass alignment. The audio is recognized with a small language model built from that book's text, and matching regions between the recognition result and the text are found (Smith-Waterman algorithm). The audio is cut into pieces of 35 seconds or less at silences of 0.5 seconds or longer inside regions that reliably match the text.
Second-pass alignment discards segments that disagree with the text. The audio is re-recognized with a graph that allows "any phone sequence" between the words of the text, and any segment that deviates even slightly from the text, such as skipped words, restarts, or misreadings, is discarded. About 1,200 hours of audio remained at this stage.
Cut into short utterances. Training data is cut at silences longer than 0.3 seconds, while development and test data are cut only at silences that coincide with sentence boundaries in the text.
The second pass sometimes discards segments that are actually correct. The paper argues that the source audiobooks are plentiful enough that some loss is acceptable.
Splits are made per speaker. Works read by multiple people (such as radio-drama-style readings) are excluded so that each recording has a single speaker, and no speaker appears in both training and evaluation sets.
Split
Hours
Per speaker
Female
Male
Speakers
dev-clean
5.4 h
8 min
20
20
40
test-clean
5.4 h
8 min
20
20
40
dev-other
5.3 h
10 min
16
17
33
test-other
5.1 h
10 min
17
16
33
train-clean-100
100.6 h
25 min
125
126
251
train-clean-360
363.6 h
25 min
439
482
921
train-other-500
496.7 h
30 min
564
602
1,166
The clean development and test sets randomly select 20 female and 20 male speakers from the clean speakers. The other development and test sets are not random: speakers sorted by WER from easiest are divided into quarters, and they are chosen from the third quarter, making the data intentionally hard. The training sets cap the time per speaker (25 minutes for clean) to avoid bias toward particular speakers. The gender ratio is balanced in both number of speakers and hours.
Format: one FLAC file per utterance is placed in a folder per speaker ID and chapter ID, and a per-chapter speaker-chapter.trans.txt lists "utterance ID and transcript" one per line. Transcripts are uppercase without punctuation.
Language-model resources are also distributed separately (OpenSLR SLR11): text from about 14,500 Project Gutenberg books (about 803 million tokens), a vocabulary of the 200,000 most frequent words with a pronunciation dictionary, and pretrained 3-gram and 4-gram language models. Books used for the development and test sets, and books similar to them (those with similar titles or sharing more than 1% of the same 5-grams), are removed from this text.
Evaluation rules
Evaluation reports WER measured on both test-clean and test-other side by side. WER is the number of substitutions S, deletions D, and insertions I of words needed to turn the recognition result into the reference transcript, divided by the number of reference words N.
WER=NS+D+I
Lower is better, and looking at both clean and other shows performance on easy and hard speakers respectively. Hyperparameters and language model weights are tuned on dev-clean and dev-other, and the test sets are used only for the final report.
Transcripts are uppercase without punctuation. Models that output punctuation or lowercase must be normalized to the same form before counting WER. Different normalization changes the value, so when comparing papers, align the conditions, including whether a language model is used.
In the paper's tables, WER changes greatly depending on whether an external language model is used. For a DNN acoustic model trained on 960 hours, rescoring the first-pass result of a pruned 3-gram with the full 4-gram lowered test-clean from 8.02% to 5.51% and test-other from 19.41% to 13.97%. For this reason, results are commonly reported separately for "no language model" and "with language model".
Usage and historical significance
LibriSpeech became the standard English speech recognition benchmark that anyone can use for free and compare under the same conditions. Training on all 960 hours or only on train-clean-100 and listing WER on test-clean and test-other is the common format for comparisons in papers.
WER on test-clean and test-other has fallen as follows.
wav2vec 2.0 (Large, pretrained on 53k hours of untranscribed audio)
Transformer LM
1.8
3.3
Values in %.
The value of LibriSpeech lies not only in its size but also in having the original audio and texts available. Using the original LibriVox audio, untranscribed audio can be scaled up by orders of magnitude, so LibriSpeech also became the foundation for self-supervised learning research. wav2vec 2.0 is pretrained on either the 960 hours of LibriSpeech audio (LS-960) or about 53,000 hours collected from LibriVox (LV-60k), then fine-tuned on small training sets of 10 minutes, 1 hour, and 10 hours cut from LibriSpeech (the Libri-light splits) to compare how well recognition works with few transcripts.
Beyond speech recognition, LibriSpeech audio is used in research on learning speaker characteristics and phoneme representations. For example, the CPC paper, which proposed InfoNCE, learns representations from LibriSpeech audio and evaluates them by phoneme classification.
Caveats
License: the corpus is CC BY 4.0. Commercial use is allowed, but attribution is required. The language-model text and resources (SLR11) are in the public domain.
CC BY 4.0 is a license whose condition is "attribution". When publishing a model trained on LibriSpeech or a demo that uses part of the audio, cite LibriSpeech (Panayotov et al. 2015) as the source.
Read speech only: since it consists of audiobook readings, pronunciation is clear and there are almost no restarts or backchannels. On conversational, meeting, or telephone speech, WER will not match the LibriSpeech numbers.
Inconsistent audio quality: the source audio is MP3-compressed, and although LibriVox's submission guidelines recommend noise removal and volume adjustment, some recordings do not follow them. Audio with and without noise reduction is mixed.
Training and evaluation data are segmented differently: training data is cut at silences, while development and test data are cut at sentence boundaries. Evaluation utterances are complete sentences, so language models work well on them.
Fitting to the test sets: because many studies have competed on the same test-clean and test-other for years, small WER differences may include fitting to the test data. When comparing small differences, also check results over multiple random seeds and on other data.
Comparison with similar datasets
Representative English and Japanese speech datasets compared along the same dimensions:
Text under CC BY-SA 4.0 etc.; audio for research, non-commercial, and personal use (commercial use upon consultation)
Rough guidelines for choosing:
To compare English speech recognition under the same conditions as other papers, use LibriSpeech.
When you need languages other than English, or diversity in speakers and recording conditions, use Common Voice.
To build English speech synthesis with a single voice, use LJ Speech. For multi-speaker synthesis, LibriTTS, a rebuild of LibriSpeech for speech synthesis, is a candidate.
For Japanese speech synthesis, use JSUT; for Japanese speech recognition, use Japanese corpora such as ReazonSpeech.
PyTorch example
▶Show code
python
import glob
import os
import soundfile as sf # reads FLAC
import torch
import torchaudio
from torch.utils.data import DataLoader, Dataset
"""
Load one LibriSpeech split (e.g. test-clean) as pairs of log-mel spectrograms and transcripts
Layout: LibriSpeech/<split>/<speaker ID>/<chapter ID>/<speaker>-<chapter>-<index>.flac and <speaker>-<chapter>.trans.txt
"""
class LibriSpeech(Dataset):
def __init__(self, root, split='test-clean'):
self.items = [] # (flac path, transcript, speaker ID)
for trans in sorted(glob.glob(os.path.join(root, split, '*', '*', '*.trans.txt'))):
folder = os.path.dirname(trans)
with open(trans, encoding='utf-8') as f:
for line in f:
utt_id, text = line.rstrip('\n').split(' ', 1) # one line = "utterance ID transcript"
speaker = int(utt_id.split('-')[0])
self.items.append((os.path.join(folder, utt_id + '.flac'), text, speaker))
# 80-dim mel spectrogram of 16 kHz audio with 25 ms windows and 10 ms hop
self.mel = torchaudio.transforms.MelSpectrogram(sample_rate=16000, n_fft=400, hop_length=160, n_mels=80)
def __len__(self):
return len(self.items)
def __getitem__(self, i):
path, text, speaker = self.items[i]
wav, sr = sf.read(path, dtype='float32') # all 16 kHz, mono
assert sr == 16000
feats = torch.log(self.mel(torch.from_numpy(wav)) + 1e-6).t() # [frames, 80]
return feats, text, speaker
def collate(batch):
# Zero-pad utterances of different lengths and also return the original lengths (used by CTC loss, etc.)
feats, texts, speakers = zip(*batch)
lengths = torch.tensor([f.size(0) for f in feats])
padded = torch.nn.utils.rnn.pad_sequence(feats, batch_first=True)
return padded, lengths, list(texts)
def word_errors(ref, hyp):
# Edit distance between reference and hypothesis word sequences (total substitutions, deletions, insertions)
r, h = ref.split(), hyp.split()
d = list(range(len(h) + 1))
for i in range(1, len(r) + 1):
prev, d[0] = d[0], i
for j in range(1, len(h) + 1):
cur = min(d[j] + 1, d[j - 1] + 1, prev + (r[i - 1] != h[j - 1]))
prev, d[j] = d[j], cur
return d[len(h)], len(r)
def normalize(text):
# Transcripts are uppercase without punctuation. Convert model output to the same form before comparing
keep = "ABCDEFGHIJKLMNOPQRSTUVWXYZ' "
return ''.join(c for c in text.upper() if c in keep)
def evaluate(model, decode, root, split='test-clean'):
# WER = total errors over all utterances / total reference words over all utterances (not the mean of per-utterance WER)
loader = DataLoader(LibriSpeech(root, split), batch_size=16, collate_fn=collate)
model.eval() # disable Dropout, etc.
errors, words = 0, 0
with torch.no_grad():
for feats, lengths, texts in loader:
hyps = decode(model(feats, lengths), lengths) # decode returns a list of strings (e.g. CTC greedy decoding)
for ref, hyp in zip(texts, hyps):
e, n = word_errors(ref, normalize(hyp))
errors += e
words += n
return 100.0 * errors / words
# Tune on dev-clean and dev-other, then report WER on both test-clean and test-other at the end
# print(evaluate(model, decode, 'LibriSpeech', 'test-clean'), evaluate(model, decode, 'LibriSpeech', 'test-other'))
FAQ
Q. Is train-other-500 noisy audio?
A.
It was not split by noise. "other" groups speakers with high WER when transcribed by a WSJ-trained model, that is, speakers who are harder to recognize because of accents or recording quality. Training on all 960 hours lowers test-other WER substantially compared with the 460 clean hours alone (from 19.12% to 13.97% for the paper's DNN).
Q. Can results trained only on the 100-hour train-clean-100 be compared with results trained on 960 hours?
A.
No. The amount of training data differs, so compare results trained on the same amount. Papers customarily state the amount of training data, such as "100 hours" or "960 hours", and use the Libri-light 10-minute, 1-hour, and 10-hour splits when trying even smaller amounts.
Q. May I use other English text to train the language model?
A.
Yes, but make sure text from the test-set books does not leak in. The distributed language-model text (SLR11) has the development and test books, and books similar to them, removed. When using text you collected yourself, remove overlaps in the same way and state the text you used in your paper.