AI & intelligence / PROJECT NOTES
Handwritten Digit Classifier (Custom SVM)
Trained a custom SVM model exclusively on my own handwritten digits — data collection, feature extraction, and inference all built from scratch.
01 / OVERVIEW
The idea behind it.
End-to-end machine learning project where the training data is entirely self-collected handwriting samples of digits 0–9. Captured samples using a drawing canvas, preprocessed the images (grayscale, thresholding, normalization, HOG feature extraction), then trained a multi-class Support Vector Machine with a tuned RBF kernel. The result is a classifier that recognizes my specific handwriting style. Includes a live inference interface where you draw a digit and the model predicts it in real time.
02 / FEATURES
What it does.
- 01Self-collected training dataset of handwritten digits 0–9
- 02Image preprocessing pipeline: grayscale, thresholding, resize, normalization
- 03HOG (Histogram of Oriented Gradients) feature extraction
- 04Multi-class SVM with RBF kernel and hyperparameter tuning via GridSearchCV
- 05Live drawing canvas for real-time digit prediction
- 06Confusion matrix and per-class accuracy visualization
03 / CHALLENGES
The problems worth solving.
- 01Collecting enough varied handwriting samples per class for generalization
- 02Choosing and tuning the right feature descriptor (HOG vs raw pixels)
- 03Handling class imbalance across digits in the self-built dataset
- 04Tuning C and gamma hyperparameters without overfitting to personal writing style
04 / LEARNINGS
What I took away.
- 01Full ML pipeline: data collection → preprocessing → feature engineering → training → evaluation
- 02How SVMs use kernel functions to separate non-linearly separable classes
- 03HOG feature extraction and why spatial gradient histograms outperform raw pixels for digit recognition
- 04Hyperparameter search with GridSearchCV and cross-validation
- 05Bias introduced by training on a single person's handwriting
- 06OpenCV image preprocessing techniques for ML input preparation
KEEP EXPLORING