---
title: speech_campplus_five_lre_8k
canonical_url: "https://www.modelscope.cn/models/iic/speech_campplus_five_lre_8k"
md_url: "https://www.modelscope.cn/models/iic/speech_campplus_five_lre_8k.md"
repository: iic/speech_campplus_five_lre_8k
chinese_name: "CAM++语种识别-中英粤日韩识别-8k"
last_updated: 2023-12-18
license: "Apache License 2.0"
pipeline_tag: speech-language-recognition
tasks:
  - speech-language-recognition
model_type:
  - CAM++
library_name:
  - pytorch
frameworks:
  - pytorch
language:
  - cn
domain:
  - audio
downloads: 9018
stars: 5
tags:
  - "speech language recognition"
  - CAM++
  - "中英文语种识别"
---

# speech_campplus_five_lre_8k

> speech_campplus_five_lre_8k - iic 在 ModelScope 开源的模型。基于cam++的语种识别模型，支持中英粤日韩8k语种识别，输入音频，输出相应的语种标签。可用于多语种的ASR、TTS等多种任务。

iic/speech_campplus_five_lre_8k 是 ModelScope 魔搭社区上的speech-language-recognition模型，采用 Apache License 2.0 许可。

- **Repository**: iic/speech_campplus_five_lre_8k
- **License**: Apache License 2.0
- **Tasks**: speech-language-recognition
- **Tags**: speech language recognition, CAM++, 中英文语种识别
- **Downloads**: 9018
- **Stars**: 5
- **Last updated**: 2023-12-18

Source: https://www.modelscope.cn/models/iic/speech_campplus_five_lre_8k

---

# CAM++识别模型
CAM++模型是基于密集连接时延神经网络的识别模型。相比于一些主流模型，比如ResNet34和ECAPA-TDNN，CAM++具有更准确的识别性能和更快的推理速度。该模型可以用于语种识别、说话人确认等多项任务。
## 模型简述
CAM++模型结构如下图所示，整个模型包含两部分，残差卷积网络作为前端，时延神经网络结构作为主干。前端模块是2维卷积结构，用于提取更加局部和精细的时频特征。主干模块采用密集型连接，复用层级特征，提高计算效率。同时每一层中嵌入了一个轻量级的上下文相关的掩蔽(Context-aware Mask)模块，该模块通过多粒度的pooling操作提取不同尺度的上下文信息，生成的mask可以去除掉特征中的无关噪声，并保留关键的信息。

<div align=center>
<img src="images/structure.png" width="400" />
</div>

更详细的信息见
- 论文：[CAM++: A Fast and Efficient Network for Speaker Verification Using Context-Aware Masking](https://arxiv.org/abs/2303.00332)
- github项目地址：[3D-Speaker](https://github.com/alibaba-damo-academy/3D-Speaker)

## 模型效果评估
在集外10s长的各语种识别准确率95%。


# 如何快速体验模型效果
## 在Notebook中体验
对于有开发需求的使用者，特别推荐您使用Notebook进行离线处理。先登录ModelScope账号，点击模型页面右上角的“在Notebook中打开”按钮出现对话框，首次使用会提示您关联阿里云账号，按提示操作即可。关联账号后可进入选择启动实例界面，选择计算资源，建立实例，待实例创建完成后进入开发环境，输入api调用实例。
``` python
from modelscope.pipelines import pipeline
lre_pipeline = pipeline(
    task='speech-language-recognition',
    model='damo/speech_campplus_five_lre_8k',
    model_revision='v1.0.1'
)
example_wav = 'https://modelscope.cn/api/v1/models/damo/speech_campplus_five_lre_8k/repo?Revision=master&FilePath=examples/example_lre_mand_8k.wav'
# 识别语种
result = lre_pipeline(example_wav)
print(result)
```
## 训练和测试自己的CAM++语种模型
本项目已在[3D-Speaker](https://github.com/alibaba-damo-academy/3D-Speaker)开源了训练、测试和推理代码，使用者可按下面方式下载安装使用：
``` sh
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
```

运行CAM++语种识别样例
``` sh
cd egs/3dspeaker/lid
# 需要在run.sh中提前配置训练使用的GPU信息，默认是4卡
bash run.sh
```

# 相关论文以及引用信息
如果你觉得这个该模型有所帮助，请引用下面的相关的论文
```BibTeX
@article{cam++,
  title={CAM++: A Fast and Efficient Network for Speaker Verification Using Context-Aware Masking},
  author={Hui Wang and Siqi Zheng and Yafeng Chen and Luyao Cheng and Qian Chen},
  journal={arXiv preprint arXiv:2303.00332},
}
```

# 3D-Speaker 开发者社区钉钉群
<div align=left>
<img src="images/ding.jpg" width="260" />
</div>
