Face Blurring.
Haar Cascade vs. a YOLOv8 model trained from scratch on a custom Roboflow dataset — the research project behind Blurify.AI.
Overview
Haar Cascade struggles with rotation
OpenCV's built-in Haar Cascade classifier needs no training, but by the author's own assessment it "is not performing very well" once a face has any rotation. That gap is the direct reason a YOLOv8-nano model was trained from scratch on a custom-annotated Roboflow dataset instead of fine-tuning an off-the-shelf detector.
An honest number, and an honest limitation
The two detectors agree on 0.67 IoU against each other on a shared test image — that's model-to-model agreement, not accuracy against ground truth. The author documents that the ground-truth evaluation pipeline itself was broken: bounding-box coordinate ranges didn't match between predictions and annotations, and rescaling attempts didn't resolve it, so no verified precision/recall exists for either model.
This project is kept as the research/training repo — Blurify.AI is the deployable Streamlit app built on top of it once both detectors were working.
Documented future work
- Explore MTCNN as a third detector for comparison
- Explore adversarial blurring approaches
- Extend beyond faces to other sensitive regions (license plates, ID numbers)
Method
Two independent face detectors feed the same downstream step: blur every detected face region and leave the rest of the image untouched.
- 01Roboflow dataset
3,283 annotated faces
- 02Haar / YOLOv8n
two competing detectors
- 03Gaussian blur
per detected face box
Results
Stack
Reproduce it
$ git clone https://github.com/baselhusam/Face-Blurring.git$ pip install -r requirements.txt$ python FB_CascadeClassifier.py <image path> # saves cascade_output.jpg$ python FB_YOLO.py <image path> # saves Yolo_output.jpg