Summary:
I am trying to classify some images according to the angles between parts of the body.
I assume that the human body consists of 10 parts (in the form of rectangles) and finds the center of each part and calculates the angle of each part with respect to the torso. And I have three categories of action: Handwave-Walking-Running. My goal is to find which test images fall into the action category.
Facts:
TrainSet: 1057x10, 1057 indicates the number of images. TestSet: 821x10
I want my output to be a 3x1 matrix, each line showing the percentage of classification for the action category. row1: Handwave row2: Walking row3: Run
Code:
actionCat='H';
[train_data_hw train_label_hw] = tugrul_traindata(TrainData,actionCat);
[test_data_hw test_label_hw] = tugrul_testdata(TestData,actionCat);
actionCat='W';
[train_data_w train_label_w] = tugrul_traindata(TrainData,actionCat);
[test_data_w test_label_w] = tugrul_testdata(TestData,actionCat);
actionCat='R';
[train_data_r train_label_r] = tugrul_traindata(TrainData,actionCat);
[test_data_r test_label_r] = tugrul_testdata(TestData,actionCat);
Train=[train_data_hw;train_data_w;train_data_r];
Test=[test_data_hw;test_data_w;test_data_r];
Target=eye(3,1);
net=newff(minmax(Train),[10 3],{'logsig' 'logsig'},'trainscg');
net.trainParam.perf='sse';
net.trainParam.epochs=50;
net.trainParam.goal=1e-5;
net=train(net,Train);
trainSize=size(Train,1);
testSize=size(Test,1);
if(trainSize > testSize)
pend=-1*ones(trainSize-testSize,size(Test,2));
Test=[Test;pend];
end
x=sim(net,Test);
:
Matlab newff. Nx10, 3x1.
3 , 10 .