CvSVM.predict () gives "NaN" output and low precision

I am using CvSVM to classify only two types of facial expressions. I used LBP (Local Binary Pattern) histogram to extract features from images and trained with cvSVM::train(data_mat,labels_mat,Mat(),Mat(),params)

where

data_mat is of size 200x3452 containing a normalized (0-1) histogram of a function of 200 samples in basic string form, with 3452 functions each (depends on the number of neighborhood points)

labels_mat is the corresponding matrix of labels containing only two values ​​0 and 1. Parameters:

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: -

  • during testing, I get a very poor result (about 10% -30% accuracy) even after applying with various kernel functions and train_auto ().

  • CvSVM::predict(test_data_mat,true)

    outputs the output "NaN"

I would really appreciate any help on this, it puzzled me.

+3


source to share


2 answers


I assume your classes are linearly rigid / inseparable in the space of the objects you are using. It might be better to apply PCA to your dataset prior to the classifier training phase and estimate the effective dimension of the problem. Also I think it would be a handy test of your dataset with other classifiers. You can adapt the standard example opencv points_classifier.cpp for this purpose. It includes many different classifiers with a similar interface that you can play with.



+1


source


SVM generalization power is low. First, reduce the size of the principal component analysis data, then change the Kerenl SVM type to RBF.



+1


source







All Articles