
Explore how deep learning enables facial recognition, from face localization with bounding boxes to CNN-driven embedding for access control, surveillance, and biometric identification in Python.
Make sure to upload the repository available in the resources to your Google Drive.
It is recommended you fill in the code cells as you watch the lectures for maximum benefit.
Explore how facial recognition differs from traditional classification and detection, and learn how convolutional networks enable one-shot classification, ACMD network, face encodings with triplet loss, and evaluating similarity between faces.
Demonstrates face recognition access demo where a web app captures an image, sends it to the cloud for authentication, and signals door opening, highlighting touchless biometric authentication used in airports.
Differentiate face verification from face recognition by comparing a new image to a single reference versus searching a database for the best match, as mobile phones verify you.
The lecture contrasts traditional classification with face recognition, highlighting how changing object counts and limited images force retraining and changes to output layers, limiting practicality.
Explore a face recognition use case for building access, where a single employee photo enables biometric identification and secure entry through a trained recognition network.
Explain siamese networks for one-shot classification by encoding images into embeddings with twin networks, then comparing distances to decide if pictures are the same or different, including faces.
Discover one-shot learning, where recognition comes from comparing features and similarities between images rather than learning the object from many examples, enabling face verification and recognition.
Learn how face embeddings convert an image into a 64 (later 128) dimensional vector of latent features produced by a neural network, enabling face recognition via L2 distance between embeddings.
One-shot learning example for face recognition shows using embeddings and distance thresholds to identify a new face, avoiding retraining a softmax classifier for each person.
Explore siamese networks with twin weights that generate embeddings for face comparison using L2 distance, and train them with triplet loss to distinguish same versus different people.
Train face embeddings using triplet loss with anchor, positive, and negative images, minimizing anchor-positive distance while maximizing anchor-negative distance, controlled by an alpha hyperparameter.
Generate a triplet dataset of facial images to train embeddings for one-shot face recognition. Use anchor, positive, and negative samples, and hard-negative mining to improve embedding discrimination.
Explore how a siamese network trained with triplet loss uses anchors, positives, and negatives to shape embeddings that cluster same-person faces while separating different faces by distance.
Explain triplet loss on image embeddings, separating anchor, positive, and negative samples with a margin to distinguish faces; leverage pre-treated recognition models to generate embeddings and perform distance-based clustering.
Learn binary face classification with a siamese network that computes embeddings and outputs a probability via a sigmoid logistic regression to decide whether two images show the same person.
Learn to extract a face from an image using a face detector, create a face embedding with a face recognizer, and implement this workflow with an empty CNN in Python.
Provide an overview of face detection and recognition, showing how a system detects faces with bounding boxes, creates embeddings, and identifies individuals by distance against a database.
Create a face embedding and save it to a file in Google Colab by installing empty CNN libraries, mounting Google Drive, and configuring project and system paths for face recognition.
Import dependencies like Pillow, NumPy, and Matplotlib, load a face image from a file, convert it to a NumPy array, and prepare it for face detection and recognition with MTC.
Extract faces from images using the MTCNN Python library, which implements joint face detection and alignment via a multitask cascading convolutional network, and create a detector instance with default parameters.
Extract faces from an image using the detector, returning metadata with bounding box coordinates, confidence, and key points for left eye, right eye, nose, left mouth, and right mouth.
Read the four values of the face bounding box as x, y, width, and height to draw the box around the detected face.
Analyze the first detected face by extracting the bounding box coordinates from the face metadata, draw a rectangle around it with OpenCV, and visualize the detected face.
Select the second detected face by setting phase index to one, apply a rectangle to its coordinates, and visualize the result, noting false positives or negatives in deep learning.
Crop the image to the detected face using the bounding box, then resize to 116 by 116 (and 160 by 160), convert to an array, and prepare for embedding.
Apply a convolutional neural network face recognition model to generate a face embedding from the detected face, using a public model with options for 128 or 512 dimensions.
Load FaceNet with the TensorFlow Keras library, load the model from the H5 file, and convert the input image into an embedding with the neural network.
Create a face embedding with FaceNet by converting image pixels to float32, normalizing by mean and standard deviation, flattening to a 1D vector, and obtaining the embedding from the model.
Convert a face image into a 128-element face embedding vector using the fastnet 128 model, producing a 128-element embedding for use in facial recognition.
Save the face embedding to a file to build a face database, enabling recognition by comparing embeddings with distance and storing the labeled embedding in a compressed npc file.
Load the face embedding from a file using the load method, obtaining the embedding and its label from the data array. Confirm the embedding matches the stored vector.
Extract faces from images, create face embeddings, and identify the same person across different images using a single reference image, with future work on identifying other faces.
Identify a face in an image by comparing its embedding to a saved face database. Extract faces, generate embeddings with Fastnet, and find the closest match by minimum distance.
Extract eight faces from a single image using a CNN-based detector, create 128-d embeddings for each face, and compare them with saved embeddings to identify matches.
Use face embedding to identify a person by comparing embeddings with a vector distance; the smallest distance reveals the closest match, a footprint-like representation from the ACMD network.
About the course
Welcome to the course Deep Learning in Practice III on Face Recognition. I am Anis Koubaa, and I will be your instructor in this course.
This course is the third course in the series Deep Learning in Practice. It provides a fast and easy-to-follow introduction to face recognition with deep learning using MTCNN for face extraction and FaceNet for face recognition. My two previous courses deal with object classification and transfer learning with Tensorflow and Keras.
In this course, you will learn the whole loop of face recognition systems, which starts by extracting the face from an image and localizing the face in an image by its bounding box; then, we process the extracted face through a convolutional neural network, called FaceNet in our case, to create a fingerprint of the face, which we call face embedding. The face embedding can be stored in a database so that they are compared with other face embeddings to identify the person of interest.
In this course, you will have a step-by-step introduction to this whole loop, and I will show you how you can develop a Python application that performs the abovementioned operations. Exciting, right?
Why is the course important?
This course is essential due to the importance of face recognition systems in real-world applications. These fast-growing systems are used in several applications, such as surveillance systems, face access systems, and biometric identification.
In this course, you will be introduced to face recognition systems both from a theoretical and practical perspective, allowing you to develop your own projects using face recognition in Python.
The course's motivation is a lack of resources to get quickly started with the topic. So taking this course will save you tons of time looking for scattered references over the Internet and will get you much quicker into the field.
What's worth?
This course provides fast yet comprehensive coverage of face recognition systems that would let you go from Zero to Hero.
I first start with presenting the fundamental concepts of face recognition systems and how deep learning models for face embedding are trained and produced.
Then, I provide a hands-on introduction to face recognition using MTCCN for face extraction and FaceNet for face recognition, all with Python programming language. Tensorflow and Keras APIs will be used to load the FaceNet model. I provide a Jupiter notebook that you will use as a guide in the lecture to follow and write the code to apply as you learn.
At the end of this course, I guarantee that you will understand the whole loop of face recognition systems, and you will be able to develop your application and integrate it into your project.
Pre-requisites
To benefit from this course most, you just need to know about Python programming.
Having a basic understanding of deep learning and TensorFlow would be a plus, but it is not mandatory.
In any case, you may refer to my two courses: Deep Learning in Practice I and II, for a basic practical introduction to deep learning.
Welcome to the course, and I wish you a pleasant learning experience.
Let's get started.
About me
I am Anis Koubaa, and I am working as a Full Professor in Computer Science and Leader of the Robotics and Internet-of-Things Lab at Prince Sultan University
I am the author of two best-seller courses on Deep Learning and Robot Operating System (ROS),
and this course is the third course in the series Deep Learning in Practice, which deals with face recognition systems.
The series of deep learning in practice intends to present advanced deep learning topics very easily to beginner users who would like to get started with hands-on projects in deep learning in a minimum amount of time.
The two previous courses dealt with object classification and transfer learning projects.