0
votes

I have to classify Hazardous Material Labels (given on the link below) among their 7 classes. http://en.wikipedia.org/wiki/Dangerous_goods#Classification_and_labeling_summary_tables

my training function look like:

svmTraining()    
{

    Mat train, response;

    createTrainingDateUsingBOW(1, train, response, 1.0);
    createTrainingDateUsingBOW(2, train, response, 2.0);
    createTrainingDateUsingBOW(3, train, response, 3.0);
    createTrainingDateUsingBOW(4, train, response, 4.0);
    createTrainingDateUsingBOW(5, train, response, 5.0);
    createTrainingDateUsingBOW(6, train, response, 6.0);
    createTrainingDateUsingBOW(7, train, response, 7.0);

    CvTermCriteria criteria = cvTermCriteria(CV_TERMCRIT_EPS, 1000, FLT_EPSILON);
    CvSVMParams svm_params = CvSVMParams (CvSVM::C_SVC, CvSVM::LINEAR, 10.0, 8.0,1.0,10.0  , 0.5 , 0.1 , NULL         , criteria);

 }

Then i am getting the result in svmPredict() which varies from 1 to 7. But the results i am getting doesn't make any sense. They always keep swicthing on between 4 and 7 most of the times. I have tried to use SVM::RBF and SVM::LINEAR kernel types. Currently, i am using around 300 samples of each class.

1

1 Answers

0
votes

This might be caused by a problem in data distributions. I would suggest training a separate SVM for classes 1 to 3, and checking if that works. If that works, you can proceed to add other classes one at a time.

Another place to check is the SVM parameters. For instance, you could try CvSVM::POLY instead of CvSVM::LINEAR.