Face Recognition System

1 1
  • 0 Collaborators

This is the Face Recognition System using Deep learning and various other tools of machine learning implemented in Python. The purpose of this project is to detect and recognize faces appear in the image, for this, we build the various pipeline. Each pipeline performs its individual task and passes its output to next pipeline as input. we divide this project into mainly 3 pipelines. The 1st pipeline is used to preprocess the dataset, here the dataset means the collection of images of each person on which the system needs to be trained. preprocessing the data means to detect the faces and align them if they are not aligned. The 2nd pipeline is used to train the machine learning for prediction of faces. In this pipeline, the preprocessed dataset goes in and what we get is the vector embedding for each character. The 3rd pipeline is to test the test-image. this pipeline takes the single image as input then detect all faces from the image and then align them if they are not, and finally compare each face with the face of the trained character and predict the result with certain accuracy. ...learn more

Project status: Published/In Market

Artificial Intelligence

Groups
DeepLearning, Artificial Intelligence India, Student Developers for AI

Intel Technologies
MKL, Intel Opt ML/DL Framework

Code Samples [1]

Overview / Usage

This is the Human face Recognition System with the help of Deep Learning in Tensorflow, This Face Recognition System can detect and recognize the human face from the image. This project is based on computer vision a substream of machine learning and it is implemented in python, It uses various technology such as Tensorflow,sci-kit learn SVM classifier, Dlib and the pre-trained neural network of google I;e Inception RSNET VI for various of a subtask.
The idea behind this project is to replace the attendance system in schools and colleges with the attendance from face recognition of students, These can save the important time and efforts as well as it drags the current system towards the innovation and makes our next generation familiar with artificial intelligence

Methodology / Approach

To perform facial recognition, you’ll need a way to uniquely represent a face. Usually, a technique involving marking the coordinates of prominent features of a face. Among these features were the location of hairline, eyes and nose. Google released a paper, FaceNet, which uses a convolutional neural network relying on the image pixels as the features, rather than extracting them manually. It achieved a new record accuracy of 99.63% on the LFW dataset. In the FaceNet paper, a convolutional neural network architecture is proposed(Inception RESNET VI). For a loss function, FaceNet uses “triplet loss”. Triplet loss relies on minimizing the distance from positive examples while maximizing the distance from negative examples. Conceptually, this makes sense. Faces of the same identity should appear closer to each other than faces of another identity. For this Project, the important take away from the paper is the idea of representing a face as a 128-dimensional embedding. An embedding is a collective name for mapping input features to vectors. In a facial recognition system, these inputs are images containing a subject’s face, mapped to a numerical vector representation. Since these vector embeddings are represented in shared vector space, vector distance can be used to calculate the similarity between two vectors. In a facial recognition context, this can vector distance be applied to calculate how similar two faces are. Additionally, these embeddings can be used as feature inputs into a classification, clustering, or regression task.

My approach to performing face recognition is to divide the system into 3 Pipeline.

The First Pipeline is DATA PREPROCESSING,
The second Pipeline is TRAINING CLASSIFIER,
The Third Pipeline is the TEST CLASSIFIER.

DATA PREPROCESSING: in this pipeline before feeding the dataset to tensorflow to train the model we preprocess it because Image Recognition Problems ranges from lighting differences, occlusion, alignment, segmentation and many more. Image Pre-processing in a Facial Recognition context typically solves few problems, in this project preprocessing will address two problems, one is a segmentation and other is alignment. First, you’ll solve the segmentation problem by finding the largest face in an image. This is useful as our training data does not have to be cropped for a face ahead of time. Second, you’ll solve alignment. In photographs, it is common for a face to not be perfectly center aligned with the image. To standardize input, you’ll apply a transform to center all images based on the location of eyes and bottom lip. This preprocessed data is copied into output directory which is passed as input to next pipeline I;e Train classifier.
TRAIN CLASSIFIER: In Train Classifier Pipeline the processed data is used to generate vector embeddings of each identity with the help of tensorflow. These embeddings can then be used as input to a classification, regression or clustering task. You’ll use the Inception Resnet V1 as your convolutional neural network for training purpose. By using pre-trained weights, you are able to apply transfer learning to a new dataset, you’ll utilize Tensorflow’s queue API to load the preprocessed images in parallel. By using queues, images can be loaded in parallel using multi-threading. When using a GPU, this allows image preprocessing to be performed on CPU, while matrix multiplication is performed on GPU. First, you’ll load the images from the queue you created. While training, you’ll apply preprocessing to the image. This preprocessing will add random transformations to the image, creating more images to train on. These images will be feed in a batch size of 128 into the model. This model will return a 128 dimensional embedding for each image, returning a 128 x 128 matrix for each batch.you can change the batch size to other numbers but I choose 128 because the vector embedding created for each image is of 128 feature, so by taking batch size 128, it results in the output of a square matrix, which provides flexibility in matrix operation. now, this model will return the vector embedding of 128*128 dimension for each batch. After the creation of embedding, this vector can be used as input for sci-kit learn SVM classifier to train on each identity.
TEST CLASSIFIER: Here we provide a single image that may contain several faces of any personality, the location of all faces is detected and align through Dlib, then each aligned face is queued in tensor with the label of all the personality on which the model is trained. then tensorflow create vector embedding for the tensor object. each vector embedding is pass to SVM Classifier and predicts the result according to triplet loss function.

Technologies Used

UBUNTU 16.04 64 bit,
Python 3.x,
intel optimized Tensorflow: TensorFlow* library has been optimized using Intel MKL-DNN primitives, a popular performance library for deep learning applications,
opencv,
scikit-learn,
Dlib,
Pycharm(optional),
INCEPTION RESNET VI .

Repository

https://github.com/maverickfromoldschool/MyMinor

Comments (1)