How Do Computers Recognize Human Faces?

In this blog post, we’ll take a simple and straightforward look at the principles and processes behind how computers recognize human faces.

 

What Principles Underlie Face Recognition?

You’ve probably played a game at least once as a child where you had to complete a human face. In this game, you first select a face shape, then choose the hairstyle, eyes, nose, and mouth one by one and place them on the face. By switching between various hairstyles, eyes, noses, and mouths, you can create the face you want. The way computers recognize and compare faces isn’t much different from this. Computers identify and store facial features; when a new photo of a face is inputted, they compare it to the stored features to determine who the person is.
A recent example of facial recognition technology that’s easily accessible is the facial recognition application (App). These apps pre-extract and store key features—such as facial contours, eyes, noses, and mouths—from photos of celebrities. Later, when a person’s face is captured via the camera, the app extracts facial features in the same way and compares them to the stored facial features of celebrities to identify and display the person who most closely matches.

 

How does a computer recognize a face?

Now, let’s examine the computer’s facial recognition process. Face recognition consists of four main stages: input, face detection, feature extraction, and comparison.
In the input stage, a single frame from a photo or video is transmitted to the computer via an input device. Generally, the higher the resolution of the input device and the higher the frames per second (FPS), the more accurately faces can be recognized. This principle is similar to how a person with good eyesight can more accurately recognize the face of someone standing far away.
In the face detection stage, the system first checks whether a face is present in the input photo or video. To do this, it identifies the face’s outline and key features such as the eyes, nose, and mouth. While various face detection techniques are currently in use, we will focus here on the representative Haar-like detection method.
The Haar-like detection method utilizes Haar wavelets. A wavelet is a simple rectangular pattern composed of black and white regions. These black-and-white regions are used to identify areas in an image where differences in brightness occur. By applying wavelets of various sizes and shapes across the entire input image or video, and then retaining only the locations where the brightness difference between the black and white regions is significant, the system can effectively detect the face outline and key facial features such as the eyes, nose, mouth, and eyebrows. Furthermore, this process also allows for the extraction of positional information regarding facial features.
For example, when extracting information about the eyes, the black regions of the wavelet are positioned to correspond to relatively dark areas—such as the pupil—while the white regions correspond to bright areas, such as the skin. By utilizing these brightness differences, the position and shape of the eyes can be effectively detected.

 

How are facial features extracted?

Once the face detection stage is complete, the system determines whether to proceed to the feature extraction stage.
In the feature extraction stage, facial features are extracted to fully utilize the facial components identified during the face detection stage. Unlike the face detection stage, this process involves a preprocessing step. Since the angle of rotation, size, and lighting intensity of faces vary with each photograph or video, a normalization process is performed to standardize them as much as possible. Additionally, color photographs or videos may be converted to black-and-white images as needed.
For example, the original photo is converted to grayscale, then only the face region is cropped and resized to a uniform size, and histogram equalization is performed to correct brightness. Using the position information of the facial components obtained during the face detection stage, facial features are extracted from the photos or videos that have undergone this preprocessing.

 

How are the extracted facial features used?

During the comparison stage, the information on these extracted facial components is either stored in a database (DB) or compared with existing facial data to identify the best match.
We have now examined the process of computer-based facial recognition. Just a few decades ago, the idea of a computer distinguishing between people seemed like a technology far removed from reality. However, with the rapid advancement of computer hardware, software, and artificial intelligence technologies, facial recognition is now widely used in various fields—including smartphones and laptops, as well as access control, financial services, and airport security. Today, the technology that enables computers to recognize human faces is no longer a story of the future but has become a technology that is naturally integrated into our daily lives.

 

About the author