With the rise of deep learning, more and more methods based on deep learning are used in industry and academia, instead of the traditional methods based on template matching, texture extraction or pixel integral graph. Because face detection itself is not a particularly complex task, lightweight deep learning model can meet this task. This article summarizes six open source face detection projects.

Although deep learning is a black box, general object detection algorithms based on deep learning (e.g., truffy-RCNN, SSD, YoloV3, RetinaNet, etc.) are far more effective and robust than traditional computer vision methods based on texture, edge, Harr feature and Sift feature. In recent years, with the progress of model compression and quantization technology, model running speed is getting faster and faster.

As for the general target detection algorithm, take SSD and YoloV3 algorithms commonly used by everyone as an example. Because the algorithm was designed for Pascal VOC or COCO tasks of 20 and 80 classes at the beginning of design, so its backbone network, In other words, feature extraction networks generally use networks such as VGG16, Darknet53 and ResNet18. A common feature of these networks is that the number of convolutional kernels in their convolutional layer is usually large (e.g. 256,512), resulting in tens of millions of model parameters and a huge amount of computation. \

If we use these general target detection algorithms to detect a class of objects, such as only detecting human faces, pedestrians or vehicles, it is unnecessary to use so many convolution kernels and such a deep network. If you want to detect 80 categories, you may need more parameters to fit, but for one or two categories, it is a bit of a dead end. If your task is not complicated, but you use ResNet18\34 network, you will find that many convolution kernels are activated, which is actually 0, resulting in a lot of extra computation. Therefore, for specific face detection tasks, in fact, some very lightweight networks can meet the task requirements.

Yuan feng once wrote an article to introduce his Yu Shiqi teacher’s open source project of face detection, face detection speed of nearly 2000 FPS, just, the hardcore teacher training code open source), there are a number of readers to the work to be questioned, think that model is too small, result in incorrect detection, in the teacher personally appeared to answer everybody’s questions.

For match topping, we can use large models, e.g. an AI company wins on WiderFace with RetinaNet structure, backbone uses ResNet152, FPN structure with multi-model integration arrangement, more anchor group number arrangement. Such a model is very practical for ranking, but it is very impractical in the industry. If you want to deploy it to ARM embedded devices, it will be directly stuck. \

With the arrival of the era of AI landing king, people are paying more and more attention to the trade off between accuracy and speed. This paper selects six lightweight open source face detection projects, and carries on a simple appreciation and introduction to them. \

Without further ado, let’s look at the number of stars on Github in descending order.

1

01

libfacedetection

Making star: 9.3 k \

Author: Yu Shiqi

Link: github.com/ShiqiYu/lib…

Number of model parameters: 2.32 million, volume 3.34M

The project was introduced by Yuan Feng a few days ago. The project uses an SSD architecture for face detection model, which can reach 296.21fps at 320×240 resolution on the Core I7 CPU. Below is an overview of the speed of the project in different resolutions and single thread. * * * *

The model structure is simple as it is a lightweight SSD architecture with four location layers and uses RetinFace’s keypoint approach to return 5 keypoints simultaneously. The volume of the model is only 2.32 million and only 3.34M

The biggest highlight of the project is that teacher yu developed a pure C++ reasoning version, which does not rely on the third party deep learning library, which is very conducive to project deployment.

1

02

Ultra-Light-Fast-Generic-Face-Detector-1MB\

Making star: 4.7 k \

Author: Linzaer * * * *

Link: github.com/Linzaer/Ult…

Volume: 1.04m, INT8 quantized 300KB

This model is a face detection model designed for edge computing devices. Compact network and RFB network are available, with an input resolution of about 90~109 FPS at 320×240.

The structure of this model is very similar to that of Teacher Yu’s model above, which is also an SSD structure and has 4 positioning layers. The model structure is shown in the figure below. \

In addition, the project provides reasoning codes for NCNN, MNN, Caffe, Onnx and Opencv, which can provide a lot of reference samples for deploying the project. \

1

03 

A-Light-and-Fast-Face-Detector-for-Edge-Devices

Github star: 897\

Author: YonghaoHe * * * *

Link: github.com/YonghaoHe/A…

Volume: 6.1m

As can be seen from the name, this model is also a detection model for edge devices, which is also based on SSD architecture. However, compared with the previous two models, this model has eight positioning layers corresponding to four scales, namely Tiny, Small, medium and Large. Backbone network has 25 convolutional layers.

The model achieves 50.92 FPS at 320×240 resolution with Nvidia TX2. \

In addition, the REPO provides codes and models for head detection, pedestrian detection, and vehicle detection.

1

04

CenterFace

Github star: 607\

Author: Star – Clouds, * * * *

Link: github.com/Star-Clouds…

Volume: 7.3m, same precision small model 2.3m

CenterFace is the anchor Free model structure, which should be a special case of CenterNet for face detection task. It is similar to the special case of RetinaFace for RetinaNet in face task, and the model regress five key points. \

The backbone of the network is MobileNetV2, with additional FPN structure. \

Below is CenterFace’s speed, which can be as low as 4.4ms on a 2080TI. Anchor Free model, without the process of NMS, can also save a lot of post-processing time. \

1

05 

DBFace 

Github star: 195\

Author: dlunion * * * *

Link: github.com/dlunion/DBF…

Size: 7.03 M

DBFace is an Anchor Free network structure, and the model principle can be said to be very similar to CenterFace. I won’t go into details here. \

1

06

RetinaFace MobileNet0.25

Github star: Hard to define (6.4K) \

Author: yangfly * * * *

Link: github.com/deepinsight…

Size: 1.68 M

This project comes from the well-known InsightFace project, which has 6.4K star on Github. InsightFace provides the well-known RetinaFace and ArcFace algorithms, as well as the detailed training code and pretraining model, which is a very honest open source project.

But the backbone of RetinaFace itself is ResNet50, yangfly has replaced it with MobileNet0.25, the model size is only 1.68MB. The structure of the RetinaFace model is as follows, the backbone network here is MobileNet 0.25.

According to the author’s open source results, we do a comparative summary of the speed and accuracy of the above six open source lightweight face detection. \

The name of the Model size (MB) Speed (FPS) WiderFace Easy WiderFace Medium WiderFace Hard
libfacedetection 3.34 296 (i7CPU, 320×240) 0.773 0.718 0.485
UltraLightFace 1.04 109 (320 x240) 0.853 0.819 0.539
LightFast 5.81 131 (Titan XP, 640×480) 0.910 0.881 0.780
CenterFace 7.3 227 (2080TI, 640×480) 0.931 0.924 0.870
DBFace 7.03       0.905 0.896 0.794
RetinaFace MobileNet0.25 1.68 0.887 0.87 0.791

In addition, the author of the six framework package download, you only need to reply to the public number in the background “face detection” can download all 6 big framework code and model.

Machine Learning Online Manual Deep Learning online Manual AI Basics download (PDF updated to25Set) site QQ group1003271085To join the wechat group, please reply "Add group" to obtain a discount website knowledge planet coupon, copy the link directly open: HTTPS://t.zsxq.com/yFQV7am like the article, click on it
Copy the code