Facial Recognition in a Nutshell

Ashish Singh
4 min readNov 17, 2022

--

Face recognition is a method of identifying or verifying an individual’s identity by using their face. Face recognition systems can identify people in photos, videos, and in real time.

How Does Facial Recognition Works?

Facial recognition reads the geometry of your face.

The distance between your eyes and from your cheekbones to your chin, etc. are calculated.

There are approximately 70–80 distinct points/features that are critical to distinguishing any face aka facial signature (a math equation).

It essentially converts face images into numerical expressions that can then be compared to determine similarity.

Face Detection V/S Facial Recognition

Face detection is the ability to detect the presence of a face in an image or video

Facial recognition is the ability to determine who a face belongs to.

Facial recognition is broken down into two categories — Verification and Identification.

Verification: is one-to-one matching. Verification can determine whether or not two faces belong to the same person.

Identification: is one-to-many matching. Given a single face and a pool of potential matches, identification can tell you who that face belongs to.

A little Deep Dive

Feature Detection: Detect the position, height, width, and dimensions of a nose, eyes, mouth, and so on.

Consider a graph with N dimensions (plotted in 2D) where each dimension represents a different facial distance.

Consider a large number of dots for various people’s noses, eyes, and so on.

To keep things simple, here’s how these characteristics of various individuals might appear at the uber level.

Sideways Facial Signature vs. Front Facing Facial Signature

Consider that the facial data points we have for Naren, Venkata, and Payal are front-facing images.

However, the one we need to identify is a sideways image.

We will graph the facial data points and try to determine who is the best candidate.

K-Nearest-Neighbor (KNN)

It makes classifications or predictions about the grouping of an individual data point based on data proximity.

We can tell the KNN algorithm that we want the three closest points to this new data point.

We do this for each feature on Agent-X’s and then we calculate the Euclidian distance between all points and our target. This paints a very clear picture of who our potential target could be.

We will calculate the Euclidean distance in five dimensions now that we have five feature vectors. The distance formula remains unchanged.

Distance between Venkata and Naren

Distance between all the remaining ones.

How It Detect a Match

We generate a list of potential matches based on the distance and number of occurrences of matches, each with some measure of similarity. We say we didn’t find a match if the similarity is less than a certain threshold (for low false negative and false positive rates). However, if it exceeds the threshold, we can say we found a match with some degree of accuracy.

In the preceding example, Agent-X’s available features match Payal more closely than others, allowing us to detect Agent-X as Payal with some accuracy.

If you’ve been paying attention, you’ll notice that this method could also be used for recommendation engines like “People Also Viewed” and “Recommending Movies in OTT Platform.”

CNN and Facial Recognition

Computing 80 features over a large data set necessitates a large number of computations.
This is where the Convolution Neural Network comes in. Convolution is essentially a filtering mechanism that attempts to reduce dimensions while maintaining accuracy to some extent.

CNN is out of scope of this article. Would write some breif in coming weeks.

--

--

Ashish Singh
Ashish Singh

Written by Ashish Singh

Improving Search Relevance @Microsoft

No responses yet