Face recognition using deep learning under 5-minutes



Original Source Here

I have embarked on a journey to learn deep learning. “For the things we have to learn before we can do them, we learn by doing them.” — Aristotle.

In the last article, we learned about face detection using MTCNN. Now, we will try to recognize the faces extracted by MTCNN. I have compiled a dataset of 30 Bollywood celebrities for our face recognition task. Every star has around ten training and ten validation images. FaceNet is a face recognition system developed in 2015 by Google researchers in a paper titled “FaceNet: A Unified Embedding for Face Recognition and Clustering.” Given a picture of a face with input dimensions (160, 160, 3), FaceNet will extract high-quality features from the face and predict a 128 element vector representation called face embeddings. Then, we will use Support-Vector Machine to classify these face embeddings into respective Bollywood celebrities.

Block diagram of our face recognition system

First, we will extract faces from all our celebrity images using MTCNN and save the extracted face pixel arrays in uncompressed .npz format. Next, make sure to split celebrity images into train and validation folders.

That’s it. The bollywood-data.npz contains a list of all faces that MTCNN detected in our celebrity dataset.

Next, we will transform the extracted faces into face embedding using FaceNet. Finally, we will save all our face embeddings for into bollywood-embeddings.npz.

After extracting face embeddings, we will build a classifier using Support Vector Machine to classify face embeddings to respective labels. We can choose any multi-class classifier, including building our Neutral Network.
I choose Support Vector Machine due to its simplicity and popularity in other machine learning blogs for the face recognition step.

We now evaluate our model using our test images. Finally, we will plot our results to have visual confirmation of SVM model performance on test images.

Plot results from test images

Tada 🎉 We have our face recognition code. How well the model performs depends on the size of our dataset. There are many other alternative models available, and we can always plug better models and experiment to see if we get better results.

AI/ML

Trending AI/ML Article Identified & Digested via Granola by Ramsey Elbasheer; a Machine-Driven RSS Bot



via WordPress https://ramseyelbasheer.io/2021/07/31/face-recognition-using-deep-learning-under-5-minutes/

Popular posts from this blog

I’m Sorry! Evernote Has A New ‘Home’ Now

Jensen Huang: Racism is one flywheel we must stop

Fully Explained DBScan Clustering Algorithm with Python