/ Модель

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

Лицензия
Apache 2.0
Базовая модель
deepocr-v3
Библиотека
pytorch
Опубликована
13 ноя 2026

deepocr-v4

Описание изображенийИзображение → текст3 профессии

DeepOCR v4.1 распознаёт историческую печать и рукописные строки на изображениях и возвращает их текстовую транскрипцию.

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

Бенчмарки

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

Тесты пользователейпока нет

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

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

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

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

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

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

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

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

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

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

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

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

DeepOCR v4.1 — модель распознавания отдельных строк исторической печати и рукописей по изображениям, разработанная командой DeepOCR. Она предназначена для транскрибирования европейских документов от средневекового до современного периода. Модель содержит 461,6 млн параметров и объединяет сверточную сеть, четыре слоя трансформера с экспертами, байтовую CTC-голову и декодер на основе языковой модели OLMo 3 с перекрестным вниманием к признакам изображения. Декодер формирует варианты транскрипции, которые CTC-голова сверяет с изображением. Строка подается как RGB-изображение высотой 256 пикселей и шириной до 6144 пикселей; модель умеет выводить символы Unicode. Для транскрипции можно задавать соглашения о длинной s, переносах, типографской пунктуации и раскрытии сокращений.

В карточке сообщается, что на отложенной выборке из 1721 строки версия v4.1 достигла CER 2,94% с декодером подслов против 4,45% у v4; на 300 пустых фрагментах она возвращала пустую строку. Это распознавание построчное: для работы с целой страницей перед моделью требуется обнаружение или сегментация строк. Модель хуже справляется с языками, редкими в обучающих данных, а короткие строки могут приводить к подмене слова более распространенным. Перевернутые строки следует предварительно развернуть. Репозиторий лицензирован по Apache-2.0.

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

  • транскрибирование строк в сканах исторических книг
  • распознавание рукописных строк в архивных документах
  • оцифровка европейских печатных документов разных эпох
  • распознавание текста на изображениях, подготовленных сегментацией по строкам

Ограничения

Модель читает только отдельные строки, поэтому для страниц нужна предварительная сегментация. Короткие строки, перевернутый текст и языки, редкие в обучающих данных, могут распознаваться хуже.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

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

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

Открыть на Hugging Face

DeepOCR v4.1

A line-level text recognition model for historical print and handwriting. v4.1 is DeepOCR v4 trained further on five more collections and corrected labels. It keeps v4's subword decoder, which writes the line while the CTC head checks the candidates against the image. On unseen handwritten letters it makes 11% fewer errors than v4, and on a blank crop it writes nothing where v4 invented a line. Code, training and architecture: DeepOCR.

Files

FileWhat it is
deepocr-v4.ptThe model weights (EMA), with every architecture setting, the decoder's config and its tokenizer stored inside
union_bytes_v3.binByte-level 6-gram KenLM, for CTC beam search
union_bytes_v3.dictThe LM's token list, index-parallel to the CTC head's 261-token byte vocabulary

Use

import torch
from PIL import Image
from infer import load_model, transcribe

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
model, tokenizer = load_model('deepocr-v4.pt', device)
print(transcribe(model, tokenizer, [Image.open('line.png')], device, use_decoder=True)[0])

use_decoder=True reads with the subword decoder: it writes four candidate lines, the CTC head scores each against the image, and the best overall wins. This is the most accurate way to read with v4.1. CTC beam search with the KenLM (transcribe_beam, set up as on the v3 card) also works.

Input is one text line as an RGB image; it is scaled to 256 px high and read up to 6144 px wide. Four flags choose the transcription convention: long_s (ſ), oblique_hyphen (⸗), typographic_punctuation and expand_abbreviations. Set them in infer.CONVENTION; all off by default.

Use the DeepOCR code from commit 163c1b2 onwards. DeepLabel reads with the subword decoder as well.

Model

461.6M parameters, fine-tuned from v4:

  • 156.0M for reading the image: a grouped CNN backbone, four mixture-of-experts transformer layers (64 experts, 8 active per column, plus one shared expert) and a CTC head over bytes, so it can emit any Unicode character.
  • 305.6M for the subword decoder: a 238M OLMo 3 language model distilled from HabsburgLLM, with its 48k tokenizer, extended by cross-attention to the image features.

A line reads the same whether it is processed alone or in a batch with longer lines, up to floating-point rounding.

Evaluation

Character error rate (CER), lower is better.

MaterialDecodingv3v4v4.1
Held-out validation sample, 1,721 linesgreedy5.49%5.19%3.48%
beam 10 + KenLM5.08%4.77%3.11%
subword decoder4.45%2.94%
Unseen handwritten letters from around 1900, 1,972 linesbeam 10 + KenLM9.15%5.94%5.13%
subword decoder4.54%4.03%
Held-out lines of the five collections added in v4.1, 2,000 linessubword decoder18.04%4.79%

All models are scored on the same lines and labels. The validation sample holds lines from the collections the models train on. Earlier versions of this card used a 2,000-line sample that also held 279 lines from collections left out of training, and labels that held only a line's first word; this one leaves those collections out and uses the corrected labels, so the v3 and v4 figures differ from before.

On 300 blank crops, v4.1 returns an empty line for every one; v4 wrote text on all of them.

Training data

Public datasets of historical print and handwriting, and line transcriptions made in DeepLabel. v4.1 adds collections in Czech, Estonian, Danish, Portuguese and English.

During training, v4.1 kept masked image columns in place, let the decoder read the unmasked features, and saw 3% blank or upside-down lines with an empty transcription.

Limitations

  • Reads single lines only; it needs a line detector or segmentation in front of it.
  • A line of one or two words gives the decoder little to go on, and it may write a more common word than the one on the page.
  • Upside-down lines are not read: v4.1 returns an empty line for nearly all of them. Turn the crop the right way up first.
  • In runs of leader dots the decoder can write one dot more or fewer; beam search counts them more exactly.
  • Reads best on material like its training data: European print and handwriting from the medieval to the modern period. Languages that are rare in the training data read clearly worse.

Versions

TagReleasedNotes
v4.1November 2026Current. Trained further on more collections and corrected labels
v4.0November 2026First release: v3 fine-tuned with the subword decoder

The files keep their names across versions. To load v4.0: hf download M2key1/deepocr-v4 --revision v4.0.

License

Apache-2.0.

Citation

@software{fleischhacker_deepocr,
  author = {Fleischhacker, David},
  title  = {DeepOCR},
  year   = {2026},
  url    = {https://github.com/m2key1/DeepOCR}
}

The subword decoder is distilled from HabsburgLLM:

@software{fleischhacker_habsburgllm,
  author = {Fleischhacker, David},
  title  = {HabsburgLLM},
  year   = {2026},
  url    = {https://github.com/m2key1/HabsburgLLM}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

Ревизия весов
5c9d5e4

0 моделей