Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hidden Markov Models with C++ [closed]

I've been looking into implementations of Hidden Markov Models in C++ lately. I was wondering If I could use any of the existing HMM libraries written in C++ out there to use with Action Recognition (with OpenCV)?

I'm tying to AVOID "re-inventing the wheel"!

Is it possible to use Torch3Vision even though(looks like) it was designed to work for speech recognition?

My idea is that, if we can convert the feature vectors into Symbols/Observations (using Vector Quantization - Kmeans clustering), we can use those symbols for decoding, inference, parameter learning (Baum–Welch algorithm). This way it would work with Torch3Vision in OpenCV.

Any help on this will be truly appreciated.

like image 337
garak Avatar asked Dec 19 '11 14:12

garak


People also ask

What are the three types of HMM hidden Markov model variants?

After reviewing the basic concept of HMMs, we introduce three types of HMM variants, namely, profile-HMMs, pair-HMMs, and context-sensitive HMMs, that have been useful in various sequence analysis problems.

What are the two assumptions of the hidden Markov models?

Under the Markov assumption and the independence assumption, an HMM only needs two set of parameters to model P(st|st−1) and P(ot|st). We call these, respectively, the transition probabilities and the emission probabilities.

What are hidden states in Markov models?

Hidden Markov Model (HMM) When we can not observe the state themselves but only the result of some probability function(observation) of the states we utilize HMM. HMM is a statistical Markov model in which the system being modeled is assumed to be a Markov process with unobserved (hidden) states.


2 Answers

You can take a look at http://www.ece.ucsb.edu/Faculty/Rabiner/ece259/Reprints/tutorial%20on%20hmm%20and%20applications.pdf for the theory behind HMMs. It's not hard to implement the algorithms yourself.

For a C-based version, you can take a look at my implementation, http://code.google.com/p/accelges/, which I've done for a Google Summer of Code project.

like image 86
Paul Borza Avatar answered Sep 22 '22 18:09

Paul Borza


There is also this implementation that I wrote several days ago. It is a class for discrete HMM using OpenCV. You may take a look here:

https://sourceforge.net/projects/cvhmm/

After quantization of your features, you can convert each feature vector to one label and use the sequence of labels to train a discrete HMM.

like image 39
Omid Sakhi Avatar answered Sep 25 '22 18:09

Omid Sakhi