语言: "英语"
缩略图:
标签:
- 源分离
- 语音分离
- 音频源分离
- Libri2Mix数据集
- SepFormer模型
- Transformer架构
- 音频到音频转换
- 音频源分离技术
- SpeechBrain框架
许可证: "Apache-2.0"
数据集:
- Libri2Mix
评估指标:
- SI-SNRi(信噪比改善)
- SDRi(信号失真比改善)
基于Libri2Mix训练的SepFormer模型
本资源库提供使用SepFormer模型进行音频源分离的全套工具,该模型通过SpeechBrain实现,并在Libri2Mix数据集上进行了预训练。建议访问SpeechBrain官网以获得更佳体验。该模型在Libri2Mix测试集上的性能达到20.6分贝。
发布日期 |
测试集SI-SNRi |
测试集SDRi |
2022-09-16 |
20.6分贝 |
20.9分贝 |
您可以通过此链接收听在WSJ0-2/3Mix测试集上获得的示例结果。
安装SpeechBrain
首先,请通过以下命令安装SpeechBrain:
pip install speechbrain
建议您阅读我们的教程以深入了解SpeechBrain框架。
对自定义音频文件进行源分离
from speechbrain.pretrained import SepformerSeparation as separator
import torchaudio
model = separator.from_hparams(source="speechbrain/sepformer-libri2mix", savedir='pretrained_models/sepformer-libri2mix')
est_sources = model.separate_file(path='speechbrain/sepformer-wsj02mix/test_mixture.wav')
torchaudio.save("分离信号1.wav", est_sources[:, :, 0].detach().cpu(), 8000)
torchaudio.save("分离信号2.wav", est_sources[:, :, 1].detach().cpu(), 8000)
系统要求输入为8kHz采样的单声道音频。若您的音频采样率不同,请先使用torchaudio或sox等工具进行重采样。
GPU加速推理
如需使用GPU加速,在调用from_hparams
方法时添加run_opts={"device":"cuda"}
参数。
训练流程
该模型基于SpeechBrain框架(fc2eabb7版本)训练。从头训练步骤如下:
- 克隆代码库:
git clone https://github.com/speechbrain/speechbrain/
- 安装依赖:
cd speechbrain
pip install -r requirements.txt
pip install -e .
- 启动训练:
cd recipes/Libri2Mix/separation
python train.py hparams/sepformer.yaml --data_folder=您的数据目录
训练结果(模型、日志等)可在Google Drive查看。
使用限制
SpeechBrain团队不对该模型在其他数据集上的表现提供任何保证。
引用SpeechBrain
@misc{speechbrain,
title={{SpeechBrain}: 通用语音工具包},
author={Mirco Ravanelli等},
year={2021},
eprint={2106.04624},
archivePrefix={arXiv},
primaryClass={eess.AS}
}
引用SepFormer
@inproceedings{subakan2021attention,
title={语音分离中的注意力机制研究},
author={Cem Subakan等},
year={2021},
booktitle={ICASSP 2021}
}
@article{subakan2023exploring,
author={Subakan, Cem等},
journal={IEEE/ACM音频、语音与语言处理汇刊},
title={自注意力机制在语音分离中的探索},
year={2023},
volume={31},
pages={2169-2180}
}
关于SpeechBrain
- 官网: https://speechbrain.github.io/
- 代码库: https://github.com/speechbrain/speechbrain/
- HuggingFace: https://huggingface.co/speechbrain/