🚀 Speaker Verification with xvector embeddings on Voxceleb
This repository offers all the essential tools to extract speaker embeddings using a pretrained TDNN model with SpeechBrain. The system is trained on Voxceleb 1 and Voxceleb2 training data, aiming to provide effective solutions for speaker verification tasks.
For a better experience, we highly recommend exploring SpeechBrain. The performance of the provided model on the Voxceleb1 - test set (Cleaned) is as follows:
Release |
EER(%) |
05 - 03 - 21 |
3.2 |
🚀 Quick Start
This repository provides all the necessary tools to extract speaker embeddings with a pretrained TDNN model using SpeechBrain. The system is trained on Voxceleb 1+ Voxceleb2 training data.
✨ Features
- Accurate Performance: Achieves an EER of 3.2% on the Voxceleb1 - test set (Cleaned).
- Pretrained Model: Utilizes a TDNN model trained on Voxceleb 1+2 training data.
- Easy - to - use Interface: Allows users to compute speaker embeddings with simple code.
📦 Installation
Install SpeechBrain
First, install SpeechBrain using the following command:
pip install speechbrain
Please note that we encourage you to read our tutorials and learn more about SpeechBrain.
💻 Usage Examples
Compute your speaker embeddings
import torchaudio
from speechbrain.inference.speaker import EncoderClassifier
classifier = EncoderClassifier.from_hparams(source="speechbrain/spkrec-xvect-voxceleb", savedir="pretrained_models/spkrec-xvect-voxceleb")
signal, fs = torchaudio.load('tests/samples/ASR/spk1_snt1.wav')
embeddings = classifier.encode_batch(signal)
The system is trained with recordings sampled at 16kHz (single channel). The code will automatically normalize your audio (i.e., resampling + mono channel selection) when calling classify_file if needed. Make sure your input tensor is compliant with the expected sampling rate if you use encode_batch and classify_batch.
Inference on GPU
To perform inference on the GPU, add run_opts={"device":"cuda"}
when calling the from_hparams
method.
📚 Documentation
Pipeline description
This system is composed of a TDNN model coupled with statistical pooling. The system is trained with Categorical Cross - Entropy Loss.
Training
The model was trained with SpeechBrain (aa018540). To train it from scratch, follow these steps:
- Clone SpeechBrain:
git clone https://github.com/speechbrain/speechbrain/
- Install it:
cd speechbrain
pip install -r requirements.txt
pip install -e .
- Run Training:
cd recipes/VoxCeleb/SpeakerRec/
python train_speaker_embeddings.py hparams/train_x_vectors.yaml --data_folder=your_data_folder
You can find our training results (models, logs, etc) here.
Limitations
The SpeechBrain team does not provide any warranty on the performance achieved by this model when used on other datasets.
Referencing xvectors
author = {David Snyder and
Daniel Garcia{-}Romero and
Alan McCree and
Gregory Sell and
Daniel Povey and
Sanjeev Khudanpur},
title = {Spoken Language Recognition using X - vectors},
booktitle = {Odyssey 2018},
pages = {105--111},
year = {2018},
}
📄 License
This project is licensed under the "apache - 2.0" license.
Citing SpeechBrain
Please cite SpeechBrain if you use it for your research or business.
@misc{speechbrain,
title={{SpeechBrain}: A General - Purpose Speech Toolkit},
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},
year={2021},
eprint={2106.04624},
archivePrefix={arXiv},
primaryClass={eess.AS},
note={arXiv:2106.04624}
}