/ Модель

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

Лицензия
CC BY-NC 4.0
Базовая модель
OCRia-nano-1
Библиотека
pytorch
Опубликована
30 ноя 2026

Bina-0.4-Microscopy

Описание изображенийИзображение → текст
0скачиваний за 30 дней13лайковвеса обновлены30 ноя 2026

Описание модели

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

Компактная модель для локального распознавания персидского печатного и рукописного текста на страницах и фрагментах документов.

Bina 0.4 Microscopy — компактная модель распознавания персидского текста на страницах и фрагментах документов, разработанная автором репозитория Reza2kn. Она дообучена на базе llamaindex/OCRia-nano-1 и содержит 9,55 млн параметров. Модель принимает изображения и PDF, распознаёт печатный текст и рукопись, включая формы, скриншоты, газеты, математические записи и письма. Результат включает текст в порядке чтения, а также строки с координатами, распознанным текстом и оценками уверенности.

Модель рассчитана на локальную работу на CPU через ONNX Runtime; README также описывает запуск через PyTorch на CUDA. На описанном наборе из 193 фрагментов персидского OCR её CER составляет 19,08%. Среди ограничений — слабое распознавание таблиц, пропуски мелкого шрифта на плотных страницах, отсутствие автоматического исправления поворота и неподдержка исторической насталикской и шекесте. Другие языки не были целью разработки. Лицензия CC BY-NC 4.0 разрешает использование с указанием авторства, но не коммерческое применение.

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

  • распознавание персидской рукописи на сканах
  • извлечение печатного персидского текста из документов
  • распознавание текста в персидских формах и письмах
  • оцифровка персидских газет и страниц
  • извлечение текста и строк с координатами из PDF

Ограничения

Распознавание таблиц слабее, а на плотных страницах модель может пропускать мелкий шрифт; повёрнутые страницы автоматически не выравниваются. Исторические разновидности насталик и шекесте не поддерживаются, а другие языки не были целью разработки.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Бенчмарки пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь рядом с другими моделями теста

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Распознавание текста» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы по шкале 0–100.

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

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

Открыть на Hugging Face

Bina 0.4 Microscopy

A 9.55M-parameter Persian page OCR that runs on a laptop CPU. Microscopy is the smallest member of the Bina 0.4 family. It reads whole pages and crops (printed text, handwriting, forms, screenshots, newspapers, math, letters) and accepts images or PDFs.

As of 29 November 2026, on the 193-crop Persian OCR benchmark (34 entries) only Bina 0.4 Rizeh (7.5× larger) and six Google models (Gemini 4 Argon, Neon, Carbon, Hydrogen, Gemini 3.7 Flash and Gemma 4 31B) score better than Microscopy. It beats the best models from Anthropic, OpenAI, Alibaba, Meta, xAI, DeepSeek and every other lab on the board, and Bina 0.4 Koochik at about 66× its size.

MicroscopyRizehKoochik
Parameters9.55M71.2M630.8M
193-crop benchmark, CER ↓19.0818.6620.82
Speed, CPU, full handwritten page0.55 s (0.42 s INT8, 0.28 s INT8 --single)needs a GPUneeds a GPU

How Bina 0.4 compares

The 193-crop Persian OCR benchmark (Reza2kn/persian-ocr-bench-submitted10-bbox-crops) has 34 entries as of 29 November 2026. Below are the three Bina 0.4 models next to the best model from each other lab, all re-scored from saved predictions with the same scorer (no-space CER after Bina fair_text normalization; on the radar, accuracy = 100 − CER).

Hexagon radar: accuracy by category for Bina 0.4 Microscopy, Rizeh and Koochik, Gemini 4 Argon, Qwen 3.8 Flash, Claude Opus 5 Fast, OCRia nano 1 and GPT-5.6 Sol

Overall CER on the 193 crops, one model per lab, and overall accuracy rings

Every model that scores better than the Bina 0.4 family on this scorer is from Google (Gemini 4 Argon, Neon, Carbon and Hydrogen, Gemini 3.7 Flash, Gemma 4 31B). All three Bina 0.4 models score better than the best Alibaba (Qwen 3.8 Flash, 22.53), Anthropic (Claude Opus 5 Fast, 22.62) and OpenAI (GPT-5.6 Sol, 31.75) models.

Hexagon radar of the three Bina 0.4 models only, each axis stretched between the weakest and strongest of the three

Each axis runs from the weakest to the strongest of the three, so small differences are visible. Ranges: forms 91–94%, screens 92–97%, prose 62–69%, math 84–88%, newspaper 81–92%, tables 40–61% accuracy.

Quick run

hf download Reza2kn/Bina-0.4-Microscopy --local-dir Bina-0.4-Microscopy
cd Bina-0.4-Microscopy
pip install -r requirements.txt     # no PyTorch needed: runs on ONNX Runtime
python microscopy.py examples/demo.png --out results
python microscopy.py scan1.jpg letter.pdf --out results
python microscopy.py scan1.jpg --reader reader.int8.onnx   # about 1.5x faster

Each page produces <name>.txt (text in reading order) and <name>.json (every line with its box, text and confidence, plus which detector was used). Every PDF page becomes its own result: letter-p001.txt, letter-p002.txt and so on.

From Python:

from PIL import Image
from microscopy import Microscopy

ocr = Microscopy()                 # ONNX Runtime on CPU (PyTorch on a GPU, if installed and available)
result = ocr(Image.open("page.jpg"))
print(result["text"])
for line in result["lines"]:
    print(line["box"], line["confidence"], line["text"])

Options and tips

  • Runtime. Everything runs on ONNX Runtime on the CPU by default; PyTorch is not needed. --reader reader.int8.onnx is about 1.3× faster (0.42 vs 0.55 s per full handwritten page) for +0.2 to +0.4 CER. Combined with --single a page takes 0.28 s. The two detector branches run in parallel threads (4 ONNX Runtime threads each); Microscopy(parallel=False) runs them one after the other on small machines. With PyTorch and a CUDA GPU, --backend torch --device cuda reads the lines on the GPU (0.22 s/page; the detectors stay on the CPU).
  • --single uses only the main detector (8.84M, about twice as fast on CPU). It is just as good on handwriting and most print, but clearly weaker on tables (70.8 vs 58.0 CER).
  • --dpi sets the PDF render resolution (default 200). 200–300 dpi is right for normal documents. Going higher does not help: pages are detected at a 1024-pixel long side anyway.
  • Very dense pages (a full broadsheet newspaper page at 3000+ px) are shrunk to 1024 px for line detection, so small print can be missed. For those, crop columns or regions and send them separately. Crops of any size work without settings.
  • Photos of documents: straighten and crop to the page if you can. Rotated pages are not corrected automatically.
  • Light text on dark backgrounds (banners, slide titles, dark table headers) is detected and read inverted automatically.
  • Confidences are model scores, not calibrated probabilities. Lines below 0.5 are dropped.

Other runtimes

The same pipeline, checked against this repo on the 193 crops and the 50 handwriting pages:

PackageFor193 CERdev50 CERCPU s/page*
this repo, ONNX FP32 (default)Python, any OS19.0914.460.55
this repo, --reader reader.int8.onnxPython, faster CPU19.5014.660.42
this repo, --backend torchPython + PyTorch (GPU)19.0814.461.17
Bina-0.4-Microscopy-ONNXbrowsers (WebGPU/WASM), Node, any ONNX Runtime; FP32/FP16/INT819.0614.420.99 (Node)
Bina-0.4-Microscopy-LiteRTAndroid, iOS, embedded (TensorFlow Lite)19.0914.460.47
Bina-0.4-Microscopy-Rustone native binary (ONNX Runtime linked in, or pure-Rust tract)19.0614.450.56 (0.44 INT8)
Bina-0.4-Microscopy-CoreMLiPhone, iPad, Mac (Core ML; detectors on the GPU)same text as ONNX†0.49 on an M2†

* full handwritten pages (dev50) on the same x86 machine, both detectors running in parallel (4 threads each). Small CER differences come from float rounding in image resizing.

† measured on an Apple M2, where ONNX Runtime FP32 takes 1.18 s/page on the same pages; identical text to ONNX FP32 on those pages, and on the 193 crops the FP32 Core ML reader matches ONNX exactly (FP16: 0.02 CER apart).

Results

All scores are character error rates in %, lower is better, measured with the same scorer for every model. "No-space CER" removes spaces after the Bina fair_text normalization. The public 193 scorer is the frozen original scorer shipped with Rizeh (benchmark_scoring.py), which keeps spaces.

193-crop benchmark (Reza2kn/persian-ocr-bench-submitted10-bbox-crops, revision 906b97f)

CategoryMicroscopy 9.55MMicroscopy --single 8.84MRizeh 71.2MKoochik 630.8M
Forms6.807.097.478.23
Screenshots4.024.164.377.22
Prose33.1533.1932.3836.84
Math13.6813.7613.3515.07
Newspaper9.629.689.1217.75
Tables58.0070.8254.7140.59
Overall19.0820.3018.6620.82

Microscopy's figures come from the package in this repo. Rizeh's come from its repaired public run (validation/submitted10-public-predictions.jsonl in the Rizeh repo), and Koochik's from its repaired-tables run.

The wider board (same 193 crops, everything re-scored here)

#ModelNo-space CER ↓Public CER ↓Public WER ↓Similarity ↑
1Gemini 4 Argon12.7223.3527.1890.16
2Gemini 4 Neon15.4322.0327.4489.75
3Gemini 4 Carbon15.4626.6728.5989.82
4Gemini 4 Hydrogen15.4922.6228.4489.45
5Gemini 3.7 Flash17.9025.3630.5386.87
6Gemma 4 31B18.241270.3032.1085.24
7Bina 0.4 Rizeh (71.2M)18.6621.2736.8387.55
8Bina 0.4 Microscopy (9.55M)19.0822.6439.7785.92
9Bina 0.4 Koochik (630.8M)20.8225.1434.5886.38
10Qwen 3.8 Flash22.5329.1740.9981.60
11Claude Opus 5 Fast22.6228.0936.5684.08
12Gemini 3.1 Pro Preview22.9745.5439.1685.40
13Bina Koochik 0.126.9431.0241.0383.98
14OCRia nano 129.6932.9755.8474.35
15GPT-5.6 Sol31.7536.2345.8077.39
16Muse Spark 1.2 Contributor33.3936.6152.0273.73
17Grok 4.637.1840.9654.1270.31
18Bina 0.338.6840.7951.5682.18
19OCRia 140.1351.0963.7871.36
20Nemotron 3.5 Parse42.2649.7467.2555.25
21DeepSeek V4 Flash Vision Exp45.6648.9664.5447.93
22Inkling 2 Mini49.70536.1968.3256.96
23Kimi K358.9860.9967.9057.45
24Surya OCR 2.559.3974.2966.6455.21
25Surya 278.3199.8370.6553.82
26GLM 5.3 Flash78.8779.9887.1423.80
27Unlimited OCR86.73107.14119.6932.10
28MiniCPM-V 4.7 1B (RaahNaame r29)110.78135.09181.3763.92
29dots.mocr188.08192.28198.5156.92
30Ternary Bonsai 2 27B321.66358.05395.6965.27
31MiniCPM-V 4.7 1B353.80353.81386.4141.25

Ranked by no-space CER. Older runs of Rizeh and Koochik and a Gemma 4 26B A4B run that failed with HTTP 404 errors are left out. On the public scorer, which counts spaces, Microscopy also scores below Gemini 4 Argon and Carbon. CER above 100 means the model produced more wrong text than there was text, for example through repetition or HTML output.

50 handwriting pages (dev50, full page including printed form text)

MicroscopyMicroscopy --singleRizehKoochik
14.4514.7610.899.60

Full handwritten pages are where the larger models still lead. About half of Microscopy's gap here is reading order on busy forms, not misread characters: scored without regard to order, it reaches 9.5.

Financial lines and symbols (60 generated lines)

These are generated Persian financial lines with ٪, +, <, >, mixed Persian/Latin digits and simulated scan damage. They are cleaner than real documents.

MicroscopyRizehKoochik
CER ↓9.6011.243.63
Exact lines ↑36/6026/6047/60
٪ read ↑30/3026/3022/30
+ read ↑2/123/124/12
< / > read ↑4/124/121/12 (3 flipped)

All three models often drop +, < and >. Do not rely on them for those symbols in financial documents without a check.

How it works

  1. Line detection. Two 0.71M-parameter detectors (inverted-residual encoder + FPN, DB-style kernel maps at half resolution) run on the page at a 1024-pixel long side.
    • The main detector learned from synthetic pages, real scans and, by distillation, from the probability maps of Rizeh's 38.4M Surya-based line detector. No Surya weights are included here.
    • The second detector is tuned for real printed scans and tables.
  2. Reading. A 19-block CTC line reader (8.13M parameters, 1,617-symbol vocabulary) reads each 64-pixel-high line crop. It was distilled from Bina 0.4 Rizeh's recognizer, then fine-tuned on about 190k real line crops cut by the detector itself from training pages and matched to their true text.
  3. Router. Each page is read once per detector, and the reading with more confident text is kept.
  4. Assembly. Right-to-left reading order: columns split at gaps wider than 0.4 line heights, then rows. Tiny noise boxes and duplicate reads are removed. There is no learned layout model.

All thresholds were chosen on training-distribution pages, not on the benchmarks. The 193-crop and dev50 sets have been used repeatedly during development, so they are development benchmarks, not untouched held-out tests.

Files:

FileWhat it isParameters
reader.onnxCTC line reader (ONNX, used by default)8,134,873
reader.int8.onnxthe same reader, INT8 convolutions (--reader)8,134,873
reader.safetensorsCTC line reader (PyTorch weights, --backend torch)8,134,873
det_main.onnxmain line detector706,017
det_print.onnxprint/table line detector706,017
vocab.json1,617-symbol vocabulary
microscopy.pythe whole pipeline and CLI, about 270 lines
bina_rtl.pyright-to-left text helper

Limitations

  • Tables are weak (58 CER on the 193 tables). Koochik is much better at tables.
  • Busy handwritten forms: reading order on exam sheets and forms with many labels is the largest error source.
  • Symbols +, <, > are often dropped (see above).
  • Very dense full pages lose small print, because detection runs at 1024 px. Crop such pages into regions first.
  • Historical manuscripts (old nastaliq and shekasteh) are not supported.
  • Persian-first. Latin text and digits are read, but other languages were not a goal.

License

CC BY-NC 4.0, matching the non-commercial training data.

فارسی

بینا ۰٫۴ میکروسکوپی کوچک‌ترین عضو خانواده‌ی OCR فارسی بینا ۰٫۴ است: ۹٫۵۵ میلیون پارامتر، روی CPU لپ‌تاپ حدود ۰٫۸ ثانیه برای هر صفحه. متن چاپی، دست‌نویس، فرم، تصویر صفحه‌نمایش، روزنامه و ریاضی را از تصویر یا PDF می‌خواند.

تا ۲۹ نوامبر ۲۰۲۶، روی بنچمارک ۱۹۳ برش (۳۴ مدل) فقط بینا ۰٫۴ ریزه (۷٫۵ برابر بزرگ‌تر) و شش مدل گوگل (Gemini 4 Argon، Neon، Carbon، Hydrogen، Gemini 3.7 Flash و Gemma 4 31B) از میکروسکوپی بهترند. میکروسکوپی از بهترین مدل‌های Anthropic، OpenAI، Alibaba، Meta، xAI، DeepSeek و بقیه‌ی آزمایشگاه‌ها، و از بینا ۰٫۴ کوچیک با حدود ۶۶ برابر حجم، بهتر است.

pip install -r requirements.txt
python microscopy.py page.jpg document.pdf --out results

محدودیت‌ها: جدول‌ها هنوز ضعیف‌اند، ترتیب خواندن فرم‌های شلوغ دست‌نویس جای بهبود دارد، و علامت‌های + و < و > گاهی جا می‌افتند.

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

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

GPU в ailist

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

Можно запустить

Подбираем GPU…

Ревизия весов
78886ce

0 моделей