项目作者: utkarsh-21st

项目描述 :
A Face Recognition based Attendance System using one-shot-learning
高级语言: Python
项目地址: git://github.com/utkarsh-21st/attendence-face-recognition.git


attendence-face-recognition-one-shot-learning

This is my attempt to build an attendance system based on face recognition.

To build a Face-Recognition system, we, of course, are going to employ techniques based on Convolution Neural Network.

One way is to first gather some images of all the identities and train a classification-algorithm over those images and there it is, a Face-Recognition algorithm, ready to recognize whether a new image is among those identities or is some stranger. This algorithm, if trained well, can provide robust performance, however, this method is impractical due to: It must be retrained whenever a person leaves or joins the institution, The data has to have at least 5-10 images of each identity

The other approach is whats called “one-shot-learning”, which is what has been used here. Unlike the previous approach, this algorithm once trained is all there is, no need to retrain in case of any change in identities. Moreover, it only needs one or a few images of each identity. Given an image, it calculates, using the siamese network, a low dimensional feature-vector for that image called embedding. And the model is designed such that the Euclidean distance between two embeddings quantifies how similar two images are (whether they belong to the same identities).

A convenient interface is also provided to manage the system:
interfaceinteraceinterface

How is attendance taken?

  • A database of all identities can be created by using the interface.
  • A face-detection algorithm attempts to find a face in an image
  • Detected-face is then carried out to the face-recognition model which calculates an embedding for that face.
  • Euclidian distance is calculated between this embedding against all stored embeddings in the database.
  • The minimum of all distances is chosen if it is also less than a certain threshold.

How to run?

Install dependencies: See requirements.txt

Note: Ensure that your system has TensorFlow with GPU support.
  • Clone this repository:
    1. git clone https://github.com/utkarsh-21st/attendence-face-recognition.git
    2. cd attendance-face-recognition
    3. python main.py

While the system is ready-to-use, it isn’t still robust enough to deploy it in real-life.
It can perhaps be further improved by using multiple images per person, shot at different times.
If you are wondering what algorithm does iPhone uses for Face Recognition: Check out this. It is a much more sophisticated approach that also utilizes a depth camera.

Face Detection algorithm used here is MTCNN.
Face Recognition algorithm used here is a pre-trained model, Keras version of OpenFace.

References