DISCRETE HIDDEN MARKOV MODEL IMPLEMENTATION DIGITAL SPEECH PROCESSING HOMEWORK #1 DISCRETE HIDDEN MARKOV MODEL IMPLEMENTATION Date: Oct, 22 2014 Revised.

Slides:



Advertisements
Similar presentations
Pattern Finding and Pattern Discovery in Time Series
Advertisements

Lecture 16 Hidden Markov Models. HMM Until now we only considered IID data. Some data are of sequential nature, i.e. have correlations have time. Example:
Angelo Dalli Department of Intelligent Computing Systems
1 Hidden Markov Model Xiaole Shirley Liu STAT115, STAT215, BIO298, BIST520.
Hidden Markov Model 主講人:虞台文 大同大學資工所 智慧型多媒體研究室. Contents Introduction – Markov Chain – Hidden Markov Model (HMM) Formal Definition of HMM & Problems Estimate.
Hidden Markov Models. A Hidden Markov Model consists of 1.A sequence of states {X t |t  T } = {X 1, X 2,..., X T }, and 2.A sequence of observations.
Introduction to Hidden Markov Models
Page 1 Hidden Markov Models for Automatic Speech Recognition Dr. Mike Johnson Marquette University, EECE Dept.
Statistical NLP: Lecture 11
Ch-9: Markov Models Prepared by Qaiser Abbas ( )
Hidden Markov Models Theory By Johan Walters (SR 2003)
1 Hidden Markov Models (HMMs) Probabilistic Automata Ubiquitous in Speech/Speaker Recognition/Verification Suitable for modelling phenomena which are dynamic.
Hidden Markov Model based 2D Shape Classification Ninad Thakoor 1 and Jean Gao 2 1 Electrical Engineering, University of Texas at Arlington, TX-76013,
Lecture 15 Hidden Markov Models Dr. Jianjun Hu mleg.cse.sc.edu/edu/csce833 CSCE833 Machine Learning University of South Carolina Department of Computer.
Apaydin slides with a several modifications and additions by Christoph Eick.
INTRODUCTION TO Machine Learning 3rd Edition
ETHEM ALPAYDIN © The MIT Press, Lecture Slides for.
HMM-BASED PATTERN DETECTION. Outline  Markov Process  Hidden Markov Models Elements Basic Problems Evaluation Optimization Training Implementation 2-D.
Hidden Markov Models I Biology 162 Computational Genetics Todd Vision 14 Sep 2004.
Hidden Markov Models. Hidden Markov Model In some Markov processes, we may not be able to observe the states directly.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
Hidden Markov Models K 1 … 2. Outline Hidden Markov Models – Formalism The Three Basic Problems of HMMs Solutions Applications of HMMs for Automatic Speech.
1 Hidden Markov Model Instructor : Saeed Shiry  CHAPTER 13 ETHEM ALPAYDIN © The MIT Press, 2004.
Learning HMM parameters Sushmita Roy BMI/CS 576 Oct 21 st, 2014.
INTRODUCTION TO Machine Learning ETHEM ALPAYDIN © The MIT Press, Lecture Slides for.
Visual Recognition Tutorial1 Markov models Hidden Markov models Forward/Backward algorithm Viterbi algorithm Baum-Welch estimation algorithm Hidden.
ETHEM ALPAYDIN © The MIT Press, Lecture Slides for.
Ch10 HMM Model 10.1 Discrete-Time Markov Process 10.2 Hidden Markov Models 10.3 The three Basic Problems for HMMS and the solutions 10.4 Types of HMMS.
Gaussian Mixture Model and the EM algorithm in Speech Recognition
CS344 : Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 21- Forward Probabilities and Robotic Action Sequences.
THE HIDDEN MARKOV MODEL (HMM)
1 CSE 552/652 Hidden Markov Models for Speech Recognition Spring, 2006 Oregon Health & Science University OGI School of Science & Engineering John-Paul.
7-Speech Recognition Speech Recognition Concepts
Fundamentals of Hidden Markov Model Mehmet Yunus Dönmez.
1 HMM - Part 2 Review of the last lecture The EM algorithm Continuous density HMM.
1 CS 552/652 Speech Recognition with Hidden Markov Models Winter 2011 Oregon Health & Science University Center for Spoken Language Understanding John-Paul.
Hidden Markov Models Usman Roshan CS 675 Machine Learning.
Cognitive Computer Vision Kingsley Sage and Hilary Buxton Prepared under ECVision Specific Action 8-3
Hidden Markov Models in Keystroke Dynamics Md Liakat Ali, John V. Monaco, and Charles C. Tappert Seidenberg School of CSIS, Pace University, White Plains,
ECE 8443 – Pattern Recognition ECE 8423 – Adaptive Signal Processing Objectives: ML and Simple Regression Bias of the ML Estimate Variance of the ML Estimate.
ECE 8443 – Pattern Recognition ECE 8527 – Introduction to Machine Learning and Pattern Recognition Objectives: Reestimation Equations Continuous Distributions.
ECE 8443 – Pattern Recognition ECE 8527 – Introduction to Machine Learning and Pattern Recognition Objectives: Reestimation Equations Continuous Distributions.
Hidden Markov Models: Decoding & Training Natural Language Processing CMSC April 24, 2003.
1 CSE 552/652 Hidden Markov Models for Speech Recognition Spring, 2005 Oregon Health & Science University OGI School of Science & Engineering John-Paul.
1 CS 552/652 Speech Recognition with Hidden Markov Models Winter 2011 Oregon Health & Science University Center for Spoken Language Understanding John-Paul.
1 CSE 552/652 Hidden Markov Models for Speech Recognition Spring, 2006 Oregon Health & Science University OGI School of Science & Engineering John-Paul.
1 Hidden Markov Model Observation : O1,O2,... States in time : q1, q2,... All states : s1, s2,... Si Sj.
ECE 8443 – Pattern Recognition ECE 8527 – Introduction to Machine Learning and Pattern Recognition Objectives: Elements of a Discrete Model Evaluation.
Hidden Markov Models (HMMs) –probabilistic models for learning patterns in sequences (e.g. DNA, speech, weather, cards...) (2 nd order model)
1 Hidden Markov Models Hsin-min Wang References: 1.L. R. Rabiner and B. H. Juang, (1993) Fundamentals of Speech Recognition, Chapter.
Statistical Models for Automatic Speech Recognition Lukáš Burget.
1 Hidden Markov Model Observation : O1,O2,... States in time : q1, q2,... All states : s1, s2,..., sN Si Sj.
EEL 6586: AUTOMATIC SPEECH PROCESSING Hidden Markov Model Lecture Mark D. Skowronski Computational Neuro-Engineering Lab University of Florida March 31,
Automated Speach Recognotion Automated Speach Recognition By: Amichai Painsky.
ECE 8443 – Pattern Recognition ECE 8527 – Introduction to Machine Learning and Pattern Recognition Objectives: Reestimation Equations Continuous Distributions.
Hidden Markov Model Parameter Estimation BMI/CS 576 Colin Dewey Fall 2015.
Hidden Markov Models. A Hidden Markov Model consists of 1.A sequence of states {X t |t  T } = {X 1, X 2,..., X T }, and 2.A sequence of observations.
Definition of the Hidden Markov Model A Seminar Speech Recognition presentation A Seminar Speech Recognition presentation October 24 th 2002 Pieter Bas.
Other Models for Time Series. The Hidden Markov Model (HMM)
Visual Recognition Tutorial1 Markov models Hidden Markov models Forward/Backward algorithm Viterbi algorithm Baum-Welch estimation algorithm Hidden.
1 Hidden Markov Model Xiaole Shirley Liu STAT115, STAT215.
MACHINE LEARNING 16. HMM. Introduction Lecture Notes for E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1) 2  Modeling dependencies.
Learning, Uncertainty, and Information: Learning Parameters
Date: October, Revised by 李致緯
EEL 6586: AUTOMATIC SPEECH PROCESSING Hidden Markov Model Lecture
Hidden Markov Models Part 2: Algorithms
4.0 More about Hidden Markov Models
LECTURE 15: REESTIMATION, EM AND MIXTURES
Introduction to HMM (cont)
Hidden Markov Models By Manish Shrivastava.
Presentation transcript:

DISCRETE HIDDEN MARKOV MODEL IMPLEMENTATION DIGITAL SPEECH PROCESSING HOMEWORK #1 DISCRETE HIDDEN MARKOV MODEL IMPLEMENTATION Date: Oct, Revised by 廖宜修

Outline  HMM in Speech Recognition  Problems of HMM ◦ Training ◦ Testing  File Format  Submit Requirement 2

HMM IN SPEECH RECOGNITION 3

Speech Recognition In acoustic model, each word consists of syllables each syllable consists of phonemes each phoneme consists of some (hypothetical) states. “ 青色 ” → “ 青 ( ㄑㄧㄥ ) 色 ( ㄙㄜ、 )” → ” ㄑ ” → {s 1, s 2, …} Each phoneme can be described by a HMM (acoustic model). Each time frame, with an observance (MFCC vector) mapped to a state. 4

Speech Recognition Hence, there are state transition probabilities ( a ij ) and observation distribution ( b j [ o t ] ) in each phoneme acoustic model. Usually in speech recognition we restrict the HMM to be a left-to-right model, and the observation distribution are assumed to be a continuous Gaussian mixture model. 5

Review left-to-right observation distribution are a continuous Gaussian mixture model 6

General Discrete HMM a ij = P ( q t+1 = j | q t = i )  t, i, j. b j ( A ) = P ( o t = A | q t = j )  t, A, j. Given q t, the probability distributions of q t+1 and o t are completely determined. (independent of other states or observation) 7

HW1 v.s. Speech Recognition Homework #1Speech Recognition set 5 ModelsInitial-Final model_01~05 “ㄑ”“ㄑ” {ot }{ot }A, B, C, D, E, F39dim MFCC unitan alphabeta time frame observation sequencevoice wave 8

Homework Of HMM 9

Flowchart 10 seq_model_ 01~05.tx t testing_data.txt model_01.txt model_init.txt model_05.txt train test testing_answer.txt CER

Problems of HMM Training Basic Problem 3 in Lecture 4.0 Give O and an initial model = (A, B,  ), adjust to maximize P(O| )  i = P( q 1 = i ), A ij = a ij, B jt = b j [o t ] Baum-Welch algorithm Testing Basic Problem 2 in Lecture 4.0 Given model and O, find the best state sequences to maximize P(O|, q). Viterbi algorithm 11

Training  Basic Problem 3: ◦ Give O and an initial model = (A, B,  ), adjust to maximize P(O| )  i = P( q 1 = i ), A ij = a ij, B jt = b j [o t ]  Baum-Welch algorithm  A generalized expectation-maximization (EM) algorithm. 1. Calculate α (forward probabilities) and β (backward probabilities) by the observations. 2. Find ε and γ from α and β 3. Recalculate parameters ’ = ( A’,B’,  ’ ) 12

Forward Procedure 13 Forward Algorithm αt(i)αt(i) α t+1 (j) j i t+1 t

Forward Procedure by matrix Calculate β by backward procedure is similar. 14

Calculate γ 15 N * T matrix

The probability of transition from state i to state j given observation and model. Totally (T-1) N*N matrices. Calculate ε 16

Accumulate ε and γ 17

Re-estimate Model Parameters 18 ’ = ( A’,B’,  ’ ) Accumulate ε and γ through all samples!! Not just all observations in one sample!!

Testing Basic Problem 2: Given model and O, find the best state sequences to maximize P(O|, q). Calculate P(O| ) ≒ max P(O|, q) for each of the five models. The model with the highest probability for the most probable path usually also has the highest probability for all possible paths. 19

Viterbi Algorithm 20

Flowchart 21 seq_model_ 01~05.tx t testing_data.txt model_01.txt model_init.txt model_05.txt train test testing_answer.txt CER

FILE FORMAT 22

C or C++ snapshot 23

Input and Output of your programs  Training algorithm ◦ input  number of iterations  initial model (model_init.txt)  observed sequences (seq_model_01~05.txt) ◦ output  =( A, B,  ) for 5 trained models 5 files of parameters for 5 models (model_01~05.txt)  Testing algorithm ◦ input  trained models in the previous step  modellist.txt (file saving model name)  Observed sequences (testing_data1.txt & testing_data2.txt) ◦ output  best answer labels and P(O| ) (result1.txt & result2.txt)  Accuracy for result1.txt v.s. testing_answer.txt 24

Program Format Example 25./train iteration model_init.txt seq_model_01.txt model_01.txt./test modellist.txt testing_data.txt result.txt

Input Files +- dsp_hw1/ +- c_cpp/ | modellist.txt//the list of models to be trained +- model_init.txt//HMM initial models +- seq_model_01~05.txt//training data observation +- testing_data1.txt//testing data observation +- testing_answer.txt//answer for “testing_data1.txt” +- testing_data2.txt//testing data without answer 26

Observation Sequence Format ACCDDDDFFCCCCBCFFFCCCCCEDADCCAEFCCCACDDFFCCDDFFCCD CABACCAFCCFFCCCDFFCCCCCDFFCDDDDFCDDCCFCCCEFFCCCCBC ABACCCDDCCCDDDDFBCCCCCDDAACFBCCBCCCCCCCFFFCCCCCDBF AAABBBCCFFBDCDDFFACDCDFCDDFFFFFCDFFFCCCDCFFFFCCCCD AACCDCCCCCCCDCEDCBFFFCDCDCDAFBCDCFFCCDCCCEACDBAFFF CBCCCCDCFFCCCFFFFFBCCACCDCFCBCDDDCDCCDDBAADCCBFFCC CABCAFFFCCADCDCDDFCDFFCDDFFFCCCDDFCACCCCDCDFFCCAFF BAFFFFFFFCCCCDDDFFCCACACCCDDDFFFCBDDCBEADDCCDDACCF BACFFCCACEDCFCCEFCCCFCBDDDDFFFCCDDDFCCCDCCCADFCCBB …… 27 seq_model_01~05.txt / testing_data1.txt

Model Format model parameters. (model_init.txt /model_01~05.txt ) 28 initial: transition: observation: Prob( q 1 =3|HM M) = Prob(q t+1 =4|q t =2, HMM) = ABCDEFABCDEF Prob(o t =B|q t =3, HMM) =

Model List Format Model list: modellist.txt testing_answer.txt 29 model_01.txt model_02.txt model_03.txt model_04.txt model_05.txt model_01.txt model_05.txt model_01.txt model_02.txt model_04.txt model_03.txt model_05.txt model_04.txt …….

Testing Output Format result.txt Hypothesis model and it likelihood acc.txt Calculate the classification accuracy. ex Only the highest accuracy!!! Only number!!! 30 model_01.txt e-40 model_05.txt e-34 model_03.txt e-41 …….

Submit Requirement  Upload to CEIBA  Your program ◦ train.c, test.c, Makefile  Your 5 Models After Training ◦ model_01~05.txt  Testing result and and accuracy ◦ result1~2.txt (for testing_data1~2.txt) ◦ acc.txt (for testing_data1.txt)  Document (pdf) ( No more than 2 pages ) ◦ Name, student ID, summary of your results ◦ Specify your environment and how to execute. 31

Submit Requirement Compress your hw1 into “hw1_[ 學號 ].zip” +- hw1_[ 學號 ]/ +- train.c /.cpp +- test.c /.cpp +- Makefile +- model_01~05.txt +- result1~2.txt +- acc.txt +- Document.pdf (pdf ) 32

Grading Policy Accuracy 30% Program 35% Makefile 5% (do not execute program in Makefile) Command line 10% (train & test) (see page. 26) Report 10% Environment + how to execute. 10% File Format 25% zip & fold name 10% result1~2.txt 5% model_01~05.txt 5% acc.txt 5% Bonus 5% Impressive analysis in report. 33

Do Not Cheat! Any form of cheating, lying, or plagiarism will not be tolerated! W e will compare your code with others. (including students who has enrolled this course) 34

Contact TA 廖宜修 Office Hour: Wednesday 13:00~14:00 電二 531 Please let me know you‘re coming by , thanks! 35