Giter VIP home page Giter VIP logo

05rs / face-recognition Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 152.93 MB

End to End Face-Recognition follows the approach described in FaceNet with modifications inspired by the OpenFace project. Semi-hard triplet loss and online semi-hard triplet generator are used for further fine-tuning.

Python 2.93% Jupyter Notebook 97.07%
tensorflow dlib keras openface triplet-loss siamese-network face-recognition opencv

face-recognition's Introduction

Face-Recognition

End to End Face-Recognition follows the approach described in [1] with modifications inspired by the OpenFace project. Keras is used for implementing the CNN, Dlib and OpenCV for aligning faces on input images. Semi-hard triplet loss and online semi-hard triplet generator are used for further fine-tuning.. Face recognition performance is evaluated on a small subset of the LFW dataset which you can replace with your own custom dataset e.g. with images of your family and friends if you want to further experiment with the notebook.

Technology Used

  • Tensoflow
  • OpenCv
  • Python

Model Architecture

model

Preprocessing Pipeline

  • Directory based image retrival

  • Face Extraction using DLib as per FaceNet paper and Face Alignment (eyes and mouth landmark based alignment)

Face Recognition Pipeline

  • Used pretrained 'nn4.small2.v1' model [2]

  • Creating Siamese Net adding a triplet loss layer.

  • Used Tensorflow Semihardloss

  • Uses custom semi-hard online triplet Generator for fine-tuning

    • Generate the best triplet in the given batch of training.

Evaluation Pipeline

  • Used Support Vector Machine (SVM), K Nearest Neighbour (KNN), Gaussian Naive Bayes (gnb) for inference.

    • Distance Threshold using pretrained model on subset of LFW Dataset.

    Distance Threshold

    • Distance Threshold using pretrained model and fine-tuning on subset of LFW Dataset.

    Distance Threshold

  • t-distributed Stochastic Neighbor Embedding (t-SNE) is applied to the 128-dimensional embedding vectors.

    • t-SNE of pretrained model on subset of LFW Dataset

      t-SNE

    • t-SNE of pretrained model and fine-tuning on subset of LFW Dataset

      t-SNE

Status

  • Image Extraction and Preprocessing Pipeline complete.

  • Model Pipeline complete in Tensorflow.

    • Converted orignal model in csv to binary for tensorflow.
    • Creating Siamese Net adding a triplet loss layer.
    • Used Tensorflow Semihardloss.
  • Hard Triplet Generator completed for further Fine-Tuning.

    • Made fast custom Image Data Generator for implementing Semi-Hard online Triplet Generator.

Features

  • Online semi-hard triplet generator.

  • Fine-tuning to custom dataset.

  • Less GPU extensive as uses pre-trained model as base to fine-tune to.

  • Fast Generator

Next Todo:

  • Visualization
  • Model evaluation and metrics

face-recognition's People

Contributors

05rs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.