All Projects

Face Blurring.

Haar Cascade vs. a YOLOv8 model trained from scratch on a custom Roboflow dataset — the research project behind Blurify.AI.

Computer VisionArchivedHaar · YOLOv8n3,283 imgs (Roboflow)3Colab GPU
3,283
Total images
2871 / 267 / 145
Train / Val / Test
0.67
Cross-model IoU
v8-nano
YOLO base

Overview

Motivation

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.

Evaluation

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.

Next

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.

  1. 01
    Roboflow dataset

    3,283 annotated faces

  2. 02
    Haar / YOLOv8n

    two competing detectors

  3. 03
    Gaussian blur

    per detected face box

Fig. 1Faces detected and blurred, original image untouched elsewhere

Stack

OpenCV Haar Cascadeoff-the-shelf frontal-face classifierYOLOv8n (ultralytics)trained from scratch on ColabRoboflowannotated face-detection dataset

Reproduce it

Local (tested on Windows)
$ 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