ageitgey / face_recognition

The world's simplest facial recognition api for Python and the command line
MIT License
52.44k stars 13.37k forks source link

3d face recognition #890

Open rramesh2000 opened 4 years ago

rramesh2000 commented 4 years ago

Is it possible to differentiate between a 2 dimensional face and a real face ?

n0toose commented 4 years ago

The modules, in short, check for a couple of patterns that resemble something like this particular picture.

If you were to put a picture of another person and hold it in front of a camera, then the API would recognize that said picture as a face, because it matches the aforementioned patterns.

Here's a very nice representation of the scenario that I'm talking about, which I just made in Microsoft Paint for the sake of clarity:

image

rramesh2000 commented 4 years ago

I get that but how can I make sure it's a real person and not a photo or picture

SaddamBInSyed commented 4 years ago

you have to add liveness check in to your code in order to detect spoof attack.

OR

  1. simply you can include the object detection ( don't capture when you see mobile/tablet device ).in front of the camera.

OR

  1. calculate the detected closest face wh value and compare with your threshold wh value. normally faces on the mobile device w*h values is significantly less than the genuine case.
ageitgey commented 4 years ago

@alwayslivid That is a very good picture. A+

ivelin commented 4 years ago

This is a good thread.

The problem is not limited to flat 2D photos. There are demos how the iPhone Face Recognition can be tricked with a 3D mask of a person.

Its the sort of cat and mouse game that never ends between security systems and hackers. One potential solution that will require significant thought and effort is to enable federated learning. Enable users from around the world to share examples of images that break the latest face detection models and contribute to an improved next version. This type of approach (previously referred in AI as group filtering) has been successfully used for email spam by Google and other companies with large resources. Federated learning could potentially distribute the effort among peers.

leeqa commented 4 years ago

the simplest (or maybe silly) way for liveness check is eye-blink detection. the process is as follow

  1. Detect faces in each frame generated by the webcam.
  2. For each detected face, detect eyes.
  3. For each detected eyes, detect if eyes are open or closed.
  4. If at some point it was detected that the eyes were open then closed then open, we conclude the person has blinked