theory

I have written an Svm object to use support vector machines pattern recognition. The object is an “all in one” thing with which you can record the data, learn from the training data and do live pattern recognition.

practice

stupid approach

We record movements (very simple ones). We send them to the library as training set and we start testing. The library predicts 100.0% accuracy by cross-validating the data (take all the movements, use a small part for testing and train with the rest). In practice it’s… NULL, zero, nada, niet.

Why ? Well simply because we send clean movements with a defined start and end as training data and a raw stream live. Imagine a movement is made of letters. This are the three movements we want to recognize: “A-B-C-D”, “C-D-A-A”, “C-A-B-D” and “X” is noise. During training the data looks like “a-B-C-d”, ‘A-b-C-D’ (low case letters meaning ‘variation’). But in real, it’s “X-X-a-b”, “X-a-b-C”, and (too bad, we skip a value) “b-C-D-X” ...

easy modification

To make it work better, I used the raw data and segmented it into smaller parts to feed to the training algorithm: “A-B”, “B-C”, “C-D” for example. This worked better (taking much more time to build the support vectors). But we have lots of oscillations between classes. In our example, “A-B” can be part of the first and third class, so it will not work very well.

What do we do when we have “high frequency” noise ? We use a low-pass filter. In our case, we just take the number of times a class was recognized in the last 10 iterations.

So I created the MaxCount object which (when linked with a buffer) does just that: count which label has been sent most often in the last ‘x’ iterations. It makes the software less reactive but produces less noise.

All this does not really help. What we need is :

  1. Better feature extraction
  2. Time aware recognition

From the beginning of this project I have been saying “we should use Hidden Markov Models” to the people doing some research for the pattern recognition. It now looks like it’s the only road out of hell (we should be working with the dancers in less then two weeks).

I am no starting to implement the FFT object.

PS

Just so I do not lose it, command line to launch ‘grid.py’ in X11 with python 2.5 installed:

#  /Library/Frameworks/Python.framework/Versions/Current/bin/python grid.py -gnuplot /opt/local/bin/gnuplot ../../../test/fixtures/sarah/svm/svm.train