What is the best method to match face features against a database?

asked 2016-07-26 12:21:43 -0600

paulos gravatar image

The challenge

I'm trying to replicate the experience from this campaign, but in realtime:

What I have now

  • I'm able to detect faces and (somewhat naively) mark the regions I want: right and left eyes, cheeks, forehead, mouth, nose and so on.
  • I run the same algorithm against a database of face images (5k images from Getty Images) and store image slices for each region.
  • I'm just converting to gray and storing some metadata for each face slice. I suspect I could get better matches applying some kind of filter.
  • I made a web app using Django Rest Framework that captures a snapshot using the web cam, locate your face and try to match each slice against slices of the same part of the face in the database.

The current problem

The matching is not very good. Sometimes, the best match for a face slice is a false positive from the face recognition algorithm (I got a low percentage of false positives and I'm curating the database by hand). I've tried the following algorithms in order to find the best match for each face feature from skimage.measure:

  • compare_ssim
  • compare_psnr
  • compare_mse
  • compare_nrmse

Best results are from Structural Similarity, but still far from ideal. Bellow are an example of the app returning a false positive as the best match for my mouth:

image description image description

As you may have guessed I don't have a clue about what I'm doing - unable to figure out why it is not picking from hundred of mouths in the database.

edit retag flag offensive close merge delete

Comments

how is tis related to opencv at all ?

berak gravatar imageberak ( 2016-07-26 16:44:31 -0600 )edit
1

if you want to compare face regions, imho,

  • you have to align the input images, so they're frontal, and the eyes are on a horizontal line (and in a fixed position)

  • try features different from plain pixels, LBPH, gabor wavelets, dense SIFT, etc.

berak gravatar imageberak ( 2016-07-27 01:30:41 -0600 )edit

I got the images doing a search for "face man front" so most of the database are frontal and horizontal. After a couple hours curating the database, results are starting to get better. I will try other algorithms a see if I can make it fast enough. Thanks!

paulos gravatar imagepaulos ( 2016-07-27 07:05:06 -0600 )edit
1

also, maybe, instead of having "fixed" search locations (and aligning your images to that) you could try to use facial landmarks, and adjust your search region to "where the nose really is"

berak gravatar imageberak ( 2016-07-27 07:32:43 -0600 )edit

Oh, that would be great because I then I could transform the image. I just made a Google search about "face landmark detection", looks like it will be very useful. Thanks again, this is a good tip.

paulos gravatar imagepaulos ( 2016-07-27 07:56:24 -0600 )edit