Search code examples
classificationsensorshidden-markov-models

how to feed Hidden Markov Model (HMM) with several datastreams simultaneously?


I have built a body sensor network consisting of 8 accelerometers. At each sample (at about 30 Hz) each accelerometer gives me a X Y and Z value.

I have used the jahmm java library for classification of a datastream consisting of one accelerometer. This works fine. But now i am confused about how to extend my code so that it can be fed with more than one accelerometer.

a single datastream looks like this:

 [-4.976763 7.096352 1.3488603]; [-4.8699903 7.417777 1.3515397];...

The library allows to define the dimensionality of the feature vector. In the above stream the dimensionality is 3. I thought of raising the dimensionality to 3 x 8 = 24, and then simply concatenate all accelerometers into a single 24D feature vector.

is this the way to go or will this deteriorate my results?

EDIT:

I have collected my data by now and it looks like this (for one participant):

"GESTURE A",[{407 318 425};...{451 467 358};{427 525 445};][{440 342 456}...;{432 530 449};]
"GESTURE A",[{406 318 424};...{450 467 357};{422 525 445};][{440 342 456}...;{428 531 449};]
"GESTURE B",[{407 318 424};...{449 466 357};{423 524 445};][{440 342 456}...;{429 530 449};]
"GESTURE B",[{380 299 399};...{424 438 338};{404 500 426};][{433 337 449}...;{429 529 449};]

the values in between {... ... ...} represent one accelerometer. Per sample (at 30hz orso) i have 8 accelerometers. One sample is within [...]. Per gesture example i have about 40 blocks of [...]

Is your suggestion that I take the first sensor (the first {} of each block of []) and create a model with the resulting sequence, and the same for the second until the eighth?.

This would give me 8 models for each gesture. Than a test sequence is yields 8 probabilities. So I would need some sort of plurality voting in order to get the overlaying class. Is this what you meant?

Thank you


Solution

  • I suggest to use one HMM per accelerometer, so 8 parallel models in your case. Then you can evaluat each channel individually and put everything together to get your result. So you have to write some code around the library.

    If you want to handle everything in one HMM, you have to write your own observation type which can handle all 8 input streams, e.g. MyObservation extends Observation.