Custom Viola-Jones Face Detection from Scratch

Custom Viola-Jones Face Detection from Scratch

external-link

Mar 2026

Finished

Full from-scratch implementation of the Viola-Jones face detection framework. The cascade classifier is trained stage-by-stage using AdaBoost on Haar-like features with hard negative mining. The detector supports parallel execution via Numba JIT compilation (5-10x inference speedup) with a ThreadPoolExecutor fallback. Trained on WIDER FACE dataset with 15,000 face samples. Best cascades reach 28 stages with 0.999 TPR. Includes real-time webcam detection, XML serialization compatible with OpenCV, and comprehensive Jupyter notebooks for ROC analysis and cascade inspection.

Technologies
ai

AI

jupyter

Jupyter

latex

LaTeX

matplot

Matplot

numpy

NumPy

opencv

OpenCV

pandas

Pandas

plotly

Plotly

python

Python

sklearn

Sklearn

https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/FP-TP-Progresion_169.png?v=35d199aa95b261fa415d3ca75323f30e0bc26db9
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/base-filters_169.png?v=a375b7b54b72ff259bfabd5928e63bcc63b9e658
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/first-Stage_169.png?v=8fb0edfd4bc31c0f03d3e8bbbd4d101c969a3b89
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/output (1)_169.png?v=c302807f5133c0a7a8716bae7ad5ea499c267302
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/output (2)_169.png?v=fdfae8d6bc2e47171af631edbceb9b442ba888b6
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/output (3)_169.png?v=c56bbb7abefc31c3634e91b7b17c6bbe9113c42e
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/output (4)_169.png?v=1c9e5fa0f48838f5f57ab290c144e0b10151bb8d
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/thumbnail_169.png?v=c2ef10b38f73d29d8f60ccefe8c545910caad171
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/ViolaJones-short.gif?v=ea1777735025548ce46612aab811a7f310caeca6
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/FP-TP-Progresion_169.png?v=35d199aa95b261fa415d3ca75323f30e0bc26db9
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/base-filters_169.png?v=a375b7b54b72ff259bfabd5928e63bcc63b9e658
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/first-Stage_169.png?v=8fb0edfd4bc31c0f03d3e8bbbd4d101c969a3b89
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/output (1)_169.png?v=c302807f5133c0a7a8716bae7ad5ea499c267302
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/output (2)_169.png?v=fdfae8d6bc2e47171af631edbceb9b442ba888b6
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/output (3)_169.png?v=c56bbb7abefc31c3634e91b7b17c6bbe9113c42e
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/output (4)_169.png?v=1c9e5fa0f48838f5f57ab290c144e0b10151bb8d
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/thumbnail_169.png?v=c2ef10b38f73d29d8f60ccefe8c545910caad171
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/ViolaJones-short.gif?v=ea1777735025548ce46612aab811a7f310caeca6
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/FP-TP-Progresion_169.png?v=35d199aa95b261fa415d3ca75323f30e0bc26db9
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/base-filters_169.png?v=a375b7b54b72ff259bfabd5928e63bcc63b9e658
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/first-Stage_169.png?v=8fb0edfd4bc31c0f03d3e8bbbd4d101c969a3b89
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/output (1)_169.png?v=c302807f5133c0a7a8716bae7ad5ea499c267302
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/output (2)_169.png?v=fdfae8d6bc2e47171af631edbceb9b442ba888b6
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/output (3)_169.png?v=c56bbb7abefc31c3634e91b7b17c6bbe9113c42e
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/output (4)_169.png?v=1c9e5fa0f48838f5f57ab290c144e0b10151bb8d
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/thumbnail_169.png?v=c2ef10b38f73d29d8f60ccefe8c545910caad171
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/ViolaJones-short.gif?v=ea1777735025548ce46612aab811a7f310caeca6
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/FP-TP-Progresion_169.png?v=35d199aa95b261fa415d3ca75323f30e0bc26db9
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/base-filters_169.png?v=a375b7b54b72ff259bfabd5928e63bcc63b9e658
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/first-Stage_169.png?v=8fb0edfd4bc31c0f03d3e8bbbd4d101c969a3b89
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/output (1)_169.png?v=c302807f5133c0a7a8716bae7ad5ea499c267302
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/output (2)_169.png?v=fdfae8d6bc2e47171af631edbceb9b442ba888b6
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/output (3)_169.png?v=c56bbb7abefc31c3634e91b7b17c6bbe9113c42e
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/output (4)_169.png?v=1c9e5fa0f48838f5f57ab290c144e0b10151bb8d
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/thumbnail_169.png?v=c2ef10b38f73d29d8f60ccefe8c545910caad171
https://raw.githubusercontent.com/MiquelGomezCorral/BIOM-Face-detection/main/readme_images/ViolaJones-short.gif?v=ea1777735025548ce46612aab811a7f310caeca6