Ask Your Question
1

Multiple SVM for Face Recognition

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

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

berak gravatar image

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

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 -0600 )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 -0600 )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 -0600 )edit
1

0 or 4 would do

berak gravatar imageberak ( 2014-10-15 04:06:49 -0600 )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 -0600 )edit

what are you using for 'features' here ?

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

SURF features..

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

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

arya gravatar imagearya ( 2014-11-04 04:21:06 -0600 )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 -0600 )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 -0600 )edit

But in my case when a person nearer to camera it identify as known but when distance increases the same person identify as unknown. Could you tell me why?

arya gravatar imagearya ( 2014-11-04 22:15:24 -0600 )edit

Yes. You have used too many features for recognition, so if the person is too far, the features found in the face area are not enough to realise the recognition; so the person is unknown. But be careful, there is another problem: too few features lead to confusions.

thdrksdfthmn gravatar imagethdrksdfthmn ( 2014-11-05 02:24:57 -0600 )edit

So what I do to overcome this? Do you have any suggestions or solution?

arya gravatar imagearya ( 2014-11-05 03:34:11 -0600 )edit

Set a minimum size of the face that will be recognized. And I think that someone who has done this can help you with some values. Otherwise you can test it yourself and detect the values.

thdrksdfthmn gravatar imagethdrksdfthmn ( 2014-11-05 07:01:07 -0600 )edit

I already set this minimum face size and maximum face size. double min_face_size=30; double max_face_size=400; these values are used at the time of detection. But I don't know where I set minimum face size at the time of recognition.

arya gravatar imagearya ( 2014-11-05 22:26:01 -0600 )edit

The detection is used as input of recognition, am I right? Then the minimum detection size should be larger. Just make some tests on some faces of different sizes (30, 40, 50, ...) and search for features in it. See how many are, compare with the number of features used for recognition. More: you can also match, for seeing how many features are not taken in consideration for recognition.

thdrksdfthmn gravatar imagethdrksdfthmn ( 2014-11-06 02:58:34 -0600 )edit

ok.Thank you for your reply..

arya gravatar imagearya ( 2014-11-06 05:19:49 -0600 )edit
1

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

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 -0600 )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 -0600 )edit

Question Tools

Stats

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

Seen: 582 times

Last updated: Oct 14 '14