ageitgey / face_recognition

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

Photo vs. live person #371

Closed neovaldivia closed 6 years ago

neovaldivia commented 6 years ago

Description

Running facerec_from_webcam_faster.py the library cannot differentiate someone actually in front of the camera from someone holding somebody's picture to the camera. Is this happening by design? I'll email you some evidence Do you know of any library that could work along this one to make the discrimination between a live person and a picture?

thanks!

ageitgey commented 6 years ago

This library is just to identify faces. It doesn't attempt to check if the person is living or a picture. That's a separate problem called liveness detection.

One possible approach is to add code to your application to make the person blink and detect that they blinked: https://www.pyimagesearch.com/2017/04/24/eye-blink-detection-opencv-python-dlib/

But then that can still be fooled by a pre-recorded video.

Liveness detection actually a pretty hard problem that no one has solved with 100% accuracy. Apple uses a 3d model (instead of 2d) with FaceID to try to improve this, but even that isn't 100% perfect.

ageitgey commented 6 years ago

No need to email me any evidence by the way. Even the sample pictures in the README show it recognizing me holding a picture of Obama as Obama :)

neovaldivia commented 6 years ago

thanks for the tip...I'll make sure to give that lib a look

MLDSBigGuy commented 6 years ago

This cannot be solved only by face recognition. Add other biometrics like speech recognition, finger print etc at same time. This problem is falling under fraud detection. Read papers on biometrics.

Maybe 3d faces can minimize this problem much easier as @ageitgey specified. To improve accuracy, include more training samples of the person. I feel that this could be achievable

go-mou commented 6 years ago

https://www.youtube.com/watch?v=WQMrTl-erVk https://www.youtube.com/watch?v=t4O2bbF61Tk @ageitgey is it real?

MLDSBigGuy commented 6 years ago

@CacheTechLtd , That video is this paper: (http://biometrics.cse.msu.edu/Publications/Face/WenHanJain_FaceSpoofDetection_TIFS15.pdf)

I can use photoshop to remove the blurr in static face photos / improve the images with reflections or other points authors specified.

Are the classifiers trained on the face spoof database really work in real world if attackers only intention is to break down the facail recognition system ? I am getting some counter-attack ideas for every good inventions.

Even for speech recognition, there are AI machines coming which can completely mimic our voice: https://www.scientificamerican.com/article/new-ai-tech-can-mimic-any-voice/

God save us :D

taewookim commented 6 years ago

https://www.youtube.com/watch?v=djBNQ5UBz8E

This is actually in production at our clients, not academic research paper

vdsprakash commented 5 years ago

https://www.youtube.com/watch?v=djBNQ5UBz8E

This is actually in production at our clients, not academic research paper

Which model u have used? How do u built it ?

farazBhatti commented 5 years ago

@vdsprakash you can use a pretrained CNN like AlexNet or Inception and train it as binary image classifier using your own data set of fake and original images.

davieking1 commented 5 years ago

what if you use a blink detection system and define the number of times and speed that the person has to blink to be recognized and differentiated from a "paper face" or mask