Computer Vision
Handwritten Character Recognition App
A small handwritten-character recognition application built with EMNIST and PyTorch. It separates dataset loading, CNN training, evaluation, prediction, image preprocessing, and the Pygame drawing interface, while keeping compatibility with an earlier saved model.
Period
May 2025
Tools / Tech
PythonPyTorchTorchvisionCNNEMNISTPygamePillow
Why I built it
The main practical problem was the gap between clean EMNIST training images and uneven drawings from the app. Improving the input pipeline mattered more than simply making the CNN larger.
Links
What it includes
- Supports EMNIST byclass training for digits, uppercase letters, and lowercase letters, with an optional letters-only split.
- Provides separate commands for training, saved-model evaluation, and launching the drawing interface.
- Crops, centers, resizes, and normalizes user drawings to better match the black-background, white-stroke EMNIST format.
- Uses a Pygame grid for drawing, prediction, and clearing the current input.
What I worked on
- Built the original student project, then used AI assistance to reorganize a single-file version into clearer training, inference, preprocessing, and UI modules.
- Adjusted the drawing-to-image conversion after identifying that background color, centering, and scale did not match the training data.
- Kept a compact legacy CNN path for the saved weights and a separate larger CNN definition for further training experiments.
What I Learned
- Learned how strongly inference-time preprocessing can affect a model that works well on its original dataset.
- Practiced separating model code from UI and image-processing code so prediction errors are easier to trace.
- Built a practical foundation for later PyTorch and object-detection competition work.