Handcrafted Feature Fusion (HOG + LBP) for MNIST Classification
Classical computer vision ablation comparing HOG, Uniform LBP, and standardized HOG + LBP feature fusion with k-NN (k = 1, 3, 5) on the full 70,000-image MNIST dataset.
Key Performance Metrics
Problem & Objective
Before deep convolutional networks became the default, handwritten digit recognition relied on combining spatial gradient descriptors with local texture statistics. This experiment evaluates how well Histogram of Oriented Gradients (144-dim HOG) and rotation-invariant Uniform Local Binary Patterns (10-dim LBP) complement each other under a non-parametric k-NN classifier. The full 70,000-image MNIST dataset is repartitioned into a stratified 90/10 train/test split (63,000 / 7,000). Each feature set is standardized on the training split and evaluated across k = 1, 3, 5 using accuracy, weighted F1, 10-class One-vs-Rest ROC-AUC, Average Precision, and confusion-matrix error analysis.
Technologies & Tools
Date
Mar 2026
Course
Machine Learning (CIS-621)
Dataset
MNIST (70,000 images, 90/10 stratified split)
Findings
Key observations, empirical takeaways, and analytical conclusions.
- Global Uniform LBP alone (10 bins) discards spatial layout and tops out at 37.23% accuracy (k = 5), confirming texture histograms alone cannot separate handwritten digits.
- Fusing standardized LBP with 144-dim HOG improved accuracy, weighted F1, Macro ROC-AUC, and Macro AP at every tested k (1, 3, and 5), lifting k = 5 accuracy from 95.14% to 95.64%.
- Increasing k from 1 to 5 improved both classification accuracy (94.54% → 95.64%) and probability calibration (Macro ROC-AUC 0.9695 → 0.9928, Macro AP 0.9002 → 0.9749).
- Error analysis on the 7,000 test digits showed mistakes concentrated in visually similar stroke pairs — 4 → 9 (30), 7 → 9 (27), and 2 → 3 (27) — explaining why digit 9 had the lowest Average Precision (0.954) while digit 6 reached 0.994.
Results & Analysis
Feature ablation, 10-class ROC/PR curves, and confusion matrix error breakdown.
Tap to zoom
Test accuracy and Macro One-vs-Rest ROC-AUC comparing LBP Only (10 dims), HOG Only (144 dims), and standardized HOG + LBP fusion (154 dims) across k = 1, 3, and 5.
Tap to zoom
Per-digit One-vs-Rest ROC and Precision-Recall curves for the best HOG + LBP model (k = 5), with AUC ranging from 0.986 (digit 4) to 0.999 (digit 6) and AP from 0.954 (digit 9) to 0.994 (digit 6).
Tap to zoom
Raw prediction counts across all 10 digit classes showing strong diagonal recall (6,695 / 7,000 correct) and top confusions on 4 → 9, 7 → 9, and 2 → 3.