Why Did I Build This?
"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
- 01.Direct ingestion and classification of normalized datasets generated by the `OpenCV-Face-Features-Toolkit-For-ML-cpp` utility
- 02.Custom `BaseEstimator` bridging layer to orchestrate TensorFlow CNNs within Scikit-Learn ensemble pipelines
- 03.Soft-voting ensemble classifier calculating maximum likelihood across SVM, Random Forest, and CNN probability distributions
- 04.Automated ONNX graph serialization pipeline for cross-platform, runtime-agnostic inference