Reputation: 1219
I am using CvSVM to classify only two types of facial expression. I used LBP(Local Binary Pattern) based histogram to extract features from the images, and trained using cvSVM::train(data_mat,labels_mat,Mat(),Mat(),params)
, where,
data_mat is of size 200x3452, containing normalized(0-1) feature histogram of 200 samples in row major form, with 3452 features each(depends on number of neighbourhood points)
labels_mat is corresponding label matrix containing only two value 0 and 1. The parameters are:
CvSVMParams params;
params.svm_type =CvSVM::C_SVC;
params.kernel_type =CvSVM::LINEAR;
params.C =0.01;
params.term_crit=cvTermCriteria(CV_TERMCRIT_ITER,(int)1e7,1e-7);
The problem is that:-
while testing I get very bad result (around 10%-30% accuracy), even after applying with different kernel and train_auto() function.
CvSVM::predict(test_data_mat,true)
gives 'NaN' output
How to resolve this?
Upvotes: 4
Views: 766
Reputation: 305
The SVM generalization power is low.In the first reduce your data dimension by principal component analysis then change your SVM kerenl type to RBF.
Upvotes: 1
Reputation: 10850
I suppose, that your classes linearly hard/non-separable in feature space you use. May be it will be better to apply PCA to your dataset before classifier training step and estimate effective dimensionality of this problem. Also I think it will be userful test your dataset with other classifiers. You can adapt for this purpose standard opencv example points_classifier.cpp. It includes a lot of different classifiers with similar interface you can play with.
Upvotes: 1