Monitoring Performance for Face Recognition Models

Monitoring Performance for Face Recognition Models

By Contributing Writer
Gilad David Maayan
  |  November 30, 2022



What Is Facial Recognition?

Facial recognition is a method of identifying or verifying a person's identity by evaluating an image of their face. It is possible to identify people in real time using photos or videos with the aid of facial recognition technology.

This technology is currently being used in various fields. For example, many smartphones are equipped with biometric authentication—allowing them to be unlocked by recognizing the owner's face. Facial recognition is one area of biometric security—other areas include speech recognition, fingerprint recognition, and eye retina recognition.

Although the technology is primarily used for security, there is growing interest in other applications. Face recognition technology commonly uses deep learning algorithms to identify faces and match them against a database of known individuals.

How Does Facial Recognition Work?

Face recognition uses artificial intelligence algorithms and machine learning to detect faces. The algorithm typically starts by searching for the human eye and then searches for the eyebrows, nose, mouth, nostrils, and iris. Once all facial features are captured, they are further validated using large data sets of positive and negative images to confirm that they are human faces.

Common techniques for face recognition include feature-based, shape-based, knowledge-based, and template matching. Each of these methods has advantages and disadvantages:

  • Feature-based methods detect faces based on features such as eyes and nose. Results from this method may vary due to noise and light. Appearance-based methods also use statistical analysis and machine learning to match features of facial images.
  • Knowledge-based methods recognize faces according to predefined rules. This can be difficult given the effort required to define well-defined rules.
  • Template matching methods detect faces by comparing the image to previously stored facial patterns or features and correlating the results. However, this approach cannot accommodate changes in size, posture or shape.

What Are Face Datasets?

Image datasets contain digital images designed to help train, test, and evaluate artificial intelligence (AI) or machine learning (ML) algorithms (typically computer vision algorithms).

Face datasets are image datasets with face images curated for ML projects. They are a key building blocks of facial recognition technology. Instead of collecting your own training data, you can use one of several publicly available face datasets. Managing and optimizing machine learning datasets is one of the key steps in the Machine Learning Operations (MLOps) pipeline.

Face datasets typically provide images of faces in different locations and lighting conditions that represent human emotions, ethnicity, age, or other characteristics.

How to Monitor Your Face Recognition Model

A model is the most crucial element to monitor, as it is the heart of the entire production system. Monitor model performance in production, security threats, components, and software versions.

Monitoring Model Drift

Model drift, also known as concept drift, occurs in both supervised and unsupervised learning solutions. It happens when learned patterns change over time, such that the relationships between features and labels are no longer maintained. This causes models to consistently return unreliable and inaccurate results compared to benchmarks and business metrics or KPIs.

For example, consider a model that classifies cars. Initially, the model is trained on car models currently on the road, and might be very accurate. Over time, as new car models are released, the model will become less accurate, because it will have difficulty identifying new and unfamiliar car models.

Model drift occurs because the real world changes—in other words, the real data distribution which the model is trained to predict. In most fields, the answer to a business question is constantly evolving, and models must be able to reflect this.

Model drift is often gradual, such as when the business environment changes naturally. In some cases, it can be sudden, such as when an extreme event abruptly changes the data observed by the model.

Possible solutions when detecting concept or model drift:

  • Continuous monitoring and retraining of deployed models based on new business realities. If you have frequently changing business goals and circumstances, you might consider automating the system and schedule retraining at specified intervals.
  • If retraining the model does not improve performance, consider rebuilding or redeveloping the model from scratch.
  • If you are working on a large project and do not have budget constraints, consider using online learning algorithms.

Monitoring for Concerted Adversaries

All businesses face security threats. As machine learning applications become key decision-making systems for most companies, there are growing concerns about their security. Most ML models are vulnerable to adversarial attacks.

This risk is especially common for ML applications in financial and credit risk institutions. For example, a scammer may be trying to trick a model, which is supposed to detect suspicious credit card transactions, into thinking that a transaction is legitimate.

Concerted adversaries are hackers who deliberately intervene in machine learning systems. They can mislead a system by providing fake examples, leading it to produce unreliable results and make mistakes.

You can monitor an ML system for malicious attacks by detecting out-of-distribution problems, by performing a statistical distance test on a single event or a few recent events. You can also classify the model’s inputs and predictions using unsupervised learning to detect anomalous inputs. Some platforms leverage AutoML to automatically detect outliers.

Methods and algorithms that can protect models from hostile threats are being explored, but research is still in its infancy. Therefore, currently it is necessary to send detected anomalies to a human overseer to identify attacks. Experts on the subject matter can investigate problematic cases and identify inappropriate inputs to protect the ML model from further threats.

Monitoring for System Performance

Running an MLsolution in production is an infrastructure issue. It doesn’t make sense to monitor model predictive performance without monitoring infrastructure performance. The infrastructure is the foundation for successfully deploying and maintaining machine learning solutions.

System/application performance monitoring can determine whether the ML model meets uptime requirements, is processing requests fast enough, is using resources efficiently, what are its code dependencies, and whether it is able to scale up if needed.

The most common performance metrics to monitor model performance are:

  • CPU/GPU utilization—indicates what level of resources the model consumes per request.
  • Memory utilization—indicates when the model caches data in memory to improve I/O performance, and is running out of memory.
  • Request failed—number of requests that failed due to events/tasks.
  • Total number of API calls—volume of requests handled by the service.
  • Response time—the response time of the prediction service or model server.

Conclusion

In this article, I explained the basics of face recognition and provided three best practices for effectively monitoring your face recognition models in production:

  • Monitoring model drift - identifying if real-world changes to the data are reducing performance of the model.
  • Monitoring for concerted adversaries - a growing threat to ML systems is hackers who deliberately intervene in machine learning systems. Monitoring is critical for detecting and stopping them.
  • Monitoring for system performance - an ML model runs on infrastructure, and it is critical to ensure uptime and performance of these systems.

I hope this will be useful as you improve the performance of your face recognition models.


 
Get stories like this delivered straight to your inbox. [Free eNews Subscription]