
CNN-based Persian Digit Recognizer (PyTorch)
/ 1 min read
Table of Contents
Role
Developer - AI/ML Project
Project Summary
This project delivers a full Persian digit recognition pipeline (0..9) with a custom PyTorch CNN and reproducible CLI workflows.
I implemented dataset preparation, model training, evaluation, and single-image inference scripts in one clean project structure.
Repository
CNN-based-Persian-digit-recognizer-built-with-PyTorch
What We Built
- Custom model
PersianDigitCNNfor 10-class classification. - HODA dataset preparation pipeline with automated output generation.
- Training workflow with checkpointing and run metrics.
- Evaluation workflow on validation/test splits.
- Prediction script for single-image inference (
top-koutput). - Confusion matrix generation for validation and test analysis.
Model & Training Setup
- Architecture:
Conv(1->32) + BatchNorm + ReLU + MaxPoolConv(32->64) + BatchNorm + ReLU + MaxPoolConv(64->128) + BatchNorm + ReLU + MaxPoolAdaptiveAvgPool(3x3)Linear(1152->256) + ReLU + Dropout(0.3) + Linear(256->10)
- Loss:
CrossEntropyLoss - Optimizer:
AdamW - Dataset: HODA
Results
- Best validation accuracy: 99.76%
- Test accuracy: 99.56%
- Test loss: 0.0169
Confusion Matrices
Skills
- AI
- Python
- Deep Learning
- PyTorch
- Computer Vision
- CNN Architecture
- Model Evaluation