views:

146

answers:

2

Hi I have an application which decides whether a human is handwaving,running or walking. The idea is i have segmented an action,say handwave,to its poses. Let's say

Example;

for human1:pose7-pose3-pose7-..... represents handwave
for human3:pose1-pose7-pose1-..... represents handwave
for human7:pose1-pose1-pose7-..... represents handwave
for human20:pose3-pose7-pose7-..... represents handwave

for human1 pose11-pose33-pose77-..... represents walking
for human2 pose31-pose33-pose77-..... represents walking
for human3 pose11-pose77-pose77-..... represents walking
for human20 pose11-pose33-pose11-..... represents walking

and i used above vectors for training SVM and Neural Net in Matlab..

Now I test with it test images. Again I have segmented poses for test images.

For the vector sizes of test and train sets in MATLAB; SVM and Neural Net requires same vector sizes. To make it work;
If I append 0 (assume it like pose0-which is an invalid pose) , to make sizes equal I have really good performance.
If I copy initial poses at the beginning and append them to the end until sizes are equal performance decreases.

For example;

train set: pose1-pose2-pose4-pose7-pose2-pose4-pose7
(1st method)test set: pose3-pose1-pose4-0-0-0-0 or
(2nd method)test set: pose3-pose1-pose4-pose3-pose1-pose4-pose3

I would expect to have better classification with 2nd method since appended values are actual values for poses. But pose0 is not a real pose.

Do you have any ideas ? Regards

+2  A: 

I don't think that its unreasonable to get better performance from your first method. I assume that you mean better performance as in better classification. The reason for this I presume would be that the handwaving sequences are normally shorter. Thus, when you fill with "invalid" poses you make it a lot easier to distinguish the different actions by means of whether they include invalid poses than what actual poses they include.

villintehaspam
HiYou right "better performance means , better classification"I would expect to have better performance when padding with natural poses of particular action type.But padding an invalid pose birngs up better performance.still weird for me.
tguclu
+2  A: 

In your case, your data consists of a collection of instances each with a number of features (poses slot, as in PoseSlot1,PoseSlot2,...,PoseSlotN), and the class value (hand-waving, running or walking).

Your problem is that the number of features is not the same for all classes, ie running has 7 poses while walking has 3 poses for example.

The standard way of dealing with this sort of issue is to mark these empty slots by a missing value, assuming that your machine learning algorithm can handle missing values.

f1     f2    f3    f4    f5    f6    f7    class
-------------------------------------------------
pose1,pose2,pose4,pose7,pose2,pose4,pose7,running
pose3,pose1,pose4,    ?,    ?,    ?,    ?,walking

Now, the first method you used of appending pose0 is a simplification to using ? for missing value (similar to adding a new pose to denote a missing value, instead of an explicit ? value)

The other way of repeating values actually creates a problem rather than solving one if you think about it.. you are in effect creating correlated features, and as you know, most machine learning algorithms works best on an independent set of features (usually solved by performing a feature selection as pre-processing step)

Amro
Thank you. Now another question. How do you explain the fact that some classification methods like SVM and NN requires that trainin data and test data should have same vector sizes (At least in Matlab) ?On the perpescitive of machine learning existence of such a prerequsite doesnt make sense. On a real world application I can have several different lenght of data
tguclu
Unless you are dealing with **time-series sequences**, most ML techniques expect an attribute-value type of data. Every algorithm I can think of (ANN, kNN, SVM, Bayes nets, decision trees, rules induction, regressions, ..) all have take data of tabular-like form. This make sense because each instance represents a sampled variable with d-dimensions (if you think of it from a statistical point of view). Perhaps you would want to model your data as time-series using Markov chains or HMM...
Amro
Well Thanks.I have gathered results with appending p0 and appending natural poses.Neural Networks results are almost the same except p0 appending decreases ~%2-%3. However SVM reacts totay different and success rates get higher in appending p0.For example action:Walking has %77 performance on appending repetitive poses but it has a value of %95 in appending p0.Does it make sense that two appraches behave opposite ?
tguclu
well SVM and ANN are two completely different techniques and you cant expect them to behave the same. Also as I mentioned before, what you have is basically different approaches to preprocessing the data, and there is no general formula to fit all problems. So you just do what feels more natural in your case.. BTW you might want to start accepting answers if you want people to keep responding to your questions!
Amro

related questions