Downloads · 30 days
35
39% of all-time downloads
Mehdinmz/persian-handwritten-digit-recognition
persian-handwritten-digit-recognition is a image classification model from Mehdinmz. Use it when you need a label for an image. It is set up for keras. The card lists the license as mit.
A CNN classifier for Persian (Farsi) handwritten digits — ۰۱۲۳۴۵۶۷۸۹ — trained on 80,000 real handwritten digit images.
Downloads · 30 days
35
39% of all-time downloads
All-time downloads
89
Public
Repo size
5.1 MB
Likes
0
Public
Click a slice to open those files.
.keras5.1 MB · 100%
From the Hugging Face model README
A CNN classifier for Persian (Farsi) handwritten digits — ۰۱۲۳۴۵۶۷۸۹ —
trained on 80,000 real handwritten digit images.
Accuracy: 99.8% on a held-out test set (200 images per class).
digit_classifier_handwritten.keras)Mehdinmz/persian-handwritten-digitsfrom huggingface_hub import hf_hub_download
import tensorflow as tf
import numpy as np
path = hf_hub_download("Mehdinmz/persian-handwritten-digit-recognition", "digit_classifier_handwritten.keras")
model = tf.keras.models.load_model(path)
# img: 28x28 grayscale float32 in [0,1]
pred = model.predict(img.reshape(1, 28, 28, 1), verbose=0)
digit = int(np.argmax(pred)) # 0..9 (Persian digit: ۰۱۲۳۴۵۶۷۸۹)
| Metric | Value |
|---|---|
| Test accuracy | 99.8% |
| Per-class (200 imgs each) | ≥ 99.5% for all classes |
Full OCR pipeline (segmentation, CAPTCHA support, training code): github.com/mehdinmz/Persian-CAPTCHA-OCR
MIT © 2026 Mohammad Mehdi Namazian