Click here to register.

Step 6 - Creating Flat Start Monophones

Define Prototype Model

The first step in Hidden Markov Model ("HMM") training is defining a prototype model called "proto".   The focus here is to create a model structure, the parameters are not important.  Create a file called 'proto' in your 'voxforge/manual' directory and add the following:

~o <VecSize> 25 <MFCC_0_D_N_Z>
~h "proto"
<BeginHMM>
  <NumStates> 5
  <State> 2
    <Mean> 25
      0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 
    <Variance> 25
      1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
 <State> 3
    <Mean> 25
      0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 
    <Variance> 25
      1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
 <State> 4
    <Mean> 25
      0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
    <Variance> 25
      1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
 <TransP> 5
  0.0 1.0 0.0 0.0 0.0
  0.0 0.6 0.4 0.0 0.0
  0.0 0.0 0.6 0.4 0.0
  0.0 0.0 0.0 0.7 0.3
  0.0 0.0 0.0 0.0 0.0
<EndHMM>
 

For details of what all this means, see the HTK book.

You also need a configuration file.  Create a file called 'config' in your 'voxforge/manual' directory and add the following data:

TARGETKIND = MFCC_0_D_N_Z
TARGETRATE = 100000.0
SAVECOMPRESSED = T
SAVEWITHCRC = T
WINDOWSIZE = 250000.0
USEHAMMING = T
PREEMCOEF = 0.97
NUMCHANS = 26
CEPLIFTER = 22
NUMCEPS = 12

Note: the target kind in you proto file (the "MFCC_0_D_N_Z" on the first line), needs to match the TARGETKIND in your config file.

You also need to tell HTK where all your feature vector files are located (those are the mfcc files you created in the last step).  You do this with with a script file.  Therefore, create a file called "train.scptrain.scp".

The next step is to create a new folder call hmm0.  Then create a new version of proto in the hmm0 folder - using the HTK  HCompV tool as follows:

$HCompV -A -D -T 1 -C config -f 0.01 -m -S train.scp -M hmm0 proto

 This creates two files in the hmm0 folder:

Flat Start Monophones

create hmmdefs

  1. Create a new file called hmmdefs in your 'voxforge/manual/hmm0' folder:
    • Copy the  monophones0monophones0 file to your hmm0 folder;
    • rename the monophones0 file to hmmdefs;
  2. For each phone in hmmdefs:
  • put the phone in double quotes;
  • add '~h ' before the phone (note the space after the '~h'); and
  • copy from line 5 onwards (i.e. starting from "<BEGINHMM>" to "<ENDHMM>") of the hmm0/proto file and paste it after each phone.
Leave one blank line at the end of your file.

This create the hmmdefshmmdefs file, which contains "flat start" monophones.

Create macros File

The final step in this section is to create the macros file.

A new file called macros should be created and stored in your 'voxforge/manual/hmm0' folder:

  • create a new file called macros in hmm0;
  • copy vFloors to macros
  • copy the first 3 lines of proto (from ~o to <DIAGC>) and add them to the top of the macros file

It should look something like this when you have finished:

~o
<STREAMINFO> 1 25
<VECSIZE> 25<NULLD><MFCC_D_N_Z_0><DIAGC>
~v varFloor1
<Variance> 25
 6.580433e-01 3.732679e-01 3.525512e-01 4.770427e-01 4.332326e-01 4.544643e-01 5.620688e-01 2.553866e-01 4.001570e-01 3.416672e-01 2.128212e-01 2.660224e-01 1.668585e-02 1.700366e-02 1.616409e-02 1.768895e-02 1.718035e-02 2.098122e-02 2.326025e-02 1.677738e-02 2.010740e-02 1.595870e-02 1.417547e-02 1.510511e-02 1.447709e-02

 

Re-estimate Monophones

Next, create 9 new folders named consecutively in your 'voxforge/manual' folder: hmm1 to hmm9.

The Flat Start Monophones are re-estimated using the HERest tool.  The purpose of this is to load all the models in the hmm0 folder (these are contained in the hmmdefs file), and re-estimate them using the MFCC files listed in the train.scp script, and create a new model set in hmm1.   Execute the HERest command from your 'voxforge/manual' directory:

$HERest -A -D -T 1 -C config -I phones0.mlf -t 250.0 150.0 1000.0 -S train.scp -H hmm0/macros -H hmm0/hmmdefs -M hmm1 monophones0

The files created by this command are:

 

This process is repeated 2 more times, creating new model sets in hmm2 and hmm3, respectively:

$HERest -A -D -T 1 -C config -I phones0.mlf -t 250.0 150.0 1000.0 -S train.scp -H hmm1/macros -H hmm1/hmmdefs -M hmm2 monophones0

The files created by this command are:


$HERest -A -D -T 1 -C config -I phones0.mlf -t 250.0 150.0 1000.0 -S train.scp -H hmm2/macros -H hmm2/hmmdefs -M hmm3 monophones0

The files created by this command are:

Comments

AddSearch

By Ankur Rana - 1/30/2013 - 1 Replies On executing the command, i am getting following error message:

By Abdou - 11/27/2012 Hi i'm in the 6th step and when i execute cammand HERest i got this error Error [+7321] CreateInsts: Unknown label . can u help plz?

By Aghilas (ENP) - 4/25/2012 slt,

By bejimed - 3/2/2012 - 1 Replies The prototype model proposed in this tutorial contain 5 states , so what are the differents modification in order to have a new and specially the new transP matrice protype model contain more than 5 states ( exemple 7 states)

By Stewie - 11/22/2011 When you've faced this problem,

By Siwar - 11/11/2011 - 1 Replies hello

By Gerald - 5/10/2011 - 3 Replies Hey,

By Visitor - 4/8/2011 - 2 Replies hi i followed the steps till here properly...but when i ran HERest then it gave me the following error..could anyone tell me what is wrong..also i have the same names for my wav files and the label files.. thank you..

By Visitor - 12/26/2010 - 1 Replies Hi ! i wanna create speech to text (again), with manual labelling and not using flat-start.

By aspirant - 10/19/2010 - 1 Replies hi..

By Carlo - 10/2/2010 Ok, I'm Italian student...

By novision - 6/14/2010 - 1 Replies

By mmm - 6/1/2010 - 5 Replies hi

By Milos - 3/5/2010 - 1 Replies I have the same problem:

By LAROUI Ahmed Ridha - 3/5/2010 - 1 Replies hello every body,

By SomeoneWhoNeedsUrgentHelp! - 1/26/2010 - 1 Replies Hi!, well the title says it all,

By Mathspeedy(Boutch) - 1/4/2010 - 11 Replies Hi!, i'm having a theses errors when trying the following:

By puphe_88 - 11/28/2009 - 5 Replies i'm running htk in windows and i've a problem in HCompv

By khushami827 - 7/20/2009 - 1 Replies HVite -H model\hmm15\macros -H model \hmm15\hmmdefs -S trainlist\test.scp -l * -i recout.mlf -w def\net.slf -p 0.0 -s 5.0 def\dict tiedlist ERROR [+3231] ProcessFile: Incompatible sample kind MFCC_D_Z_0 vs MFCC_D_N_Z_ 0 FATAL ERROR - Terminating program HVite

By khushami827 - 7/20/2009 - 3 Replies HERest -A -D -T 1 -C config\config - I def\phones0.mlf -t 250.0 150.0 1000.0 -S trainlist\trainlist.scp -H model\hmm0 \macros -H model\hmm0\hmmdefs -M model\hmm1 def\monophones0

By RedCisc - 6/28/2009 - 2 Replies Hi,

By lyes - 5/24/2009 - 1 Replies Hi ken,

By lyes - 5/19/2009 - 3 Replies Hi,

By hamid - 4/11/2009 - 3 Replies Hi,

By joshua - 4/3/2009 - 10 Replies I have got a different

By Pratap - 4/1/2009 - 3 Replies I am getting this error while doing the reestimation of hmm.Have checked everything but cannot find any mistake in phones0.mlf ,monophones0 and hmmdefs...Please help me with this...

By kmaclean - 9/23/2008 The Julius 3.2 book section 7. Feature parameter files (-input mfcfile) says:

By dave - 11/13/2008 - 2 Replies

By Alan - 10/5/2008 - 1 Replies I had problem with

By imene - 8/8/2008 - 1 Replies hi I have a problem with the HERest command. I don't have the description phonetics of each file of my base of data. am I can execute the comande "HERest" without the files '.lab' because when I try it I had the problem Processing data: sa1.mfcc; label sa1.lab error [+6510] LOpen: Unable to open label file dated/train_lab/sa1.lab help me please