I've gone through Hidden Markov models (HMM) for the past few months. However there are a few things that are confusing.

The set up is simple: I have to model some human gestures such as walking, jumping, and falling. The observed data have been obtained via an accelerometer while the person was doing the movements.

I trained theses observations using the famous Baum-Welch algorithm to get the parameters of an HMM for some states. Further, using the Forward and Backward procedures, the likelihood of the observation sequences given the model (i.e., the parameters) were found.

Using a model selection criteria such as Akaike information criterion (AIC), I got the optimum states that represented the data:

a)Walking: 2 states
b)jumping: 2 states
c)Falling: 4 states

All these HMMs are then stored in a directory.

Lastly, Viterbi decoding is used to get the most likely sequence of hidden states that produced the data.

My questions are:

  1. Suppose I performed the experiment again and I just get the data without knowing what kind of movement has been done. After getting the data trained, I got 2 states. How will the machine differentiate which kind of movement has been done, especially if walking and jumping are represented by 2 states?

  2. Suppose the person has performed a different kind of gesture, e.g., sliding, what is the expected output after training? Will the machine be able to detect that or generate a false negative result?

  • $\begingroup$ I am a little confused by the question. How many distinct models do you have? Three? In any event, there is no general answer to your point 2. HMMs can only output a sequence of existing states, so it all depends on which emissions would be closer to 'sliding' in your training sample. $\endgroup$
    – gui11aume
    Jun 8, 2013 at 18:28
  • $\begingroup$ There are three models namely walking, jumping and falling. $\endgroup$
    – JebSam
    Jun 8, 2013 at 19:05
  • $\begingroup$ There are three models namely walking, jumping and falling. In my 1st question, I got two states after training the data. How is it going to know what model generated these data? And thanks for the answer for the second part. $\endgroup$
    – JebSam
    Jun 8, 2013 at 19:23

1 Answer 1


Let us start with the second part because it is easy. An trained HMM cannot output an unknown state. For instance if you train a speech recognition algorithm for Danish sounds and you play the sound of a car accident, the model will output a Danish sound.

Regarding the first part, you can run your 3 HMMs and return the log-likelihood. You can then pick the one that has the highest log-likelihood, or use BIC or AIC to choose which model is more appropriate.

I have to add that this is not a standard way of using HMMs. In general, you build a single HMM in which the states correspond to the inference you want to make. This means that you would have a single model with 3 states (walk, jump, fall), or more if each corresponds to a succession of typical moves. In my opinion, your best option is to build a model with 8 parameters, but you still have to estimate the transitions between walk, jump and fall. This way you will be able to decompose a long sequence of measurements in discrete segments where the person is walking, jumping or falling.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.