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/tutorial' directory containng 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/tutorial' directory and containing 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 an HTK script file.  Therefore, create a file called train.scp.

The next step is to create a new folder called 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/tutorial/hmm0' folder:
    • Copy the  monophones0 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 creates the hmmdefs 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/tutorial/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.580434e-01 3.732679e-01 3.525515e-01 4.770429e-01 4.332327e-01 4.544640e-01 5.620689e-01 2.553866e-01 4.001572e-01 3.416671e-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.010739e-02 1.595870e-02 1.417548e-02 1.510511e-02 1.447709e-02

 

Re-estimate Monophones

Next, create 9 new folders named consecutively in your 'voxforge/tutorial' 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/tutorial' 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

By prithviraj - 5/4/2018 Hi

By prithviraj - 5/3/2018 Hi

By sekarpdkt - 8/27/2017 - 7 Replies Hi I am struck here

By Gururaj - 12/16/2016 - 1 Replies hi all..

By Nazik - 11/27/2016 - 3 Replies

By windclay - 1/22/2016 - 2 Replies I have trained data with 0 to 16 mixtures.

By visitor1 - 11/25/2015 - 1 Replies hi

By ibr - 8/7/2015 - 2 Replies if i have a different set of words than the ones in this example would the same included proto file works fine? if not what a good source to explain the meaning of vectors that composes the proto file, the PDF about HTK toolkit doesn't seems to give a proper explaination

By Negar - 1/10/2015 - 2 Replies Hello, I have run the first reestimation of the monophones at step6, without receiving error. Now in hmm1 I have the hmmdefs and macro. But the hmm1/hmmdefs is totally identical to what I have in hmm0/hmmdefs!

By marlena - 11/28/2013 Hi!

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

By Abdou - 11/27/2012 - 3 Replies 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 - 2 Replies hello

By Gerald - 5/10/2011 - 6 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 - 2 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 - 2 Replies hello every body,

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

By Mathspeedy(Boutch) - 1/4/2010 - 12 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