Commit 24209853 authored by David Snyder's avatar David Snyder
Browse files

trunk: In Speaker ID setup added options for deltas (the new default is...

trunk: In Speaker ID setup added options for deltas (the new default is delta-window=3, delta-order=2) and updated the comments to reflect the change in accuracy. Also fixed script egs/sre08/v1/local/score_sre08.sh so that condition 0 is the average of the eight SRE08 conditions.

git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@4568 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent ceef6038
......@@ -29,12 +29,20 @@ for condition in $(seq 0 8); do
printf '% 7d' $condition;
done
echo
eers=()
tot_eer=0.0
printf '% 12s' 'EER:'
eer=$(awk '{print $3}' $scores | paste - $trials | awk '{print $1, $4}' | compute-eer - 2>/dev/null)
printf '% 7.2f' $eer
for condition in $(seq 8); do
eer=$(awk '{print $3}' $scores | paste - $trials | awk -v c=$condition '{n=4+c; if ($n == "Y") print $1, $4}' | compute-eer - 2>/dev/null)
printf '% 7.2f' $eer
tot_eer=$(echo "$tot_eer+$eer" | bc)
eers[$condition]=$eer
done
eers[0]=$(echo "$tot_eer/8" | bc -l)
for i in $(seq 0 8); do
printf '% 7.2f' ${eers[$i]}
done
echo
......
......@@ -88,7 +88,11 @@ utils/subset_data_dir.sh data/train 8000 data/train_8k
utils/subset_data_dir.sh data/train_male 8000 data/train_male_8k
utils/subset_data_dir.sh data/train_female 8000 data/train_female_8k
# The recipe currently uses delta-window=3 and delta-order=2. However
# the accuracy is almost as good using delta-window=4 and delta-order=1
# and could be faster due to lower dimensional features. Alternative
# delta options (e.g., --delta-window 4 --delta-order 1) can be provided to
# sid/train_diag_ubm.sh. The options will be propagated to the other scripts.
sid/train_diag_ubm.sh --nj 30 --cmd "$train_cmd" data/train_4k 2048 \
exp/diag_ubm_2048
......@@ -130,7 +134,7 @@ sid/train_ivector_extractor.sh --cmd "$train_cmd -l mem_free=2G,ram_free=2G" \
# see exp/gender_id_fisher/error_rate where it is also printed.
sid/gender_id.sh --cmd "$train_cmd" --nj 150 exp/full_ubm_2048{,_male,_female} \
data/train exp/gender_id_train
# Gender-id error rate is 3.69%
# Gender-id error rate is 3.41%
# Extract the iVectors for the Fisher data.
......@@ -156,7 +160,6 @@ sid/extract_ivectors.sh --cmd "$train_cmd -l mem_free=3G,ram_free=3G" --nj 50 \
exp/extractor_2048_male data/sre08_test_short3_male \
exp/ivectors_sre08_test_short3_male
### Demonstrate simple cosine-distance scoring:
trials=data/sre08_trials/short2-short3-female.trials
......@@ -170,7 +173,7 @@ local/score_sre08.sh $trials foo
# Results for Female:
# Scoring against data/sre08_trials/short2-short3-female.trials
# Condition: 0 1 2 3 4 5 6 7 8
# EER: 18.12 20.42 4.78 19.27 15.77 16.95 10.31 7.22 7.89
# EER: 12.64 19.72 4.78 18.56 15.32 16.71 10.42 7.22 8.42
trials=data/sre08_trials/short2-short3-male.trials
cat $trials | awk '{print $1, $2}' | \
......@@ -183,7 +186,7 @@ local/score_sre08.sh $trials foo
# Results for Male:
# Scoring against data/sre08_trials/short2-short3-male.trials
# Condition: 0 1 2 3 4 5 6 7 8
# EER: 16.27 19.18 3.63 18.53 14.35 14.37 8.35 6.61 4.82
# EER: 11.05 18.55 3.23 17.84 14.58 14.22 8.58 6.61 4.82
# The following shows a more direct way to get the scores.
# condition=6
......@@ -214,7 +217,7 @@ local/score_sre08.sh $trials foo
# Results for Female:
# Scoring against data/sre08_trials/short2-short3-female.trials
# Condition: 0 1 2 3 4 5 6 7 8
# EER: 11.84 9.91 2.09 9.38 10.66 12.02 8.76 6.46 7.89
# EER: 7.47 9.40 1.49 8.61 8.86 10.10 8.59 5.83 6.84
ivector-compute-lda --dim=150 --total-covariance-factor=0.1 \
'ark:ivector-normalize-length scp:exp/ivectors_train_male/ivector.scp ark:- |' \
......@@ -232,7 +235,7 @@ local/score_sre08.sh $trials foo
# Results for Male:
# Scoring against data/sre08_trials/short2-short3-male.trials
# Condition: 0 1 2 3 4 5 6 7 8
# EER: 10.57 9.45 0.81 9.28 8.88 7.50 7.09 5.01 3.51
# EER: 6.29 8.32 1.61 8.23 9.11 7.66 7.32 5.01 3.07
### Demonstrate PLDA scoring:
......@@ -253,7 +256,7 @@ local/score_sre08.sh $trials foo
# Result for Female is below:
# Scoring against data/sre08_trials/short2-short3-female.trials
# Condition: 0 1 2 3 4 5 6 7 8
# EER: 14.98 11.78 1.79 12.09 10.96 11.06 7.48 4.69 4.47
# EER: 7.58 11.01 1.19 11.23 10.21 10.22 7.48 4.82 4.47
trials=data/sre08_trials/short2-short3-male.trials
ivector-compute-plda ark:data/train_male/spk2utt \
......@@ -268,12 +271,9 @@ ivector-plda-scoring --num-utts=ark:exp/ivectors_sre08_train_short2_male/num_utt
# Result for Male is below:
# Scoring against data/sre08_trials/short2-short3-male.trials
# Condition: 0 1 2 3 4 5 6 7 8
# EER: 11.36 9.22 1.21 9.56 7.97 7.19 5.72 3.19 2.19
# EER: 5.48 8.77 1.21 9.03 7.29 6.41 5.95 3.42 1.75
# The next line is how you'd test the domain-adaptation stuff.
# I haven't tested this yet in the up-to-date setup.
# first, female.
trials=data/sre08_trials/short2-short3-female.trials
cat exp/ivectors_sre08_train_short2_female/spk_ivector.scp exp/ivectors_sre08_test_short3_female/spk_ivector.scp > female.scp
......@@ -283,12 +283,11 @@ ivector-plda-scoring --num-utts=ark:exp/ivectors_sre08_train_short2_female/num_u
scp:exp/ivectors_sre08_test_short3_female/ivector.scp \
"cat '$trials' | awk '{print \$1, \$2}' |" foo; local/score_sre08.sh $trials foo
# Results:
Condition: 0 1 2 3 4 5 6 7 8
# EER: 9.05 7.89 1.49 8.12 10.51 10.46 6.76 4.82 4.74
# Baseline (repeated from above):
# Condition: 0 1 2 3 4 5 6 7 8
# EER: 14.98 11.78 1.79 12.09 10.96 11.06 7.48 4.69 4.47
# Condition: 0 1 2 3 4 5 6 7 8
# EER: 6.34 7.00 1.19 7.19 9.76 9.38 6.76 4.69 4.74
# Baseline (repeated from above):
# Condition: 0 1 2 3 4 5 6 7 8
# EER: 7.58 11.01 1.19 11.23 10.21 10.22 7.48 4.82 4.47
# next, male.
......@@ -300,8 +299,9 @@ ivector-plda-scoring --num-utts=ark:exp/ivectors_sre08_train_short2_male/num_utt
scp:exp/ivectors_sre08_test_short3_male/ivector.scp \
"cat '$trials' | awk '{print \$1, \$2}' |" foo; local/score_sre08.sh $trials foo
# Condition: 0 1 2 3 4 5 6 7 8
# EER: 6.66 6.14 1.21 6.34 7.97 7.19 6.52 4.56 3.07
# baseline is as follows, repeated from above. Focus on condition 0 (= all).
# Condition: 0 1 2 3 4 5 6 7 8
# EER: 11.36 9.22 1.21 9.56 7.97 7.19 5.72 3.19 2.19
# Results:
# Condition: 0 1 2 3 4 5 6 7 8
# EER: 5.12 5.92 1.21 6.06 7.74 6.41 6.41 4.56 2.63
# Baseline is as follows, repeated from above. Focus on condition 0 (= all).
# Condition: 0 1 2 3 4 5 6 7 8
# EER: 5.48 8.77 1.21 9.03 7.29 6.41 5.95 3.42 1.75
#!/bin/bash
# Copyright 2013 Daniel Povey
# 2014 David Snyder
# Apache 2.0.
# This script extracts iVectors for a set of utterances, given
......@@ -51,9 +52,10 @@ mkdir -p $dir/log
sdata=$data/split$nj;
utils/split_data.sh $data $nj || exit 1;
delta_opts=`cat $srcdir/delta_opts 2>/dev/null`
## Set up features.
feats="ark,s,cs:add-deltas scp:$sdata/JOB/feats.scp ark:- | apply-cmvn-sliding --norm-vars=false --center=true --cmn-window=300 ark:- ark:- | select-voiced-frames ark:- scp,s,cs:$sdata/JOB/vad.scp ark:- |"
feats="ark,s,cs:add-deltas $delta_opts scp:$sdata/JOB/feats.scp ark:- | apply-cmvn-sliding --norm-vars=false --center=true --cmn-window=300 ark:- ark:- | select-voiced-frames ark:- scp,s,cs:$sdata/JOB/vad.scp ark:- |"
if [ $stage -le 0 ]; then
......
#!/bin/bash
# Copyright 2013 Daniel Povey
# 2014 David Snyder
# Apache 2.0.
# This script gets gender-id information for a set of utterances.
......@@ -49,6 +50,12 @@ female_ubmdir=$3
data=$4
dir=$5
delta_opts=`cat $ubmdir/delta_opts 2>/dev/null`
if [ -f $ubmdir/delta_opts ]; then
cp $ubmdir/delta_opts $male_ubmdir/ 2>/dev/null
cp $ubmdir/delta_opts $female_ubmdir/ 2>/dev/null
fi
for f in $ubmdir/final.ubm $male_ubmdir/final.ubm $female_ubmdir/final.ubm $data/feats.scp $data/vad.scp; do
[ ! -f $f ] && echo "No such file $f" && exit 1;
done
......@@ -69,7 +76,7 @@ fi
## Set up features.
feats="ark,s,cs:add-deltas scp:$sdata/JOB/feats.scp ark:- | apply-cmvn-sliding --norm-vars=false --center=true --cmn-window=300 ark:- ark:- | select-voiced-frames ark:- scp,s,cs:$sdata/JOB/vad.scp ark:- |"
feats="ark,s,cs:add-deltas $delta_opts scp:$sdata/JOB/feats.scp ark:- | apply-cmvn-sliding --norm-vars=false --center=true --cmn-window=300 ark:- ark:- | select-voiced-frames ark:- scp,s,cs:$sdata/JOB/vad.scp ark:- |"
if [ $stage -le -2 ]; then
$cmd $dir/log/convert.log \
......
......@@ -2,6 +2,7 @@
# Copyright 2012 Johns Hopkins University (Author: Daniel Povey)
# 2013 Daniel Povey
# 2014 David Snyder
# Apache 2.0.
# This is a modified version of steps/train_diag_ubm.sh, specialized for
......@@ -29,6 +30,8 @@ min_gaussian_weight=0.0001
remove_low_count_gaussians=true # set this to false if you need #gauss to stay fixed.
num_threads=32
parallel_opts="-pe smp 32"
delta_window=3
delta_order=2
# End configuration section.
echo "$0 $@" # Print the command line for logging
......@@ -63,6 +66,9 @@ if [ $# != 3 ]; then
echo " --min-gaussian-weight <weight|0.0001> # min Gaussian weight allowed in GMM"
echo " # initialization (this relatively high"
echo " # value keeps counts fairly even)"
echo " --delta-window <n|3> # number of frames of context used to"
echo " # calculate delta"
echo " --delta-order <n|2> # number of delta features"
exit 1;
fi
......@@ -80,11 +86,13 @@ for f in $data/feats.scp $data/vad.scp; do
[ ! -f $f ] && echo "$0: expecting file $f to exist" && exit 1
done
delta_opts="--delta-window=$delta_window --delta-order=$delta_order"
echo $delta_opts > $dir/delta_opts
# Note: there is no point subsampling all_feats, because gmm-global-init-from-feats
# effectively does subsampling itself (it keeps a random subset of the features).
all_feats="ark,s,cs:add-deltas scp:$data/feats.scp ark:- | apply-cmvn-sliding --norm-vars=false --center=true --cmn-window=300 ark:- ark:- | select-voiced-frames ark:- scp,s,cs:$data/vad.scp ark:- |"
feats="ark,s,cs:add-deltas scp:$sdata/JOB/feats.scp ark:- | apply-cmvn-sliding --norm-vars=false --center=true --cmn-window=300 ark:- ark:- | select-voiced-frames ark:- scp,s,cs:$sdata/JOB/vad.scp ark:- | subsample-feats --n=$subsample ark:- ark:- |"
all_feats="ark,s,cs:add-deltas $delta_opts scp:$data/feats.scp ark:- | apply-cmvn-sliding --norm-vars=false --center=true --cmn-window=300 ark:- ark:- | select-voiced-frames ark:- scp,s,cs:$data/vad.scp ark:- |"
feats="ark,s,cs:add-deltas $delta_opts scp:$sdata/JOB/feats.scp ark:- | apply-cmvn-sliding --norm-vars=false --center=true --cmn-window=300 ark:- ark:- | select-voiced-frames ark:- scp,s,cs:$sdata/JOB/vad.scp ark:- | subsample-feats --n=$subsample ark:- ark:- |"
num_gauss_init=$(perl -e "print int($initial_gauss_proportion * $num_gauss); ");
! [ $num_gauss_init -gt 0 ] && echo "Invalid num-gauss-init $num_gauss_init" && exit 1;
......
......@@ -54,15 +54,19 @@ for f in $data/feats.scp $data/vad.scp; do
[ ! -f $f ] && echo "No such file $f" && exit 1;
done
mkdir -p $dir/log
echo $nj > $dir/num_jobs
sdata=$data/split$nj;
utils/split_data.sh $data $nj || exit 1;
delta_opts=`cat $srcdir/delta_opts 2>/dev/null`
if [ -f $srcdir/delta_opts ]; then
cp $srcdir/delta_opts $dir/ 2>/dev/null
fi
## Set up features.
feats="ark,s,cs:add-deltas scp:$sdata/JOB/feats.scp ark:- | apply-cmvn-sliding --norm-vars=false --center=true --cmn-window=300 ark:- ark:- | select-voiced-frames ark:- scp,s,cs:$sdata/JOB/vad.scp ark:- | subsample-feats --n=$subsample ark:- ark:- |"
feats="ark,s,cs:add-deltas $delta_opts scp:$sdata/JOB/feats.scp ark:- | apply-cmvn-sliding --norm-vars=false --center=true --cmn-window=300 ark:- ark:- | select-voiced-frames ark:- scp,s,cs:$sdata/JOB/vad.scp ark:- | subsample-feats --n=$subsample ark:- ark:- |"
if [ $stage -le -2 ]; then
......
#!/bin/bash
# Copyright 2013 Daniel Povey
# 2014 David Snyder
# Apache 2.0.
# This script trains the i-vector extractor. Note: there are 3 separate levels
......@@ -72,6 +73,7 @@ fi
fgmm_model=$1
data=$2
dir=$3
srcdir=$(dirname $fgmm_model)
for f in $fgmm_model $data/feats.scp ; do
[ ! -f $f ] && echo "No such file $f" && exit 1;
......@@ -83,9 +85,14 @@ nj_full=$[$nj*$num_processes]
sdata=$data/split$nj_full;
utils/split_data.sh $data $nj_full || exit 1;
delta_opts=`cat $srcdir/delta_opts 2>/dev/null`
if [ -f $srcdir/delta_opts ]; then
cp $srcdir/delta_opts $dir/ 2>/dev/null
fi
parallel_opts="-pe smp $[$num_threads*$num_processes]"
## Set up features.
feats="ark,s,cs:add-deltas scp:$sdata/JOB/feats.scp ark:- | apply-cmvn-sliding --norm-vars=false --center=true --cmn-window=300 ark:- ark:- | select-voiced-frames ark:- scp,s,cs:$sdata/JOB/vad.scp ark:- |"
feats="ark,s,cs:add-deltas $delta_opts scp:$sdata/JOB/feats.scp ark:- | apply-cmvn-sliding --norm-vars=false --center=true --cmn-window=300 ark:- ark:- | select-voiced-frames ark:- scp,s,cs:$sdata/JOB/vad.scp ark:- |"
# Initialize the i-vector extractor using the FGMM input
if [ $stage -le -2 ]; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment