Ask Your Question
1

Multiple SVM for Face Recognition

asked 2014-10-14 06:22:12 -0500

annarose gravatar image

Now I am using multiple SVM with SURF features for face recognition. For example I have 3 types of images and each type I called as class1,calss2 and class3. So I build SVM1 as combination of class1 and class2 where class1 images are labeled as +1 and class2 images labeled as -1 like that SVM2 is the combination of class2 and class3 where class2 images are labeled as +1 and class3 images labeled as -1 and SVM3 is the combination of class3 and class1 where class3 images are labeled as +1 and class1 images labeled as -1. So at the time of prediction if the given image is in any of the class then that particular SVM return +1 and I concluded that image s "known", if all SVM return -1 then it is "Unknown". But now my problem is, if the given image is not in the training set then also SVM return +1 and identified as known one.Actually it get drops my system accuracy level. Is there any problem in my approach? why I got false results? Please help me.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2014-10-14 07:20:25 -0500

berak gravatar image

updated 2014-10-14 13:49:42 -0500

imho, the problem with your current approach is, that SVM1 does not know person 3 as a negative, though it should.

try to train SVM1 with features from class1 as positives, and features from all other classes as negatives. (all labeled -1 , irrespective of their real id, here they are just 'the negatives')

last but not least, if your features are long enough, consider using one multi-class svm, too (instead of your current multi-svm-one-class-versus-all approach).

edit flag offensive delete link more

Comments

In my system, I want to show known faces are "known" otherwise it is "Unknown". I don't know whether it is possible by using one multi-class svm. That's why am using multiple svm.

annarose gravatar imageannarose ( 2014-10-14 22:33:55 -0500 )edit

Using multiclass svm is simple, just train it using more classes and more labels (1, 2, 3, ...). By the way, you need to have a negative class too (so just put some faces that are not known there). Test it, see what you'll get.

thdrksdfthmn gravatar imagethdrksdfthmn ( 2014-10-15 03:17:07 -0500 )edit

ok..but what labels are given for negative images? because +ve images are labeled as 1,2,3...

annarose gravatar imageannarose ( 2014-10-15 03:57:40 -0500 )edit
1

0 or 4 would do

berak gravatar imageberak ( 2014-10-15 04:06:49 -0500 )edit

If we move away from camera it shows some false prediction. But if we close to camera it give correct predictions. So it Is the problem of my training sets or it is not possible to grab some sort of distance using svm?

annarose gravatar imageannarose ( 2014-10-15 04:58:58 -0500 )edit

what are you using for 'features' here ?

berak gravatar imageberak ( 2014-10-15 05:02:24 -0500 )edit

SURF features..

annarose gravatar imageannarose ( 2014-10-15 05:46:13 -0500 )edit

Is it possible to achieve some sort of distance using SURF features?

arya gravatar imagearya ( 2014-11-04 04:21:06 -0500 )edit

@arya, sure. but since one image will deliver 20 surf features, and another 31, you'd need some clustering, like BOW to achieve same count for all images. then use the BOW vocabulary with the multi-class svm

berak gravatar imageberak ( 2014-11-04 04:26:03 -0500 )edit

@berak How to use bow with SVM? The vocabulary contains the same number of descriptors and/or features for each image?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2014-11-04 07:24:35 -0500 )edit
1

answered 2014-10-14 06:45:56 -0500

thdrksdfthmn gravatar image

Maybe the SVM says that the face is more similar to class X then to class Y, and that is why you are getting +1. Because you have 2 classes, you can just try to use the decision function result, and just take in consideration the distances. You can just say that a face is in class X if the distance is greater than 1 (or less than -1, depending on the training, where the distance is positive and where is negative).

For having the distance as result just do mySVM.predic(image.reshape(1, 1), true);

edit flag offensive delete link more

Comments

Is it possible to grab some sort of distance to the decision plane using opencv-svm?

annarose gravatar imageannarose ( 2014-10-14 23:23:01 -0500 )edit
1

The docs are saying that if the last parameter of predict is set to true, then you will have the decision function value (the distance to the separating line)

thdrksdfthmn gravatar imagethdrksdfthmn ( 2014-10-15 03:14:55 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2014-10-14 06:22:12 -0500

Seen: 390 times

Last updated: Oct 14 '14