Default HubSpot Blog

How to build a face recognition system?

Written by ADVANCE.AI | Jul 9, 2021 10:28:11 AM

A face recognition system is a technology capable of matching a human face from a digital image against a database of faces, typically employed to authenticate users in ID verification services. This technology is steadily making its way into people's daily lives. It is widely used to unlock smartphone screens, tag faces in social media posts, enhance public safety, prevent fraud, and improve customer experience. Below are just a few examples of what the face recognition system can do.

 

How does face recognition work?

Facial recognition systems use computer algorithms to pick out specific, distinctive details about a person's face. These details, such as distance between the eyes or shape of the chin, are then converted into a mathematical representation and compared to data on other faces collected in a face recognition database. The data about a particular face is often called a "face template", which is distinct from a photograph because it is designed to only include certain details that can be used to distinguish one face from another.

Face recognition primarily involves face detection, feature extraction, and face match against databases.

Step 1: Face detection

Identify facial features using filtering techniques and filter them with accurate classifiers in the input image. Note that translation, zooming, and rotation must all be performed in this step.

Step 2: Feature extraction

Locate the facial landmarks and represent their locations in the form of numerical codes. These numerical codes are faceprints unique to a person.

Step 3: Face match

Match the face against a database of faces using the Euclidean distance formula, sort the Euclidean distances, and set a threshold to filter out unmatched faces.

 

Face recognition challenge: how to build a large-scale database

We mentioned algorithms above. Now, let's look at the difficulties engineers have to overcome in building a face recognition system.

The No. 1 difficulty is to tackle the scaling issue. It usually becomes more complicated when databases swell into millions of entries. To build a face recognition system that contains 100 million face images requires different solutions from a system with 100 face images.

Large-scale face recognition systems are subject to the following requirements:

  • Speed: The real-time response speed (300ms to 3s) is usually determined by database size and recognition-irrelevant tasks. The search speed depends on the user's CPU; yet memory is another factor as users tend to cache all facial data in memory to avoid disk drive IO overhead. The best balance is calculated based on both the target speed and the estimated data set size.

  • Sharding: Data is usually partitioned and spread over multiple nodes in order to support large data sets and high-throughput operations. The challenges for engineers here are how to reasonably distribute the data without impacting the overall system latency and how to do auto re-sharding when a node is added at runtime.

  • Dynamic database: Depending on the use cases, the face database might be growing apace. For example, ADVANCE.AI's ADVANCE Face Search service inserts faces from every request into the database. The system should react if available RAM in any node is low by automatically adding a new node.

  • Data persistence and recovery: Facial data should not be merely cached in memory but kept in persistent storage. If a node is disconnected, the system should be able to recover it at a later stage.

  • Availability: The system should continue operation when a subset of nodes is experiencing failures.

  • Node management: Since data is spread across multiple nodes, we need a mechanism to identify and manage the nodes in the cluster to perform node addition, failover and data sharding.

  • Rolling update: How to support the face recognition service's rolling update without impacting the connected client applications imposes another challenge on the engineering capability. 

ADVANCE.AI's independently developed face recognition engine, an infrastructural component supporting face recognition, provides standard service to other intelligent products that are based on face recognition technology.

ADVANCE.AI's face recognition engine offers a variety of customization options for different business contexts. For example, client applications can build and search multiple databases in one request. They can also associate custom attributes to data entries, like applying a timestamp to each entry. The client application can then limit the search to a certain time range and add filtering logic executed directly within the engine to remove irrelevant matches.

 

Facilitating eKYC adoption through the face recognition system

In the digital era, banks and financial institutions are required to adopt modern and reliable electronic Know Your Customer processes (eKYC) to satisfy customer's all-digital experience and meet evolving regulations while protecting users against online fraud. Meanwhile, the increased risk of data breaches coupled with customer demand for all-digital onboarding processes, rising mobile phone penetration, and security concerns among customers, is expected to speed up the development of identification technologies worldwide.

Nowadays, despite a wide selection of applicable technologies, face recognition technology remains the most commonly used approach to eKYC. The increasing use of face recognition in the banking industry echoes the requirements of some newly introduced regulations, which encourages the wider adoption of eKYC.