Face Detection & Recognition: How Machine Learning Approaches and Algorithms make it possible?

Matthew-Mcmullen
Nerd For Tech
Published in
5 min readAug 11, 2021

Among other tasks made possible through machine learning algorithms, face detection and recognition is a crucial computer vision task. To begin with, both face detection and recognition are co-related yet colloquially different. Face detection is a wider aspect than face recognition and is applied with the help of machine learning. Whether it is about face detection in surveillance, mapping images for medical diagnosis, or deep analysis of human faces in videos for intelligence purposes, ML models apply for both detection and recognition purposes.

Evolution: Machine learning approaches for face detection & recognition

Face detection is considered a part of the computer vision domain with relation to AI or Artificial Intelligence. Depending upon the dynamic nature of the face, studies have led to application of multiple face detection ML approaches such as Viola Jones algorithm, Kohonen approach, Local Binary Pattern Histogram (LBPH), Eigenfaces, Karhunen-Loeve detector. These approaches have helped in refining machine learning algorithms, which are today used in many face detection softwares and combined with ML models to provide accurate results. Let us have a look at them.

Eigenfaces: One of the earliest face recognition approaches includes Eigenfaces. When studies into the techniques for face detection started brewing, the Eigenfaces method was adopted. The Eigenfaces approach to face detection and recognition was based on the 2D perspective. It applied the covariance matrix based on probability distribution on a high dimensional vector space to produce Eigenvectors, basis of which face variations were produced for training. Later on, the approach was used with PCA or principal component analysis (a mathematical calculation), which defines points (for analysis) pertaining to the principal components of the data. The Eigenface approach made face detection little challenging due to its sensitivity to facial changes, lighting and environment.

deepfake images detection
Image credit: www.researchgate.net

Kohonen approach: Among early pioneers in face detection, the Kohonen approach also called the Self-Organizing Map (SOM) uses a network of Eigenfaces in a single-layered neural net with approximation of Eigenvectors through a serial correlation based matrix of facial images. The Kohonen approach is an unsupervised training method and often one or either two-dimensional. The approach, however, was less impactful in real-life environments. In the next stage, the Kohonen approach was augmented by using algebra for the recognition of faces.

Fisherface: Based on the reduction of face space dimension, and leveraging PCA or Principle Component Analysis that helps in reduction of dimensionality and focuses on projection direction maximizing the scatter of all classes of faces and images, Fisherface was developed by Robert Fisher for taxonomic classification. Fisherface algorithm uses LDA or Linear Discriminant Analysis for reducing dimensionality. Unlike Eigenfaces, the Fisherface method is able to handle facial variations, lighting and environment issues.

Viola Jones: With such an approach the Viola Jones method was adopted in 2001. It was a clutter-breaking approach, and the methodology applied in Viola-Jones framework revolved around detection of a face then extracting some features, followed by feature comparison in the existing data. It is based on binary classification of weak detectors. This approach makes detection with the Haar filter, cascade classifier as the detection window shifts from pixel-to-pixel, while image region in the window shifts resulting in the cascade classification.

deepfake detection services
Image credit: www.stackoverflow.com

The ML algorithms for face detection and recognition in application

Face detection and recognition has always been an intriguing technology; applied through AI, combining machine learning methodologies to build a model that works. Coming a long way from following the traditional approaches for detection of human face and its features, the earliest of machine learning algorithms have strived to find human eyes first, followed by other features such as mouth, nose, eyebrows, and nostrils. Once a face is detected, the algorithm for face recognition gets down to work.

Several combination based methods for advanced learning about human faces such as rule based method, feature invariant, template matching and appearance based methods are in practice in the core ML models available today. Sometimes, the training data also uses techniques like landmark annotation to understand the significant points on the face.

A machine learning algorithm that has been widely applied for learning facial forms and expressions and to understand environmental conditions pertaining to face recognition is Local Binary Pattern Histogram (LBPH). It was developed and first presented by Ahonen in 2004 and used between 2004–2006. In this method, a face is divided into 7X7 (count varies) equal sized cells, as each cell then, is calculated on the basis of local binary pattern histogram. The LBPH or local binary pattern is a visual descriptor based on the Texture Spectrum model. The algorithm is also ideal for recognizing 3D images with high accuracy as for 2D.

deepfake services
Image credit: Sciencedirect.com

Local Binary Pattern Histogram (LBPH) is a popular ML algorithm for face recognition delivering high accuracy in computer vision applications. The algorithm also produces exceptional results bypassing challenges of facial variations, illuminations and posture issues. It is also used by deep neural networks applications to detect and analyze human faces, as well as in real world scenarios such as deepfake detection. The LBPH has proved instrumental in making several face recognition methods work efficiently, enabling CNNs (convolutional neural network) and ANNs (artificial neural networks) for the real world application of face detection and recognition, to be precise.

Concluding note

Machine learning algorithms have become central to human efforts in resolving complex computational challenges. Face detection has its roots in psychological studies carried out during the 1960s for detecting facial expressions, emotions and gestural interpretation by the human brain. The findings of the research starting in the 60s era in psychology were then implemented into the engineering field as the technological transformation picked up pace.

The ML algorithms for face recognition are trained on data of positive and negative images of human faces to predict accurate results. Multiple processes are also available to conduct face detection and recognition and often, combinations of approaches and algorithms are applied by ML practitioners. If we talk about trends in programming then, face detection using Python and face detection using OpenCV has become a norm to execute the majority of face recognition implementations.

PS: As of now, any path-breaking in terms of facial recognition is not expected to arrive. All the current practices in face recognition are based on the methods and approaches we have discussed above.

--

--

Matthew-Mcmullen
Nerd For Tech

Cogito Tech shoulders AI enterprises by deploying a proficient workforce for AI, GenAI, LLMs,RLHF,DataSum and More..