Skip to content
All projects

Ensemble Facial Recognition & ONNX Pipeline

A heterogeneous Machine Learning pipeline that aggregates SVM, Random Forest, and CNN architectures via soft-voting to classify facial datasets, featuring automated ONNX graph serialization.

Performance & metrics

  • Significantly reduces spatial overfitting by aggregating high-bias traditional classifiers with deep spatial feature extractors
  • ONNX serialization eliminates the heavy TensorFlow runtime requirement for downstream inference applications

Why I built it

This pipeline was explicitly designed as the downstream classification engine for the facial datasets extracted by my OpenCV-Face-Features-Toolkit-For-ML-cpp project. Relying on a single ML architecture for facial recognition often leads to spatial overfitting or variance issues. I engineered this ensemble approach to mitigate individual model biases by mathematically aggregating predictions from both traditional statistical models (SVM/RF) and deep spatial feature extractors (CNN).

Architecture & decisions

The ingestion layer normalizes input matrices to 100x100 grayscale arrays. Because Scikit-Learn and TensorFlow expect different tensor geometries (1D flattened arrays vs. 2D spatial tensors), I implemented a custom KerasClassifierWrapper inheriting from BaseEstimator and ClassifierMixin. This seamlessly injects the TF/Keras computational graph into a Scikit-Learn VotingClassifier. The ensemble computes probability distributions (predict_proba) via a soft-voting mechanism. Finally, the models are serialized into ONNX format (opsets 9 and 11) to entirely decouple the inference engine from the Python/TensorFlow runtime for potential C++ edge deployment.

Key features

  • Direct ingestion and classification of normalized datasets generated by the OpenCV-Face-Features-Toolkit-For-ML-cpp utility
  • Custom BaseEstimator bridging layer to orchestrate TensorFlow CNNs within Scikit-Learn ensemble pipelines
  • Soft-voting ensemble classifier calculating maximum likelihood across SVM, Random Forest, and CNN probability distributions
  • Automated ONNX graph serialization pipeline for cross-platform, runtime-agnostic inference

AI & ML

WaifuChat (Local AI)

A personal AI assistant that uses local LLM models (DeepSeek), requires no internet connection, and runs entirely on-device.

  • Rust
  • Tauri
  • DeepSeek-R1
  • +1

AI & ML

Private

Biometric Authentication & ML.NET Client

A secure desktop client integrating real-time OpenCV facial bounding, ML.NET deep learning inference, and Firebase for biometric two-factor authentication.

  • C#
  • Windows Forms
  • ML.NET
  • +4

Need something similar?

I can build a system like this for you, too.

Describe your project in a few sentences, and we'll work out the right approach and an estimated scope together.