close

Face Detector Comparison on a Resource-Constrained Device

Face Detection

Face Detector Comparison on a Resource-Constrained Device

Sabina Pokhrel / December 23, 2020

Here we will run a face detector comparison between OpenCV Haar Cascade, Xailient Dectum, Dlib, and MTCNN Face detectors on a low-powered, resource-constrained device.

The face detector is one of the most commonly used AI components today. Whether you are building a system to count the number of people in a room or a home security system that unlocks the door when you reach your front door, you need a face detector.

Given an image, a face detector locates the faces present in the image and gives the coordinates of each face present in the image.

There are tons of face detectors that are available, and honestly, it might be quite overwhelming for you to decide which one would be best for your project. There is no one right answer.

The choice of face detector depends on the requirements of your project such as the available resources and target inference speed.

In this post, I will do a comparison of the four cutting-edge face detectors that are available today: OpenCV Haar Cascade, Xailient, Dlib, and MTCNN. I will also give code for each of the face detectors so you can either repeat the comparison or use it as a kick-starter for your project.

Face Detector Comparison

For the comparison between OpenCV Haar Cascade, Xailient, Dlib, and MTCNN Face detectors, I used a Raspberry Pi 3B+, with Raspbian Buster as the operating system. Test videos used for these experiments were downloaded from Pexels.com.

Here’s a video of comparison results for the four face detectors.

Real-Time Face Detection Comparison | OpenCV Haar Cascade, Dlib, Xailient Face Detector and MTCNN

Below are the scripts I used for running each of the face detectors.

OpenCV Haar Cascade

To set up, install the required Python libraries using pip command.

I used OpenCV version 4.1.0 for this experiment.

Here is the code for face detection using OpenCV Haar Cascade:

Dlib

To set up, install the required Python libraries using pip command.

I used OpenCV version 4.1.0 for this experiment.

Here is the code for face detection using Dlib:

Xailient

To set up, install the required Python libraries using pip command.

I used OpenCV version 4.1.0 for this experiment and installed the Xailient Face detector.

Here is the code for face detection using Xailient:

MTCNN

To set up, install the required Python libraries using pip command.

I used OpenCV version 4.1.0 for this experiment.

Here is the code for face detection using MTCNN:

Comparison Results

Here are the results from our face detector comparison, listing each in descending order of their performance (best is on the top of the list):

  1. Xailient Face Detector
  2. OpenCV Haar Cascade Face Detector
  3. Dlib Face Detector
  4. MTCNN Face Detector

Xailient Face Detector ran 16 times faster than OpenCV Haar Cascade Face Detector using only 1/4 of the resources with better qualitative accuracy.

Xailient Face Detector ran 80 times faster than Dlib Face Detector using the same amount of resources with similar qualitative accuracy.

Xailient Face Detector ran 80 times faster than MTCNN Face Detector using only 1/4 of the resources with similar qualitative accuracy.

Spread the love

About the Author

    Sabina is an AI Specialist and Machine Learning Engineer. She is a Writer and a former Editorial Associate at Towards Data Science.

Trusted by

Xailient’s commercial partners

Press releases

March 14, 2022

Xailient specializes in extremely efficient low-power computer vision. Intel's OpenVINO specializes in maximizing the performance and speed of computer vision AI workloads. OpenVINO improved Xailient FPS 9.5x on Intel hardware to 448 FPS. Together, Xailient-Intel outperforms the comparable MobileNet_SSD by 80x. Even after Intel worked the OpenVINO magic on MobileNet_SSD, Xailient-OpenVINO is 14x faster.

November 29, 2021

Xailient’s Face Recognition enables high-speed edge AI processing with low-power consumption using Sony’s IMX500 – a chip so small it can fit on the tip of your finger.

OnEdge Newsletter

A weekly newsletter with the best hand-picked resources about Edge AI and Computer Vision

OnEdge is a free weekly newsletter that keeps you ahead of the curve on low-powered Edge devices and computer vision AI.

 

You’ll get insights and resources into:

  • Edge computing use cases.
  • Market trends in Edge computing.
  • Computer Vision AI at the Edge.
  • Machine learning at the Edge.
Cookie Policy