Skip to content

Commit

Permalink
Merge pull request #5659 from Alexgichamba/sdsv_2021
Browse files Browse the repository at this point in the history
ESPnet-SPK: add SdSV 2021 recipe
  • Loading branch information
sw005320 committed Feb 15, 2024
2 parents 6082b1d + ea510cd commit 332fdc1
Show file tree
Hide file tree
Showing 30 changed files with 1,234 additions and 0 deletions.
1 change: 1 addition & 0 deletions egs2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ See: https://espnet.github.io/espnet/espnet2_tutorial.html#recipes-using-espnet2
| reverb | REVERB (REverberant Voice Enhancement and Recognition Benchmark) challenge | ASR | ENG | https://reverb2014.dereverberation.com/ | |
| ru_open_stt | Russian Open Speech To Text (STT/ASR) Dataset | ASR | RUS | https://github.com/snakers4/open_stt | |
| ruslan | RUSLAN: Russian Spoken Language Corpus For Speech Synthesis | TTS | RUS | https://ruslan-corpus.github.io/ | |
| sdsv21 | SdSV 2021: Short-duration Speaker Verification (SdSV) Challenge 2021 | SPK | 10+ Languages | https://sdsvc.github.io/ | |
| seame | SEAME: a Mandarin-English Code-switching Speech Corpus in South-East Asia | ASR | ENG + CMN | https://catalog.ldc.upenn.edu/LDC2015S04 | |
| sinhala | Sinhala speech recognition corpus | ASR | SIN | https://drive.google.com/file/d/17_e0JhMW4_FPxfh93foplnxb4OQp8zh3/view?usp=sharing | |
| siwis | SIWIS: Spoken Interaction with Interpretation in Switzerland | TTS | FRA | https://datashare.ed.ac.uk/handle/10283/2353 | |
Expand Down
3 changes: 3 additions & 0 deletions egs2/TEMPLATE/spk1/db.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Set the path of your corpus
# "downloads" means the corpus can be downloaded by the recipe automatically

PUBLICDEEPMINE=downloads
LIBRISPEECH=downloads
COMMONVOICE16FARSI=downloads
VOXBLINK=downloads
VOXCELEB=downloads
MUSAN=downloads
Expand Down
14 changes: 14 additions & 0 deletions egs2/sdsv21/spk1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# RESULTS
Overall results

## Test set: Vox1-O

| Model (conf name) | EER(%) | minDCF | Note | HuggingFace |
|---|---|---|---|---|
| [conf/train_rawnet3.yaml](conf/train_rawnet3.yaml) | 1.229 | 0.08033 | | [https://huggingface.co/espnet/voxcelebs12devs_librispeech_cv16fa_rawnet3](https://huggingface.co/espnet/voxcelebs12devs_librispeech_cv16fa_rawnet3) |

## Test set: Sample DeepMine

| Model (conf name) | EER(%) | minDCF | Note | HuggingFace |
|---|---|---|---|---|
| [conf/train_rawnet3.yaml](conf/train_rawnet3.yaml) | 4.640 | 0.25994 | | [https://huggingface.co/espnet/voxcelebs12devs_librispeech_cv16fa_rawnet3](https://huggingface.co/espnet/voxcelebs12devs_librispeech_cv16fa_rawnet3) |
110 changes: 110 additions & 0 deletions egs2/sdsv21/spk1/cmd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# ====== About run.pl, queue.pl, slurm.pl, and ssh.pl ======
# Usage: <cmd>.pl [options] JOB=1:<nj> <log> <command...>
# e.g.
# run.pl --mem 4G JOB=1:10 echo.JOB.log echo JOB
#
# Options:
# --time <time>: Limit the maximum time to execute.
# --mem <mem>: Limit the maximum memory usage.
# -–max-jobs-run <njob>: Limit the number parallel jobs. This is ignored for non-array jobs.
# --num-threads <ngpu>: Specify the number of CPU core.
# --gpu <ngpu>: Specify the number of GPU devices.
# --config: Change the configuration file from default.
#
# "JOB=1:10" is used for "array jobs" and it can control the number of parallel jobs.
# The left string of "=", i.e. "JOB", is replaced by <N>(Nth job) in the command and the log file name,
# e.g. "echo JOB" is changed to "echo 3" for the 3rd job and "echo 8" for 8th job respectively.
# Note that the number must start with a positive number, so you can't use "JOB=0:10" for example.
#
# run.pl, queue.pl, slurm.pl, and ssh.pl have unified interface, not depending on its backend.
# These options are mapping to specific options for each backend and
# it is configured by "conf/queue.conf" and "conf/slurm.conf" by default.
# If jobs failed, your configuration might be wrong for your environment.
#
#
# The official documentation for run.pl, queue.pl, slurm.pl, and ssh.pl:
# "Parallelization in Kaldi": http://kaldi-asr.org/doc/queue.html
# =========================================================~


# Select the backend used by run.sh from "local", "stdout", "sge", "slurm", or "ssh"
cmd_backend='local'

# Local machine, without any Job scheduling system
if [ "${cmd_backend}" = local ]; then

# The other usage
export train_cmd="run.pl"
# Used for "*_train.py": "--gpu" is appended optionally by run.sh
export cuda_cmd="run.pl"
# Used for "*_recog.py"
export decode_cmd="run.pl"

# Local machine logging to stdout and log file, without any Job scheduling system
elif [ "${cmd_backend}" = stdout ]; then

# The other usage
export train_cmd="stdout.pl"
# Used for "*_train.py": "--gpu" is appended optionally by run.sh
export cuda_cmd="stdout.pl"
# Used for "*_recog.py"
export decode_cmd="stdout.pl"


# "qsub" (Sun Grid Engine, or derivation of it)
elif [ "${cmd_backend}" = sge ]; then
# The default setting is written in conf/queue.conf.
# You must change "-q g.q" for the "queue" for your environment.
# To know the "queue" names, type "qhost -q"
# Note that to use "--gpu *", you have to setup "complex_value" for the system scheduler.

export train_cmd="queue.pl"
export cuda_cmd="queue.pl"
export decode_cmd="queue.pl"


# "qsub" (Torque/PBS.)
elif [ "${cmd_backend}" = pbs ]; then
# The default setting is written in conf/pbs.conf.

export train_cmd="pbs.pl"
export cuda_cmd="pbs.pl"
export decode_cmd="pbs.pl"


# "sbatch" (Slurm)
elif [ "${cmd_backend}" = slurm ]; then
# The default setting is written in conf/slurm.conf.
# You must change "-p cpu" and "-p gpu" for the "partition" for your environment.
# To know the "partion" names, type "sinfo".
# You can use "--gpu * " by default for slurm and it is interpreted as "--gres gpu:*"
# The devices are allocated exclusively using "${CUDA_VISIBLE_DEVICES}".

export train_cmd="slurm.pl"
export cuda_cmd="slurm.pl"
export decode_cmd="slurm.pl"

elif [ "${cmd_backend}" = ssh ]; then
# You have to create ".queue/machines" to specify the host to execute jobs.
# e.g. .queue/machines
# host1
# host2
# host3
# Assuming you can login them without any password, i.e. You have to set ssh keys.

export train_cmd="ssh.pl"
export cuda_cmd="ssh.pl"
export decode_cmd="ssh.pl"

# This is an example of specifying several unique options in the JHU CLSP cluster setup.
# Users can modify/add their own command options according to their cluster environments.
elif [ "${cmd_backend}" = jhu ]; then

export train_cmd="queue.pl --mem 2G"
export cuda_cmd="queue-freegpu.pl --mem 2G --gpu 1 --config conf/queue.conf"
export decode_cmd="queue.pl --mem 4G"

else
echo "$0: Error: Unknown cmd_backend=${cmd_backend}" 1>&2
return 1
fi
16 changes: 16 additions & 0 deletions egs2/sdsv21/spk1/conf/decode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# embedding extraction
num_workers: 2
valid_batch_size: 40
target_duration: 8.0 # seconds
num_eval: 2

# score norm
num_cohort_spk: 5994
num_utt_per_spk: 20
utt_select_sec: 2
adaptive_cohort_size: 500
average_spk: true

# quality measure function
qmf_dur_thresh: 6
qmf_num_trial_per_condition: 5000
2 changes: 2 additions & 0 deletions egs2/sdsv21/spk1/conf/fbank.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--sample-frequency=16000
--num-mel-bins=80
11 changes: 11 additions & 0 deletions egs2/sdsv21/spk1/conf/pbs.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Default configuration
command qsub -V -v PATH -S /bin/bash
option name=* -N $0
option mem=* -l mem=$0
option mem=0 # Do not add anything to qsub_opts
option num_threads=* -l ncpus=$0
option num_threads=1 # Do not add anything to qsub_opts
option num_nodes=* -l nodes=$0:ppn=1
default gpu=0
option gpu=0
option gpu=* -l ngpus=$0
1 change: 1 addition & 0 deletions egs2/sdsv21/spk1/conf/pitch.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--sample-frequency=16000
12 changes: 12 additions & 0 deletions egs2/sdsv21/spk1/conf/queue.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Default configuration
command qsub -v PATH -cwd -S /bin/bash -j y -l arch=*64*
option name=* -N $0
option mem=* -l mem_free=$0,ram_free=$0
option mem=0 # Do not add anything to qsub_opts
option num_threads=* -pe smp $0
option num_threads=1 # Do not add anything to qsub_opts
option max_jobs_run=* -tc $0
option num_nodes=* -pe mpi $0 # You must set this PE as allocation_rule=1
default gpu=0
option gpu=0
option gpu=* -l gpu=$0 -q g.q
14 changes: 14 additions & 0 deletions egs2/sdsv21/spk1/conf/slurm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Default configuration
command sbatch --export=PATH
option name=* --job-name $0
option time=* --time $0
option mem=* --mem-per-cpu $0
option mem=0
option num_threads=* --cpus-per-task $0
option num_threads=1 --cpus-per-task 1
option num_nodes=* --nodes $0
default gpu=0
option gpu=0 -p cpu
option gpu=* -p gpu --gres=gpu:$0 -c $0 # Recommend allocating more CPU than, or equal to the number of GPU
# note: the --max-jobs-run option is supported as a special case
# by slurm.pl and you don't have to handle it in the config file.
92 changes: 92 additions & 0 deletions egs2/sdsv21/spk1/conf/train_rawnet3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# RawNet3 reproduce recipe configuration.
# Requires approx. 40GRAM per GPU when run with 2GPUs
# or 20GRAM when run with 4GPUs.

# Frontend
frontend: asteroid_frontend
frontend_conf:
sinc_stride: 16
sinc_kernel_size: 251
sinc_filters: 256
preemph_coef: 0.97
log_term: 0.000001

# Encoder
encoder: rawnet3
encoder_conf:
model_scale: 8
ndim: 1024
output_size: 1536

# Pooling
pooling: chn_attn_stat

# Projector
projector: rawnet3
projector_conf:
output_size: 192

# Preprocessor
preprocessor: spk
preprocessor_conf:
target_duration: 3.0 # seconds
sample_rate: 16000
num_eval: 5
noise_apply_prob: 0.5
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.5
rir_scp: dump/raw/rirs.scp

# Model config
model_conf:
extract_feats_in_collect_stats: false

# Loss
loss: aamsoftmax_sc_topk
loss_conf:
margin: 0.3
scale: 30
K: 3
mp: 0.06
k_top: 5

# Training related
max_epoch: 40
num_att_plot: 0
num_workers: 2
cudnn_deterministic: False
cudnn_benchmark: True
drop_last_iter: True
iterator_type: category
valid_iterator_type: sequence
shuffle_within_batch: False
log_interval: 100
batch_size: 128
valid_batch_size: 40
use_amp: False
keep_nbest_models: 3
grad_clip: 9999
best_model_criterion:
- - valid
- eer
- min

# Optimizer
optim: adam
optim_conf:
lr: 0.001
weight_decay: 0.00005
amsgrad: False

# Scheduler
scheduler: CosineAnnealingWarmupRestarts
scheduler_conf:
first_cycle_steps: 158760 # equal to 4 epochs
cycle_mult: 1.0
max_lr: 0.001
min_lr: 0.000005
warmup_steps: 1000
gamma: 0.75
1 change: 1 addition & 0 deletions egs2/sdsv21/spk1/db.sh

0 comments on commit 332fdc1

Please sign in to comment.