File size: 6,830 Bytes
c4fcbfd
 
 
 
 
56ebdb8
 
c4fcbfd
 
 
 
 
 
 
 
1cb6c7e
c4fcbfd
 
 
 
 
 
 
 
 
 
1cb6c7e
c4fcbfd
 
1cb6c7e
c4fcbfd
c354ac2
 
 
 
 
e50c506
c354ac2
 
 
 
 
 
c4fcbfd
 
 
 
1316ff0
c4fcbfd
 
 
 
 
 
 
1316ff0
 
c4fcbfd
 
 
b33d1e3
c4fcbfd
 
 
 
 
 
1cb6c7e
c4fcbfd
 
 
 
 
 
1cb6c7e
c4fcbfd
 
 
 
 
 
 
 
 
 
1cb6c7e
c4fcbfd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1cb6c7e
c4fcbfd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1cb6c7e
c4fcbfd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1cb6c7e
c4fcbfd
1cb6c7e
c4fcbfd
1cb6c7e
c4fcbfd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56ebdb8
 
 
 
 
 
 
c4fcbfd
 
 
 
c354ac2
c4fcbfd
 
 
 
56ebdb8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
---
tags:
- espnet
- audio
- speaker-recognition
- speaker-verification
- speaker-embedding
language: multilingual
datasets:
- voxceleb
license: cc-by-4.0
---

## ESPnet2 SPK model

### `espnet/voxcelebs12_ecapa_wavlm_joint`

This model was trained by Jungjee using voxceleb recipe in [espnet](https://github.com/espnet/espnet/).

### Demo: How to use in ESPnet2

Follow the [ESPnet installation instructions](https://espnet.github.io/espnet/installation.html)
if you haven't done that already.

```bash
cd espnet
git checkout e5da124138fc58708fcdda03fd8d4e02fe5d7c65
pip install -e .
cd egs2/voxceleb/spk1
./run.sh --skip_data_prep false --skip_train true --download_model espnet/voxcelebs12_ecapa_wavlm_joint
```
```python
import numpy as np
from espnet2.bin.spk_inference import Speech2Embedding

# from uploaded models
speech2spk_embed = Speech2Embedding.from_pretrained(model_tag="espnet/voxcelebs12_ecapa_wavlm_joint")
embedding = speech2spk_embed(np.zeros(16500))

# from checkpoints trained by oneself
speech2spk_embed = Speech2Embedding(model_file="model.pth", train_config="config.yaml")
embedding = speech2spk_embed(np.zeros(32000))
```

<!-- Generated by scripts/utils/show_spk_result.py -->
# RESULTS
## Environments
date: 2024-01-02 18:05:16.885973

- python version: 3.9.16 (main, Mar  8 2023, 14:00:05)  [GCC 11.2.0]
- espnet version: 202310
- pytorch version: 2.0.1

| | Mean | Std |
|---|---|---|
| Target | 8.9915 | 3.4923 |
| Non-target | 2.4666 | 2.4666 |

| Model name | EER(%) | minDCF |
|---|---|---|
| conf/tuning/train_ecapa_wavlm_joint | 0.394 | 0.03797 |

## SPK config

<details><summary>expand</summary>

```
config: conf/tuning/train_ecapa_Vox12_emb192_torchmelspec_subcentertopk_wavlm_jt11.yaml
print_config: false
log_level: INFO
drop_last_iter: true
dry_run: false
iterator_type: category
valid_iterator_type: sequence
output_dir: exp/spk_train_ecapa_Vox12_emb192_torchmelspec_subcentertopk_wavlm_jt11_raw_sp
ngpu: 1
seed: 0
num_workers: 8
num_att_plot: 0
dist_backend: nccl
dist_init_method: env://
dist_world_size: 4
dist_rank: 0
local_rank: 0
dist_master_addr: localhost
dist_master_port: 57359
dist_launcher: null
multiprocessing_distributed: true
unused_parameters: true
sharded_ddp: false
cudnn_enabled: true
cudnn_benchmark: true
cudnn_deterministic: false
collect_stats: false
write_collected_feats: false
max_epoch: 20
patience: null
val_scheduler_criterion:
- valid
- loss
early_stopping_criterion:
- valid
- loss
- min
best_model_criterion:
-   - valid
    - eer
    - min
keep_nbest_models: 2
nbest_averaging_interval: 0
grad_clip: 9999
grad_clip_type: 2.0
grad_noise: false
accum_grad: 16
no_forward_run: false
resume: true
train_dtype: float32
use_amp: true
log_interval: 100
use_matplotlib: true
use_tensorboard: true
create_graph_in_tensorboard: false
use_wandb: false
wandb_project: null
wandb_id: null
wandb_entity: null
wandb_name: null
wandb_model_log_interval: -1
detect_anomaly: false
use_lora: false
save_lora_only: true
lora_conf: {}
pretrain_path: null
init_param:
- save_exp/spk_train_ecapa_Vox12_emb192_torchmelspec_subcentertopk_wavlm_raw_sp/valid.eer.best.pth
ignore_init_mismatch: false
freeze_param: []
num_iters_per_epoch: 8000
batch_size: 64
valid_batch_size: 5
batch_bins: 1000000
valid_batch_bins: null
train_shape_file:
- exp/spk_stats_16k_sp/train/speech_shape
valid_shape_file:
- exp/spk_stats_16k_sp/valid/speech_shape
batch_type: folded
valid_batch_type: null
fold_length:
- 120000
sort_in_batch: descending
shuffle_within_batch: false
sort_batch: descending
multiple_iterator: false
chunk_length: 500
chunk_shift_ratio: 0.5
num_cache_chunks: 1024
chunk_excluded_key_prefixes: []
chunk_default_fs: null
train_data_path_and_name_and_type:
-   - dump/raw/voxceleb12_devs_sp/wav.scp
    - speech
    - sound
-   - dump/raw/voxceleb12_devs_sp/utt2spk
    - spk_labels
    - text
valid_data_path_and_name_and_type:
-   - dump/raw/voxceleb1_test/trial.scp
    - speech
    - sound
-   - dump/raw/voxceleb1_test/trial2.scp
    - speech2
    - sound
-   - dump/raw/voxceleb1_test/trial_label
    - spk_labels
    - text
allow_variable_data_keys: false
max_cache_size: 0.0
max_cache_fd: 32
allow_multi_rates: false
valid_max_cache_size: null
exclude_weight_decay: false
exclude_weight_decay_conf: {}
optim: adam
optim_conf:
    lr: 0.0001
    weight_decay: 1.0e-05
    amsgrad: false
scheduler: cosineannealingwarmuprestarts
scheduler_conf:
    first_cycle_steps: 10000
    cycle_mult: 1.0
    max_lr: 5.0e-05
    min_lr: 5.0e-06
    warmup_steps: 1000
    gamma: 0.75
init: null
use_preprocessor: true
input_size: null
target_duration: 3.0
spk2utt: dump/raw/voxceleb12_devs_sp/spk2utt
spk_num: 21615
sample_rate: 16000
num_eval: 10
rir_scp: ''
model_conf:
    extract_feats_in_collect_stats: false
frontend: s3prl
frontend_conf:
    frontend_conf:
        upstream: wavlm_large
    download_dir: ./hub
    multilayer_feature: true
specaug: null
specaug_conf: {}
normalize: utterance_mvn
normalize_conf:
    norm_vars: false
encoder: ecapa_tdnn
encoder_conf:
    model_scale: 8
    ndim: 1024
    output_size: 1536
pooling: chn_attn_stat
pooling_conf: {}
projector: rawnet3
projector_conf:
    output_size: 192
preprocessor: spk
preprocessor_conf:
    target_duration: 6.0
    sample_rate: 16000
    num_eval: 3
    noise_apply_prob: 0.0
    noise_info:
    -   - 1.0
        - dump/raw/musan_speech.scp
        -   - 4
            - 7
        -   - 13
            - 20
    -   - 1.0
        - dump/raw/musan_noise.scp
        -   - 1
            - 1
        -   - 0
            - 15
    -   - 1.0
        - dump/raw/musan_music.scp
        -   - 1
            - 1
        -   - 5
            - 15
    rir_apply_prob: 0.0
    rir_scp: dump/raw/rirs.scp
loss: aamsoftmax_sc_topk
loss_conf:
    margin: 0.5
    scale: 30
    K: 3
    mp: 0.06
    k_top: 5
required:
- output_dir
version: '202310'
distributed: true
```

</details>



### Citing ESPnet

```BibTex
@article{jung2024espnet,
  title={ESPnet-SPK: full pipeline speaker embedding toolkit with reproducible recipes, self-supervised front-ends, and off-the-shelf models},
  author={Jung, Jee-weon and Zhang, Wangyou and Shi, Jiatong and Aldeneh, Zakaria and Higuchi, Takuya and Theobald, Barry-John and Abdelaziz, Ahmed Hussen and Watanabe, Shinji},
  journal={arXiv preprint arXiv:2401.17230},
  year={2024}
}

@inproceedings{watanabe2018espnet,
  author={Shinji Watanabe and Takaaki Hori and Shigeki Karita and Tomoki Hayashi and Jiro Nishitoba and Yuya Unno and Nelson Yalta and Jahn Heymann and Matthew Wiesner and Nanxin Chen and Adithya Renduchintala and Tsubasa Ochiai},
  title={{ESPnet}: End-to-End Speech Processing Toolkit},
  year={2018},
  booktitle={Proc. Interspeech},
  pages={2207--2211},
  doi={10.21437/Interspeech.2018-1456},
  url={http://dx.doi.org/10.21437/Interspeech.2018-1456}
}
```