1

I have been reading about HMM theory. From what i understand we need intial probability, transition probability and emission probability to coninue with HMM. The examples I saw about implementation of HMM define all these probabilities at start. But the problem is i want to recognize gestures using HMM and i haven't been able to figure out on how to define the probabilities (i.e.transition probability and emission probability matrix). I know how to use to viterbi algorithm to get the best sequence or how to get the inference using forward-backward, it is just the starting probabilities i am worried about

Can anyone guide me regarding this.

Bounty Collector
  • 615
  • 7
  • 19

2 Answers2

4

There are in fact three main algorithms for hidden markov models, and you mentioned two of the three:

  1. Forward-backward algorithm.
  2. Viterbi algorithm
  3. Baum Welch algorithm: Inferring the parameters (initial probability, transition probability, emission probability) from training data.

The Baum-Welch algorithm is basically an expectation maximization algorithm, where you start with random starting parameters, and, using the forward-backward algorithm, calculate the maximum-likelihood values for the initial parameters, and iterate. A good exposition with pseudo-code for the algorithm is presented in this lecture note. It also discusses the related problem of speech recognition, a very successful application of HMMs. Unfortunately, it does not discuss the fact that the Baum-Welch, or the other algorithms, are generally pretty hard to implement in practice, because probabilities get extremely small. So in practice, you either have to use careful scaling, use log probabilities, or use sci-kit learn's implementation of HMMs, which include all three of the main HMM algorithms.

David Ding
  • 201
  • 2
  • 3
1

Here you can check out my blog post which is a basic walk-through on how one can recognize gestures using HMM (It's from my experience gained while completing my undergraduate project). It highlights the basics of the three algorithms needed and also, how you can estimate the initial probabilities for the matrices involved eventually followed by the nature of training data and the learning algorithm. I hope it helps you get started at least.

Answering part of your question here, your estimate of the initial probabilities could vary from implementation to implementation but this largely depends on the nature of your Markov model, i.e, you would be working on one of the three types of models: Ergodic, LRB and LR. Depending on this, the initial values for your Transition, Emission and Initial Probabilites can vary. Next, in order to recognize the gesture you would need to "observe" a certain specific (or a group) of feature(s) in your captured image frames. I suggest you go through my blog post for a more detailed explanation for the same.

Darth Coder
  • 1,738
  • 7
  • 33
  • 56
  • 1
    I did read your blog and i must say crystal clear explanation :) but at the end you say that you would write about the Baum Welch Algorithm and will finish up the article.. I hope you do that soon :) Nonetheless simplest explanation of HMMs. thank you. – Bounty Collector May 30 '13 at 04:45
  • Yes I have been intending to right that article on Baum-Welch since quite a long time ;) Hopefully it shall be done in the near future. Thanks for your feedback :) – Darth Coder Jun 04 '13 at 11:52
  • Your blog appears to be down. Did you ever end up writing more on this topic? – codedude Jun 17 '15 at 01:11