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.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
Create a new file called hmmdefs in your 'voxforge/manual/hmm0' folder:
Copy
the
monophones0
file to your hmm0 folder;
rename the monophones0 file to hmmdefs;
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
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/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.
Add
•
Search
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