Git Product home page Git Product logo

facerecognition's Introduction

FaceRecognition

OpenCV 3 & Keras implementation of face recognition for specific people.

Requirement

  • Python 3.6
  • Tensorflow-gpu 1.5.0
  • Keras 2.1.3
  • scikit-learn 0.19
  • OpenCV 3.4

Model

Face recognition Model:

We use MobileNetV2 as a feature extraction model. We input the paired face images and output the Euclidean distance between the two image features. The purpose of the training is to minimize the distance of the same category and maximize the distance of the different categories, so the use of the contrast loss as a loss function.

face_net

Experiment

Due to the limited computational resources, we used Face Recognition Data to train and test the model.

device: Tesla K80
dataset: Face Recognition Data - grimace (University of Essex, UK)
optimizer: Adam(lr=0.001, beta_1=0.9, beta_2=0.999, epsilon=1e-08)  
batch_szie: 40 

run the command below to show the experiment result.

python vis.py

Train and val loss

Loss

t-SNE for different people

The extracted face data is reduced to 2D features by t-SNE. It can be seen that the same face features are clustered together.

tsne

Features distance for different people

We use person 1 as the person to be identified, then compare the Euclidean distance between person 1 and the features of the other 4 individuals. It can be seen that it is closest to the features of another photograph of itself and far from other people.

distance

Application

run the command below to train the model.

python train.py

The app use haar cascade classifier or SSD to detect face,use MobileNetv2 to recognize face.

run the command below to run the app to recognize a specific people from video camera.

Press esc to quit window. Press space 5 times to record different gestures of the face. The face id were saved at data\key.npy

python face.py

facerecognition's People

Contributors

xiaochus avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.