High-Performance Lightweight Face Recognition Technology and Application Scenarios Without Any Deep Learning Framework (Source Code Included)

↑ ClickBlue Text Follow the Open Source Workshop for Machine VisionAccess to Papers and Source Code

While traditional face detection algorithms struggle with processing speeds of only a few dozen frames per second, an open-source project is redefining industry standards with an astonishing1500 FPS ultra-high speed and54K parameters of extreme lightweight. The libfacedetection project, with its groundbreaking technology, not only surpasses traditional solutions like OpenCV but also achieves real-time detection across all platforms from CPUs to embedded devices. Behind these impressive numbers lies a revolutionary innovation in algorithm design: the54K parameters are only1/20 the size of an ordinary photo, yet it can achieve millisecond-level face localization, while the1500 FPS processing speed means that over1500 faces can be accurately detected per second on a regular computer, a performance that even professional GPU solutions cannot match.

Core Breakthrough: Dual Engine

  • Ultra-Lightweight Architecture The YuNet algorithm with 54K parameters achieves a 40% model compression compared to earlier versions (85K parameters), while increasing detection speed by 50%, perfectly addressing the pain point of traditional algorithms where “large models = high computing power demand.” This project redefines industry standards with its “extreme lightweight” approach: the INT8 model file is only 800KB, yet it can achieve over 1500+ FPS detection speed on an Intel i7 CPU, and also achieve millisecond-level response on embedded devices like Raspberry Pi. This “framework-free” design and cross-platform capability make it an ideal choice for edge scenarios such as security monitoring and smart hardware, truly bringing high-precision face detection from the cloud to end devices.
  • Full Platform Deployment Capability

    As a benchmark in the lightweight face detection field, its core advantage lies innot relying on any deep learning framework, requiring only1500 lines of C++ code to compile acrossWindows, Linux, ARM, etc., achieving hardware acceleration throughIntel AVX2,ARM NEON, and otherSIMD instruction sets. It has already been implemented in some large well-known enterprises.

High-Performance Lightweight Face Recognition Technology and Application Scenarios Without Any Deep Learning Framework (Source Code Included)

Core Innovation Highlights

Core Breakthrough: By optimizing the Anchor-free mechanism and EIoU loss function, it achieves detection of extremely small faces at 10x10px scale with 54K parameters, while supporting five-point keypoint localization (eyes, nose, mouth corners), balancing detection accuracy and deployment efficiency.

Ultra-Lightweight Model: The Parameter Revolution from 2340K to 54K

Parameter compression by 30 times, yet accuracy improves? The ultra-lightweight model of libfacedetection provides a positive answer. Through dual optimization of “model structure pruning + weight quantization,” this model merges convolutional layers and batch normalization layers into a single layer, using float data types to eliminate quantization conversion overhead, reducing the parameter count from the previous version of 2340K to 54K, only 1/30 of the original. On the WIDER Face dataset, the latest YuNet-s model achieves an AP_easy of 0.887, surpassing the earlier 2340K version’s 0.849, achieving a breakthrough of “small yet precise.”

Model Version Parameter Count WIDER Face AP (Easy) File Size
Early Version 2340K 0.849 3.34M
Intermediate Optimized Version 85K 0.856 800KB
Latest YuNet-s 54K 0.887 Less than 1MB

Hardware Acceleration: Full Platform “Speeding” from CPU to Embedded

“Without a GPU, how can a CPU achieve 1500FPS?” The answer provided by libfacedetection isdeep optimization of SIMD instruction sets. By implementing data parallel computation through AVX2 (Intel CPU), NEON (ARM platform), etc., such as AVX2 processing 8 data simultaneously, combined with INT8 quantization technology, pure CPU performance achieves “speeding.” Compared to OpenCV Haar (81 FPS) and MTCNN (15.5 FPS), the speed difference is significant, with actual measured speed tables (FPS data at different resolutions and platforms) inserted.

Hardware Platform Resolution Multi-threaded FPS
Intel i7-7700 (X64 CPU) 128×96 1562.1
Intel i7-7700 (X64 CPU) 320×240 250.4
Raspberry Pi 3 B+ (ARM Cortex-A53) 160×120 102.58
Raspberry Pi 3 B+ (ARM Cortex-A53) 320×240 23.74

Full Platform Coverage Capability: From Intel AVX512/AVX2 to ARM NEON instruction sets, this project can achieve real-time detection on Windows, Linux, and embedded devices (such as JETSON-ORIN-NX, Raspberry Pi) without a GPU, capable of recognizing faces as small as 12×12 pixels, balancing speed and accuracy.

Algorithm Architecture: Dual Breakthrough of Anchor-free and EIoU

From “Anchor Box Dependency” to “Anchor-free Freedom”: A Generational Leap in Algorithm Architecture

The YuNet algorithm architecture of libfacedetection achieves two core breakthroughs. TheAnchor-free mechanism significantly reduces computational redundancy by abandoning traditional anchor-based designs and optimizing the positive and negative sample matching logic, improving inference speed by 20% compared to the second version architecture. TheEIoU loss function enhances localization accuracy through systematic IoU-related methods, improving the AP_easy on the Wider Face dataset from 0.834 to 0.856, AP_medium from 0.824 to 0.842, and AP_hard from 0.708 to 0.727, all while maintaining the same computational load. The dual optimization allows the model to accurately detect10×10 pixel extremely small faces, while simultaneously outputting face locations, confidence levels, and coordinates of 5 key points.

Technical Highlights

  • Anchor-free mechanism: Eliminates anchor box generation redundancy, simplifying model logic
  • EIoU loss function: Improves localization accuracy by 2% compared to traditional methods, significantly enhancing hard sample detection performance
  • Scene Adaptability: Supports detection of faces as small as 10×10 pixels, balancing accuracy and lightweight design

Engineering Optimization: Seamless Transition from Laboratory to Production Line

libfacedetection focuses on the challenges of algorithm implementation, reducing inference steps by merging convolutional layers with BN layers, and combining INT8 quantization technology to reduce memory usage by 40%, optimizing deployment efficiency from the ground up. Developers only need to call 1 API to simultaneously obtain face boxes and 5 key points, combined with a pure C/C++ zero-dependency design (no third-party frameworks required, only a C++ compiler for cross-platform deployment), truly achieving a seamless transition from laboratory models to production applications.

Core Advantages: Dual support from technical optimization (layer fusion + quantization) and a minimalist interface (single API with multiple outputs), allowing thousands of lines of code to be directly embedded into projects, widely applied in video surveillance chips, face recognition terminals, and other mass production scenarios.

Applicable Scenarios

Security Monitoring: From “Post-Event Review” to “Real-Time Warning”

In crowded places such as shopping malls and train stations, traditional security monitoring often falls into a passive state due to reliance on “post-event video review.” libfacedetection breaks through this with “CPU real-time processing + multi-threaded concurrency” technology, enabling low-cost deployment that upgrades security from passive tracing to proactive warning.

Core Performance: A single camera can simultaneously track over 30 faces in a 1080P video stream. In tests under Ubuntu with 15 people in a photo (970×546 resolution), CPU processing took only 133ms with a detection confidence of 99%. The ultra-high-speed processing capability of over 1500+ FPS allows for real-time analysis of large-scale video streams, significantly improving public safety response efficiency.

Smart Hardware: The “Power Consumption Revolution” for Mobile Face Unlock

Mobile users’ “battery anxiety” finally has a solution—libfacedetection achieves low-power face unlocking on smart hardware throughultra-lightweight models (only 54K parameters) and NEON instruction optimization. Each unlock consumes only0.5mAh of battery, and combined with hardware acceleration features, power consumption is reduced by 65% compared to traditional solutions. For example, the front camera of Xiaomi Redmi Note series phones uses this algorithm, allowing users to enjoy fast face unlocking without worrying about battery drain.

Core Advantages: Ultra-lightweight model (54K parameters) + NEON instruction optimization, achieving an ultra-low power consumption of 0.5mAh per unlock, with power consumption reduced by 65% after application in Xiaomi Redmi Note series, balancing unlocking speed and battery performance.

Embedded Systems: “16-channel Concurrent Detection” on Raspberry Pi

Addressing the core challenge of limited resources in embedded devices, libfacedetection achieves deep adaptation to ARM architecture through a dependency-free compilation design and memory optimization technology. On low-cost hardware like Raspberry Pi, its lightweight advantages are particularly prominent: the Raspberry Pi 3B+ development board (retail price 280 yuan) can process 160×120 resolution images in real-time on a single core, with the minimum face detection size reaching 12×12 pixels, and multi-threaded FPS reaching 163.5 at 128×96 resolution.

Upgrading to the Raspberry Pi 4B platform, this project achieves 16-channel video stream concurrent detection with an average latency of only 72ms, successfully supporting real-time tracking needs of family members in smart home gateway scenarios, combined with NEON instruction set acceleration and code portability.

Key Performance Indicators: On 280 yuan level embedded hardware, simultaneously meeting the three demands of “16-channel concurrent processing + 72ms low latency + 12-pixel small face detection,” providing a high-cost performance solution for edge computing scenarios.

AR/VR: The “Expression Capture Tool” for Virtual Anchors

In the wave of the metaverse and virtual idols, libfacedetection is becoming a powerful tool for expression capture for virtual anchors. Its core five-point face keypoint detection technology can accurately lock onto key facial coordinates such as eyes, nose, and mouth, combined with low-latency inference algorithms to achieve natural expression driving for virtual images. This technology has been deeply integrated with the Unity engine and widely used in virtual anchor live streaming systems.

After integration with a certain virtual anchor platform, the accuracy of expression capture significantly improved to 98%, making the emotions of virtual images more infectious and providing viewers with a more immersive interactive experience.

Source Code Access

Open Source Address: https://github.com/ShiqiYu/libfacedetection

Reply “libfacedetection” in the backend of the machine vision open-source workshop to get the Baidu Netdisk download link

End

Friends in the machine vision industry canprivate message in the public account [Join Group]

Join the Machine Vision Exchange Group, to get the latest technical sharing, project exchanges, industry trends and more! Advertisers please refrain from entering, do not trust private messages to avoid scams.

High-Performance Lightweight Face Recognition Technology and Application Scenarios Without Any Deep Learning Framework (Source Code Included)

Reply “Open Source Collection” to get a compilation of 100+ open-source upper computer, vision frameworks, and industrial AI resources

Recommended Articles

ZeroStereo: Industrial Vision Detection – From Single Image to Accurate Stereo Matching

DINO Teacher Framework, a new solution to the “missed detection” problem in industrial vision detection!

A New Paradigm for Industrial Vision Detection! DeCLIP: A General Open Vocabulary Dense Perception Framework

No training required! Achieve high-precision instance segmentation across scenes based on reference images!

#Lightweight Face Detection, #Real-Time Face Recognition, #SIMD Instruction Optimization,

#Anchor-free Algorithm,#Embedded Systems, #Edge Computing#libfacedetection, #Open Source Project

Copyright Statement: The above images, texts, and data materials are cited from the internet and are for learning and communication purposes only. If there are any issues, please contact for removal;

Leave a Comment