Face recognition

Face recognition is one of the most innovative applications of computer vision and has gone through numerous breakthroughs in recent years. There are a plethora of real-world applications where facial detection and recognition are leveraged, such as Facebook, where it is used for image tagging. There are numerous ways to do facial detection, such as by using Haar cascade, Histogram of oriented gradients (HOG), and CNN-based algorithms. Human facial recognition is an amalgamation of two basic steps: the first is facial detection, that is, locating a human face in an image, while the other is identifying the human face.

In this recipe, we will use the image.libfacedetection package in R, which provides a convolutional neural network-based implementation for face detection, and then build a classifier/recognizer for face recognition. The steps for installing the package can be found at https://github.com/bnosac/image. For face recognition, we will use a pre-trained model known as FaceNet, which is a face recognition system that was developed by Google in 2015. FaceNet is capable of extracting high-quality features from faces, also known as face embeddings, which in turn can be used to train any face recognition system. In this recipe, we will use the pre-trained Keras FaceNet model provided by Hiroki Taniai. 

The following screenshot shows the intermediate steps of the face recognition system being implemented in this recipe. First, we detect a face in the image. Using the detected face coordinates, we draw a bounding box around the face. The region inside the box is passed to a recognition algorithm. The recognition model identifies the personality, and then we tag the face in the given image. Note that the recognition model is trained on the cropped face, as shown in the following screenshot:

Image Source - Pixabay

Let's start building a deep learning model so that we can recognize the faces of celebrities.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset