/ Модель

Характеристики

Лицензия
MIT
Опубликована
14 июл 2026

alphabet-classifier

Классификация изображенийИзображение → label

Компактная модель MobileNetV2 распознаёт отдельные рукописные буквы латинского алфавита на изображениях.

0скачиваний за 30 дней0лайковвеса обновлены4 авг 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Модель hermitkk/alphabet-classifier — классификатор рукописных букв на основе MobileNetV2, разработанный автором репозитория и опубликованный в формате ONNX. Этот вариант предназначен для распознавания букв A–Z и пустого изображения; регистр не различается. На вход подаётся одноканальное изображение размером 96 × 96, преобразованное в float32 и нормализованное по указанной схеме.

Модель содержит около 2,56 млн параметров и обучена на наборе EMNIST Letters; точность на валидации составляет 96,18%. Она подходит для распознавания отдельных рукописных букв и обработки изображений, где заранее известно, что символ является буквой. Труднее всего распознаются I и L из-за сходства почерков; модель не предназначена для чтения последовательностей или общего OCR. Лицензия репозитория — MIT.

Сценарии применения

  • распознавание отдельной рукописной латинской буквы
  • классификация букв A–Z на изображениях
  • определение пустого изображения или отсутствия символа

Ограничения

Распознаёт только отдельные буквы A–Z и пустой класс, не различает регистр и не читает последовательности символов. Буквы I и L распознаются хуже других из-за визуального сходства рукописных вариантов.

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Handwritten Character Classifier (EMNIST, MobileNetV2)

Two MobileNetV2-based ONNX models for classifying grayscale images of handwritten characters. Both models predict case-insensitively — they are trained on both upper and lowercase handwriting but always output a single canonical label per letter.

ModelClassesVal AccuracyONNX
AlphanumericDigits 0–9 + Letters A–Z + blank (37 total)91.42%outputs/exports/alphanumeric_model.onnx
AlphabetLetters A–Z + blank (27 total)96.18%outputs/exports/alphabet_model.onnx

Use the alphabet model when your input is guaranteed to be a letter (higher accuracy, no digit/letter confusion). Use the alphanumeric model when the input may be a digit or a letter.


Model Details

Shared architecture

PropertyValue
BackboneMobileNetV2 (pretrained ImageNet)
HeadLinear(1280→256) → BatchNorm → ReLU → Dropout(0.3) → Linear(256→N)
Parameters~2.56M
Input96 × 96 grayscale (expanded to 3-channel internally)
FormatONNX (opset 17)

Alphanumeric model — 37 classes

PropertyValue
Classes0–9 (indices 0–9), A–Z (indices 10–35), blank (index 36)
DatasetEMNIST byclass — both upper and lowercase handwriting, labels folded to uppercase
Train samples711,932
Val samples118,323
Val accuracy91.42%
Macro avg F10.917

Alphabet model — 27 classes

PropertyValue
ClassesA–Z (indices 0–25), blank (index 26)
DatasetEMNIST letters — upper and lowercase handwriting already merged at source
Train samples138,800
Val samples22,800
Val accuracy96.18%
Macro avg F10.960

Training Configuration

SettingValue
OptimizerAdamW — backbone lr × 0.1, head lr 5e-4, weight_decay 1e-4
SchedulerLinearLR warmup (5 epochs) → CosineAnnealingLR
LossCrossEntropyLoss with inverse-frequency class weights + label smoothing 0.10
Batch size256
Max epochs50
Early stoppingpatience 10
AugmentationRandomAffine, RandomPerspective, ColorJitter, GaussianBlur, RandomErasing
Mixed precisionAMP (CUDA only)
Blank classSynthetic white images; hard-floored weight ≥ 3.0

Per-class Performance

Alphanumeric model

Digits

ClassPrecisionRecallF1
00.7410.6860.712
10.7480.6930.719
20.9840.9490.967
30.9970.9950.996
40.9890.9740.981
50.9850.9280.956
60.9870.9760.981
70.9940.9970.995
80.9940.9880.991
90.9530.9620.958

Letters

ClassPrecisionRecallF1
A0.9770.9690.973
B0.9140.9710.942
C0.9660.9850.975
D0.9610.9760.969
E0.9920.9890.990
F0.9850.9830.984
G0.8180.8210.820
H0.9670.9820.974
I0.5450.6840.607
J0.9300.9500.940
K0.9870.9930.990
L0.5730.5370.554
M0.9920.9980.995
N0.9850.9840.984
O0.6480.6960.671
P0.9860.9940.990
Q0.7830.7610.772
R0.9860.9820.984
S0.9130.9780.944
T0.9890.9890.989
U0.9690.9550.961
V0.9120.9560.934
W0.9880.9970.992
X0.9760.9900.983
Y0.8960.9460.920
Z0.7620.9210.834

Blank

ClassPrecisionRecallF1
blank1.0001.0001.000

Hardest cases are I (F1=0.607) and L (F1=0.554), both confused with digit 1; and O (F1=0.671), confused with digit 0. These are inherent digit–letter ambiguities in alphanumeric OCR.


Alphabet model

ClassPrecisionRecallF1
A0.9590.9760.968
B0.9960.9860.991
C0.9840.9790.981
D0.9760.9740.975
E0.9840.9860.985
F0.9940.9760.985
G0.9270.8740.900
H0.9760.9780.977
I0.7600.7610.761
J0.9740.9650.969
K0.9960.9950.996
L0.7650.7700.768
M0.9860.9990.993
N0.9800.9810.981
O0.9750.9800.978
P0.9910.9910.991
Q0.8900.9280.908
R0.9790.9780.978
S0.9920.9890.991
T0.9750.9880.981
U0.9610.9440.952
V0.9450.9580.951
W0.9970.9900.993
X0.9900.9910.991
Y0.9650.9780.971
Z0.9950.9980.996
blank1.0001.0001.000

Hardest cases are I (F1=0.761) and L (F1=0.768), which are visually similar across handwriting styles. All other letters achieve F1 ≥ 0.90, and blank is perfect.


Usage

Alphanumeric model

from huggingface_hub import hf_hub_download
import onnxruntime as ort
import numpy as np
from PIL import Image

CHAR_CLASSES = list("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ") + ["blank"]

path = hf_hub_download(
    repo_id="hermitkk/alphabet-classifier",
    filename="outputs/exports/alphanumeric_model.onnx",
)
session = ort.InferenceSession(path)

# Preprocess a 96x96 grayscale crop
img = Image.open("character.png").convert("L").resize((96, 96))
x = (np.array(img, dtype=np.float32) / 255.0 - 0.5) / 0.5
x = x[np.newaxis, np.newaxis, :, :]  # (1, 1, 96, 96)

logits = session.run(None, {"input": x})[0]
pred = int(np.argmax(logits))
print(CHAR_CLASSES[pred])  # e.g. "A", "3", "blank"

Alphabet model

from huggingface_hub import hf_hub_download
import onnxruntime as ort
import numpy as np
from PIL import Image

ALPHA_CLASSES = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ") + ["blank"]

path = hf_hub_download(
    repo_id="hermitkk/alphabet-classifier",
    filename="outputs/exports/alphabet_model.onnx",
)
session = ort.InferenceSession(path)

# Preprocess a 96x96 grayscale crop
img = Image.open("letter.png").convert("L").resize((96, 96))
x = (np.array(img, dtype=np.float32) / 255.0 - 0.5) / 0.5
x = x[np.newaxis, np.newaxis, :, :]  # (1, 1, 96, 96)

logits = session.run(None, {"input": x})[0]
pred = int(np.argmax(logits))
print(ALPHA_CLASSES[pred])  # e.g. "A", "blank"

Note: both models accept 96 × 96 single-channel float32 input, normalized to mean 0.5 / std 0.5. White pixels (blank paper) map to +1.0 and dark ink maps toward −1.0.


Reproduce Training

git clone https://huggingface.co/hermitkk/alphabet-classifier
cd alphabet-classifier
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt

# Train alphanumeric model
python main.py train --config config/config.yaml

# Train alphabet model
python main.py train --config config/config_alphabet.yaml

License

MIT

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

В репозитории нет весов в формате PyTorch/safetensors.

Ревизия весов
cf2bb20

0 моделей