SpeechBrain: A General-Purpose Speech Toolkit

Mirco Ravanelli, Titouan Parcollet, Peter Plantinga, Aku Rouhe, Samuele Cornell, Loren Lugosch, Cem Subakan, Nauman Dawalatabad, Abdelwahab Heba, Jianyuan Zhong, Ju-Chieh Chou, Sung-Lin Yeh, Szu-Wei Fu, Chien-Feng Liao, Elena Rastorgueva, François Grondin, William Aris, Hwidong Na, Yan Gao, Renato De Mori, Yoshua BengioarXiv 2021

Introduction

SpeechBrain is an all-in-one, open-source PyTorch toolkit designed to unify the fragmented landscape of speech processing. Historically, the speech processing community has relied on a patchwork of specialized toolkits—such as Kaldi for recognition, Asteroid for separation, and pyannote for diarization. This fragmentation creates significant friction, as each library maintains its own coding style, data formats, and dependencies. SpeechBrain aims to lower this barrier by providing a single, Pythonic ecosystem that is easy to use for beginners but powerful enough for state-of-the-art research.

The SpeechBrain Framework

SpeechBrain is built on a "library-meets-framework" philosophy, providing modular building blocks while managing the complex lifecycle of training and evaluation.

The SpeechBrain training architecture and Brain class logic.

Key technical innovations include:

  • HyperPyYAML: An extension of YAML that allows users to define hyperparameters and instantiate Python objects directly within the configuration file, making experiment setups declarative and readable.
  • The Brain Class: This central class handles device management, training loops, checkpointing, and learning rate scheduling. Users override specific methods like compute_forward and compute_objectives to define custom logic.
  • Dynamic Data Pipelines: The DynamicItemDataset handles variable-length sequences and on-the-fly transformations, processing raw waveforms in real-time to enable easy data augmentation.
  • Lobes: High-level, pre-defined modules for popular architectures (e.g., Transformers, X-vectors) that can be plugged into different pipelines.

Supported Tasks and Benchmarks

The toolkit's versatility is demonstrated across a massive array of standard benchmarks, covering speech recognition, speaker identification, enhancement, and more.

Overview of tasks, techniques, and datasets supported by SpeechBrain.

SpeechBrain provides recipes for a wide range of tasks:

  • Speech Recognition: TIMIT, LibriSpeech, Common Voice, and AISHELL-1.
  • Speaker Recognition/Diarization: VoxCeleb 1 & 2, and the AMI meeting corpus.
  • Speech Enhancement/Separation: VoiceBank-DEMAND, WSJ0-mix, and LibriMix.
  • Spoken Language Understanding (SLU): SLURP, FSC, and "Timers and Such."

Key Insights

  • Inversion of Control: The Brain class enforces a consistent structure across different speech tasks, making it trivial to switch between projects without learning a new API.
  • Waveform-to-Output: Focus on on-the-fly feature extraction allows researchers to experiment with the entire pipeline within a single differentiable graph.
  • Transparency and Replicability: Full experiment folders, including logs and pre-trained models, are shared via Hugging Face to ensure exact replication.

Performance Results

SpeechBrain delivers top-tier performance across multiple domains:

  • TIMIT: Achieved a Phoneme Error Rate (PER) of 8.04% using wav2vec 2.0.
  • LibriSpeech: Reached a Word Error Rate (WER) of 2.46% on the "test-clean" set.
  • Speaker Recognition: Achieved an Equal Error Rate (EER) of 0.69% on VoxCeleb.
  • Speech Separation: The "SepFormer" implementation achieved an SI-SNRi of 22.3 dB on WSJ0-2mix.
  • SLU: Reached an SLU-F1 score of 74.62 on the SLURP dataset.

Limitations and Future Directions

While comprehensive, the authors acknowledge several areas for growth. Initial releases did not support Text-to-Speech (TTS), and the toolkit currently lacks integrated support for Finite State Transducers (FSTs) for efficient decoding. Future work will also focus on optimizing for low-latency real-time applications and expanding language coverage beyond the current multilingual ASR recipes.

Summary updated

BibTeX
@misc{ravanelli2021speechbrain,
  author = {Mirco Ravanelli and Titouan Parcollet and Peter Plantinga and Aku Rouhe and Samuele Cornell and Loren Lugosch and Cem Subakan and Nauman Dawalatabad and Abdelwahab Heba and Jianyuan Zhong and Ju-Chieh Chou and Sung-Lin Yeh and Szu-Wei Fu and Chien-Feng Liao and Elena Rastorgueva and François Grondin and William Aris and Hwidong Na and Yan Gao and Renato De Mori and Yoshua Bengio},
  title = {{SpeechBrain: A General-Purpose Speech Toolkit}},
  year = {2021},
  eprint = {2106.04624},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2106.04624},
}
Figure