DEV Community

TildAlice
TildAlice

Posted on • Originally published at tildalice.io

Haar Cascade to YOLOv8 Face Detection: 4.2x Speed Gain

The 2007 Algorithm That Quietly Runs in Production

Haar Cascades still power face detection in more production systems than you'd expect. OpenCV ships them by default, tutorials lean on them because setup takes three lines, and they run on a Raspberry Pi without breaking a sweat. But at some point, you hit the wall: false positives on tilted faces, missed detections in poor lighting, or inference that chokes when you scale from webcam demos to batch processing thousands of images.

I migrated a production face detection pipeline from OpenCV's haarcascade_frontalface_default.xml to YOLOv8n-face. The result: 4.2x faster inference on CPU, 89% mAP50 vs 67% on our validation set, and a 60% drop in false positives. This isn't a "deep learning is magic" post — YOLOv8 brought its own headaches, from preprocessing quirks to model export pitfalls I wish someone had documented.

Here's what actually changed, what broke, and when you should (or shouldn't) make the jump.

Conceptual portrait with laser scanning for facial recognition on plain black background.

Photo by cottonbro studio on Pexels

Why Haar Cascades Break in Real Scenarios


Continue reading the full article on TildAlice

Top comments (0)