---
title: "Election Digit Scanner"
url: "https://ridwaanhall.com/projects/election-digit-scanner"
markdown: "https://ridwaanhall.com/projects/election-digit-scanner.md"
summary: "Handwritten digit recognition for the 2024 Indonesian presidential election vote recap, using HOG and SVM."
---

# Election Digit Scanner

> Handwritten digit recognition for the 2024 Indonesian presidential election vote recap, using HOG and SVM.

- Category: Machine Learning
- Status: Completed
- Started: June 14, 2024
- Built with: KNN, SVM, Python, HOG
- Source: https://github.com/ridwaanhall/handwritten-digit-recognition-of-the-2024-indonesian-presidential-election-recap

## About

### The problem

Manual entry of handwritten vote tallies in the 2024 Indonesian presidential election recap is slow and error-prone, and one misread digit changes a result.

### The approach

The research uses a dataset of handwritten digit images resized to 64x64 pixels. It extracts Histogram of Oriented Gradients (HOG) features, then classifies with K-Nearest Neighbors and a Support Vector Machine, across 60:40, 70:30 and 80:20 train and test splits.

- HOG with SVM: 97.48%, 97.48% and 97.68% accuracy for the three splits.
- HOG with KNN: 91.35%, 91.65% and 92.25%.
- Without feature extraction, KNN reaches only about 40 to 42% and SVM about 90%.

### The result

HOG with SVM performed best on every split, which shows that the right feature extraction matters more than the classifier alone.

## Features

- **HOG Features**: Edge and gradient features from 64x64 digit images.
- **SVM and KNN**: Two classifiers compared on three train and test splits.
- **Feature Extraction Matters**: SVM climbs from about 90% to over 97% with HOG.

## Tags

Handwriting Recognition, Handwritten Digit Recognition, Sirekap

## Elsewhere

- This page for people: https://ridwaanhall.com/projects/election-digit-scanner
- Index of every page as Markdown: [llms.txt](https://ridwaanhall.com/llms.txt)
