Are there any additional preprocessing steps to take for gender recognition in a live camera preview?

asked 2017-09-15 01:43:25 -0600

Gensoukyou1337 gravatar image

updated 2017-09-15 01:46:48 -0600

When I trained my FisherFaceRecognizer in my PC using the GENDER-FERET database, I used dlib to align and frontalize the face, grayscaled it, and did a histogram equalization on it before putting it into the list of data to train said FisherFaceRecognizer. When I tested it with the GENDER-FERET test set with the usual way, most of the predicted genders return the correct values, around 95-98%.

But when I use the generated YAML from that into my Android app's FisherFaceRecognizer on a live camera preview, it all falls apart, with fluctuating prediction results when I aim the camera at someone's face, especially in a computer screen, and sometimes wrong prediction results altogether.

Now I think it's because the data from the camera preview cannot replicate the ideal test conditions that netted me the 95-98% accuracy, especially when I aim said camera at a face behind the computer screen. So I'm thinking of background removal and illumination standardization.

Does OpenCV4Android 2.4.13.3 or 3.3.0 have protocols for those, and what other steps can/should I take to preprocess the images from a live camera preview to nearly replicate the 95-98% accuracy?

Edit: Also, should I choose the haarcascade_frontalface_default.xmlinstead of lbpcascade_frontalface.xml for my CascadeClassifier? for face recognition? Because while the haar one may be more accurate than the lbp one, it'd tank my framerate.

edit retag flag offensive close merge delete

Comments

just to clarify: if you're using histogram equalization and pose normalization for your train images, you'dhave to do the same on your android device later for testing, right ?

berak gravatar imageberak ( 2017-09-15 02:07:17 -0600 )edit
1

Yes, and I'll probably have to use the dlib-android library for that. Though with fewer landmark points and with an emphasis on the eyes, because the lbpcascade/haarcascade might not be good enough.

Gensoukyou1337 gravatar imageGensoukyou1337 ( 2017-09-15 04:38:46 -0600 )edit

Though I suppose I can train the FaceRecognizer with the same face tilted at different angles to alleviate the pose normalization part...

Gensoukyou1337 gravatar imageGensoukyou1337 ( 2017-09-15 04:56:10 -0600 )edit

i'm only guessing, but that sounds counter-productive. (esp. the FisherFaces one should profit from pose normalisation, and suffer from tilting variation)

(try both, and report back, i guess ?)

berak gravatar imageberak ( 2017-09-15 04:59:41 -0600 )edit