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

Click the 'Add' link to add a comment to this page; click the 'Read More' link to view replies to a posted comment.

AddSearch

6510 error
By Milos - 3/5/2010 - 1 Replies

I have the same problem:

HTK Configuration Parameters[10]
  Module/Tool     Parameter                  Value
#                 NUMCEPS                       12
#                 CEPLIFTER                     22
#                 NUMCHANS                      26
#                 PREEMCOEF               0.970000
#                 USEHAMMING                  TRUE
#                 WINDOWSIZE         250000.000000
#                 SAVEWITHCRC                 TRUE
#                 SAVECOMPRESSED              TRUE
#                 TARGETRATE         100000.000000
#                 TARGETKIND          MFCC_0_D_N_Z

HERest  ML Updating: Transitions Means Variances

 System is PLAIN
43 Logical/43 Physical Models Loaded, VecSize=25
2 MMF input files
Pruning-On[250.0 150.0 1000.0]
 Processing Data: sample1.mfc; Label sample1.lab
  ERROR [+6510]  LOpen: Unable to open label file phones0.mlf/sample1.lab
 FATAL ERROR - Terminating program HERest

can you help me please?

 

Milo

error with HERest need help
By LAROUI Ahmed Ridha - 3/5/2010 - 1 Replies

hello every body,

actually i am new to htk and i am using this sotware to implement my final year project.....

I have followed all the steps up to creating monophine hmms where the probem occured.

I tried to do the re-estimation by typing the following command

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

I get the error

7060: physical name expected at the 0'th hmm...

please anyone can suggest to me what to do???

I will be really thankfulll...

 

ERROR [+6550] LoadHTKList: Label Name Expected FATAL ERROR
By SomeoneWhoNeedsUrgentHelp! - 1/26/2010 - 1 Replies

Hi!, well the title says it all,

When I run

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

I get

ERROR [+6550] LoadHTKList: Label Name Expected FATAL ERROR

Can somebody help me, because I need to finish my project for the 4th of February.Yell

HERest error [+7036][+7060][+2321]
By Mathspeedy(Boutch) - 1/4/2010 - 7 Replies

Hi!, i'm having a theses errors when trying the following:

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


Can somebody help me,

thanks in advance!Innocent

error [+6210]
By puphe_88 - 11/28/2009 - 3 Replies

i'm running htk in windows and i've a problem in HCompv

my command is

HcompV -C setting/conf2.cfg -f 0.01 -m -S data/train/train.scp -M hmm/hmm0 hmm/proto/proto

error [+6210] openwave input : cannot open waveform file data/train/mfcc/bela.mfc

 

conf2.cfg same as config but in targetkind i'm using MFCC_0_D_A

proto and train.scp are similar that you used


contents of train that i use is

data/train/mfcc/bela.mfc
data/train/mfcc/kado.mfc

 

can you help me?

 

Incompatible sample kind
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

ERROR [+5013] ReadString: String too long
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

 

while I am trying to run HERest its throwing me  ERROR [+5013] ReadString: String too long..............how to do about it

plz guide me on this

Error [+7321] CreateInsts: Unknown label sil
By RedCisc - 6/28/2009 - 2 Replies

Hi,

I'm in Step 6 Re-estimating.

I entered the command line 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

After some processing and ML Updating of 42 logical and physical models, 2 MMF input files and pruning, I get the message Processing data: sample1.mfc; Label sample1.lab

Error [+7321] CreateInsts: Unknown label sil

What say ye?

herest
By lyes - 5/24/2009 - 1 Replies

Hi ken,

In fact the problem of UBM is very simple. We have just to model all speakers with one set of GMM (one state of HMM). So my question is : I have one wav file and I'd like to train it. First, I had extract MFCC features then I used HCompV to initialize my model then I'm trying to obtain my HMM model by HERest as :

HERest -C config/config_train_mfcc -I label/label_EE4H_noSP.mlf -t 250.0 150.0 1000.0 -S list/listTrainFulPath.scp -H hmmsTrained/hmm0/macros -H hmmsTrained/hmm0/models -M hmmsTrained/hmm1 lib/wordList_noSP

where "listTrainFulPath.scp" contain "C:\htk-3.3\bd/train_f_1_1.mfcc"

my problem is what should I write in "label_EE4H_noSP.mlf" and "lib/wordList_noSP".

Can you help me in this case. Thanks

training GMM
By lyes - 5/19/2009 - 3 Replies

Hi,

I have a large wav file (about 1 hour of speak), to train it, I have extract MFCC parameters then I used HCompV to the iinitialization. I would like to use HERest (10 times or iterations) to obtain the so called UBM. can I do it without phone.mlf file because I dont see how to use it in my case.

Thanks a lot

flat start
By hamid - 4/11/2009 - 3 Replies

Hi,

In this tutorial we use the flat start scheme for HMM initialization and parameter estimation. What's the difference if we had a labeled training data for example TIMIT database. In this case we need phones0.mlf or phones1.mlf ?


Best Regards,

Hamid.

Need some help - ERROR [+5021] GetChkedInt
By joshua - 4/3/2009 - 7 Replies

I have got a different

  • proto
  • vFloors
  • Hence a different hmmdefs file.

    Does that contribute to my error below? 

     

    $ 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

    ERROR [+5021] GetChkedInt: Integer Arg Required for 1 option

    FATAL ERROR - Terminating program C:\cygwin\HTK\htk-3.3-windows-binary\htk\HERest.exe

     

    Thanks

     

    InitSource:cannot fond source file b
    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...

     

    More info on Feature Parameters
    By kmaclean - 9/23/2008

    The Julius 3.2 book  section 7. Feature parameter files (-input mfcfile) says:

    Feature Parameter Types
    It is necessary that the feature parameter format matches the original HMM training data feature format. However if all the necessary parameters for the HMM are held within the given feature parameter file,Julius will then automatically extract the appropriate parameters for recognition.

    For example
    If the parameter format below is used for training
          MFCC_E_D_N_Z = MFCC(12)+ ?MFCC(12)+ ?Pow(1) (CMN)                   25-dimension
    Then for recognition you can also use feature parameter files other then MFCC_E_D_N_Z, such as
          MFCC_E_D_Z        = MFCC(12)+Pow(1)+?MFCC(12)+ ?Pow(1)
                                                               (CMN) 26-dimension
                                                                                                            or
         MFCC_E_D_A_Z = MFCC(12)+Pow(1)+ ?MFCC(12)+ ?Pow(1)
                         + ??MFCC(12) + ??Pow(1) (CMN)             39-dimension
    The parameter file needs to contain all of the parameters used for the original training of the HMM model,
    extra data contained with in the file will not be used.

    where (from the HTK book):

    _E has energy

    _N absolute energy suppressed

    _D has delta coe?cients

    _A has acceleration coe?cients

    _C is compressed

    _Z has zero mean static coef.

    _K has CRC checksum

    _O has 0’th cepstral coef

    Error +6510
    By dave - 11/13/2008 - 2 Replies

     

    Hello,

    I follow the Tutorial step by step

    but by running the command:

    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 monophones0I

    I get the Error:

    HTK Configuration Parameters[10]
      Module/Tool     Parameter                  Value
    #                 NUMCEPS                       12
    #                 CEPLIFTER                     22
    #                 NUMCHANS                      26
    #                 PREEMCOEF               0.970000
    #                 USEHAMMING                  TRUE
    #                 WINDOWSIZE         250000.000000
    #                 SAVEWITHCRC                 TRUE
    #                 SAVECOMPRESSED              TRUE
    #                 TARGETRATE         100000.000000
    #                 TARGETKIND          MFCC_0_D_N_Z

    HERest  ML Updating: Transitions Means Variances

     System is PLAIN
    29 Logical/29 Physical Models Loaded, VecSize=25
    2 MMF input files
    Pruning-On[250.0 150.0 1000.0]
     Processing Data: Sample1.mfc; Label Sample1.lab
      ERROR [+6510]  LOpen: Unable to open label file ../train_mfc/Sample1.lab
     FATAL ERROR - Terminating program HERest

     

    I have build the phone0.mlf and the word.mlf file.

    What i also don't understand is why he search in the folder /train_mfc/

    there are my mfc files.

    I hope someone can help me.

     

    Thanks

    Dave

     

    untitled
    By Alan - 10/5/2008 - 1 Replies

    I had problem with

    ERROR [+6510]  LOpen: Unable to open label file

    I followd through the tutorial and also going through the htk book, but no where during the tutorial has it created any .lab files :S (wasnt it suppose to create mfc at HLEd step?) i tried reading the link u gave to another person with the same question, but i dnt get it, i did the HLEd step corret with .mfc files made and the path correct, but now its just telling me i cannot open label files which was never mentioned b4 :S

     

    so lost...

    problem with the HERest
    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


    Step 6 - Unknown label error
    By crystal - 1/17/2008 - 3 Replies Hi i run the above command

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

    But i got an error shows:

    Pruning-On[250.0 150.0 1000.0] 
    ERROR [+7321]  CreateInsts: Unknown label YOU

    Can anyone help me??thanks 

    Error on step 6
    By Bharat - 6/30/2007 - 1 Replies

    $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

     

     

    i ran the above command but got the following error

     

     5010 cant open  the source file -S

     

     

    plz help me regarding this