模型简介
模型特点
模型能力
使用案例
🚀 使用ECAPA - TDNN嵌入在CommonAccent上进行语音录音口音识别
本项目借助 SpeechBrain 实现语音录音中的口音识别。系统采用在CommonAccent英语数据集(包含16种口音)上预训练的模型,基于CommonLanguage Recipe(详见:https://github.com/speechbrain/speechbrain/tree/develop/recipes/CommonLanguage )构建。该系统能有效识别英语语音中的16种不同口音,为语音识别系统对不同口音的包容性提供了有力支持。
🚀 快速开始
本仓库提供了使用 SpeechBrain 进行语音录音口音识别所需的所有工具。系统使用在CommonAccent英语数据集(16种口音)上预训练的模型,基于位于此处的CommonLanguage Recipe构建:https://github.com/speechbrain/speechbrain/tree/develop/recipes/CommonLanguage 。
提供的系统可以从英语(EN)的短语音记录中识别以下16种口音:
african
australia
bermuda
canada
england
hongkong
indian
ireland
malaysia
newzealand
philippines
scotland
singapore
southatlandtic
us
wales
GitHub仓库链接:https://github.com/JuanPZuluaga/accent-recog-slt2022
为获得更好的体验,建议您进一步了解 SpeechBrain 。该模型在测试集上的性能如下:
发布日期 (dd/mm/yyyy) | 准确率 (%) |
---|---|
01 - 08 - 2023(本模型) | 87 |
01 - 08 - 2023(本模型未使用数据增强训练) | 85 |
01 - 08 - 2023(本模型从头开始训练,无参数迁移) | 82 |
✨ 主要特性
- 先进架构:采用Emphasized Channel Attention, Propagation and Aggregation Time Delay Neural Network (ECAPA - TDNN) 架构,在多种语音任务中表现出色。
- 多模型对比:提出三种模型,包括从头训练的模型、使用数据增强微调的模型和基线模型,通过对比实验得出使用数据增强微调的模型效果最佳。
- 聚类分析:通过t - SNE降维技术探索嵌入的内部分类,发现基于语音相似性存在一定的聚类现象。
📦 安装指南
安装SpeechBrain
首先,请使用以下命令安装SpeechBrain:
pip install speechbrain
建议您阅读相关教程,进一步了解 SpeechBrain 。
💻 使用示例
基础用法
import torchaudio
from speechbrain.pretrained import EncoderClassifier
classifier = EncoderClassifier.from_hparams(source="Jzuluaga/accent-id-commonaccent_ecapa", savedir="pretrained_models/accent-id-commonaccent_ecapa")
# 爱尔兰口音示例
out_prob, score, index, text_lab = classifier.classify_file('Jzuluaga/accent-id-commonaccent_ecapa/data/ireland_1.wav')
print(text_lab)
# 马来西亚口音示例
out_prob, score, index, text_lab = classifier.classify_file('Jzuluaga/accent-id-commonaccent_ecapa/data/malaysia_1.wav')
print(text_lab)
高级用法
在GPU上进行推理
若要在GPU上进行推理,在调用 from_hparams
方法时添加 run_opts={"device":"cuda"}
。
📚 详细文档
摘要
带口音语音的识别在自动语音识别(ASR)系统中仍然是一个主要问题。本项目通过Emphasized Channel Attention, Propagation and Aggregation Time Delay Neural Network (ECAPA - TDNN) 架构来处理带口音英语语音的分类问题,该架构已在多种语音任务中表现良好。提出了三种模型:一种是从头开始训练的模型,另外两种(一种使用数据增强,一种是基线模型)是从speechbrain/spkrec - ecapa - voxceleb (VoxCeleb) 的检查点进行微调的模型。结果表明,使用数据增强进行微调的模型取得了最佳效果。由于口音相似性,大多数误分类是有规律且可预期的,例如美国口音和加拿大口音。还通过t - SNE(一种降维技术)探索了嵌入的内部分类,发现基于语音相似性存在一定的聚类现象。未来,计划在建议的框架中探索该口音分类系统的实现,以提高ASR系统对带口音语音的包容性,从而提升其性能。
管道描述
该系统由一个与统计池化相结合的ECAPA模型组成。在此基础上应用一个使用分类交叉熵损失训练的分类器。
系统使用以16kHz采样(单声道)的录音进行训练。如果需要,调用 classify_file 时代码会自动对音频进行归一化处理(即重采样 + 单声道选择)。如果使用 encode_batch 和 classify_batch ,请确保输入张量符合预期的采样率。
训练
该模型使用SpeechBrain进行训练。若要从头开始训练,请遵循以下步骤:
- 克隆SpeechBrain:
git clone https://github.com/speechbrain/speechbrain/
- 安装:
cd speechbrain
pip install -r requirements.txt
pip install -e .
- 克隆项目仓库:
git clone https://github.com/JuanPZuluaga/accent-recog-slt2022
cd CommonAccent/accent_id
python train.py hparams/train_ecapa_tdnn.yaml
可以在本仓库的 Files and versions
页面找到训练结果(模型、日志等)。
局限性
SpeechBrain团队不对该模型在其他数据集上的性能提供任何保证。
🔧 技术细节
本系统基于ECAPA - TDNN架构,结合统计池化和分类器,使用分类交叉熵损失进行训练。通过在CommonAccent数据集上的预训练,能够对英语语音中的16种口音进行有效识别。在训练过程中,探索了不同的训练策略,包括从头训练和微调,并对比了使用数据增强和不使用数据增强的效果。还通过t - SNE技术对嵌入的内部结构进行了分析,发现了基于语音相似性的聚类现象。
📄 许可证
本项目采用MIT许可证。
引用说明
引用CommonAccent工作
如果您觉得本工作有帮助,请按以下格式引用:
@article{zuluaga2023commonaccent,
title={CommonAccent: Exploring Large Acoustic Pretrained Models for Accent Classification Based on Common Voice},
author={Zuluaga - Gomez, Juan and Ahmed, Sara and Visockas, Danielius and Subakan, Cem},
journal={Interspeech 2023},
url={https://arxiv.org/abs/2305.18283},
year={2023}
}
引用ECAPA - TDNN模型
@inproceedings{DBLP:conf/interspeech/DesplanquesTD20,
author = {Brecht Desplanques and
Jenthe Thienpondt and
Kris Demuynck},
editor = {Helen Meng and
Bo Xu and
Thomas Fang Zheng},
title = {{ECAPA - TDNN:} Emphasized Channel Attention, Propagation and Aggregation
in {TDNN} Based Speaker Verification},
booktitle = {Interspeech 2020},
pages = {3830--3834},
publisher = {{ISCA}},
year = {2020},
}
引用SpeechBrain
如果您在研究或业务中使用了SpeechBrain,请按以下格式引用:
@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}
}









