3D-Speaker Res2Net 说话人识别模型
Res2Net模型是基于卷积神经网络构建的说话人模型,由于识别性能优异,已经被广泛使用在说话人识别领域中,还可用于说话人日志和语种识别等任务。
更详细的信息见
- Res2Net论文:Res2Net: A New Multi-scale Backbone Architecture
- 3D-Speaker论文:3D-Speaker: A Large-Scale Multi-Device, Multi-Distance, and Multi-Dialect Corpus for Speech Representation Disentanglement
- github项目地址:3D-Speaker
训练数据
本模型使用达摩院开源数据集3D-Speaker数据集进行训练,包含约10k个说话人,可以对16k采样率的中文音频进行识别。
模型效果评估
在3D-Speaker中文测试集:Cross Device, Cross-Distance, Cross-Dialect中EER评测结果如下:
Model | Params | Cross-Device | Cross-Distance | Cross-Dialect |
---|---|---|---|---|
ECAPA-TDNN | 20.8 M | 8.87% | 12.26% | 14.53% |
Res2Net | 4.03 M | 8.03% | 9.67% | 14.11% |
在线体验
在页面右侧,可以在“在线体验”栏内看到我们预先准备好的示例音频,点击播放按钮可以试听,点击“执行测试”按钮,会在下方“测试结果”栏中显示相似度得分(范围为[-1,1])和是否判断为同一个人。如果您想要测试自己的音频,可点“更换音频”按钮,选择上传或录制一段音频,完成后点击执行测试,识别内容将会在测试结果栏中显示。
在Notebook中体验
from modelscope.pipelines import pipeline
sv_pipline = pipeline(
task='speaker-verification',
model='iic/speech_res2net_sv_zh-cn_3dspeaker_16k',
model_revision='v1.0.0'
)
speaker1_a_wav = 'https://modelscope.cn/api/v1/models/damo/speech_campplus_sv_zh-cn_16k-common/repo?Revision=master&FilePath=examples/speaker1_a_cn_16k.wav'
speaker1_b_wav = 'https://modelscope.cn/api/v1/models/damo/speech_campplus_sv_zh-cn_16k-common/repo?Revision=master&FilePath=examples/speaker1_b_cn_16k.wav'
speaker2_a_wav = 'https://modelscope.cn/api/v1/models/damo/speech_campplus_sv_zh-cn_16k-common/repo?Revision=master&FilePath=examples/speaker2_a_cn_16k.wav'
# 相同说话人语音
result = sv_pipline([speaker1_a_wav, speaker1_b_wav])
print(result)
# 不同说话人语音
result = sv_pipline([speaker1_a_wav, speaker2_a_wav])
print(result)
# 可以自定义得分阈值来进行识别
result = sv_pipline([speaker1_a_wav, speaker2_a_wav], thr=0.249)
print(result)
训练和测试自己的Res2Net模型
本项目已在3D-Speaker开源了训练、测试和推理代码,使用者可按下面方式下载安装使用:
git clone https://github.com/alibaba-damo-academy/3D-Speaker.git && cd 3D-Speaker
conda create -n 3D-Speaker python=3.8
conda activate 3D-Speaker
pip install -r requirements.txt
运行Res2Net在VoxCeleb集上的训练脚本
cd egs/3dspeaker/sv-res2net
# 需要在run.sh中提前配置训练使用的GPU信息,默认是4卡
bash run.sh
使用本预训练模型快速提取embedding
pip install modelscope
cd 3D-Speaker
# 配置模型名称并指定wav路径,wav路径可以是单个wav,也可以包含多条wav路径的list文件
model_id=iic/speech_res2net_sv_zh-cn_3dspeaker_16k
# 提取embedding
python speakerlab/bin/infer_sv.py --model_id $model_id --wavs $wav_path
相关论文以及引用信息
如果你觉得这个该模型有所帮助,请引用下面的相关的论文
@article{zheng20233d,
title={3D-Speaker: A Large-Scale Multi-Device, Multi-Distance, and Multi-Dialect Corpus for Speech Representation Disentanglement},
author={Zheng, Siqi and Cheng, Luyao and Chen, Yafeng and Wang, Hui and Chen, Qian},
journal={arXiv preprint arXiv:2306.15354},
year={2023}
}
评论