MEDUSA was trained on a corpus of over 640,000 lines spanning more than twenty repositories, covering the following language families and scripts:
Romance / Latin: Old French (fro), Occitan (pro), Old Italian (ita), Old Spanish (osp), Catalan (cat), Old Portuguese (opor), Navarrese (nav), Latin (lat), Venetian (vec), Galician (glg)
Germanic: Middle High German (gmh), Middle Low German (gml), Old Icelandic (ice), Middle English (enm), Middle Dutch (dum), Old English (ang), Old Norwegian (non), Swedish (swe)
Celtic: Welsh (wlm), Old Irish (gle)
Slavic: Old Czech (cze), Old Polish (pol)
Manuscripts dated roughly from the 9th to the 15th century.
Results (ICDAR 2026 CMMHWR)
Unweighted average CER (%) and WER (%) on internal and official competition test sets. Lower is better.
Model
Internal CER
Internal WER
Task 1 CER
Task 2 CER
Task 3 CER
kraken-CATMuS 1.6.0 (baseline)
17.3
53.5
9.29
7.91
25.9
MEDUSA-4B 0.1
14.7
44.5
8.15
5.60
12.0
MEDUSA-9B 0.1
13.2
42.6
8.03
5.24
10.8
Training data
MEDUSA 0.1 is trained on two tiers of image–text data:
Gold — paired image–text data following heterogeneous transcription conventions, used for visual adaptation across manuscript styles and editorial traditions.
Platinum — image–text pairs aligned with the CATMuS diplomatic transcription guidelines, used for final specialization toward the target task.
The total training pool amounts to approximately 645,000 line-level image–text pairs.
[6] Burghart, M., Yatsyk, S. DISTINGUO: Ground truth for handwritten text recognition (HTR) on collections of distinctions (late 13th to late 15th century) (2024). https://doi.org/10.34847/NKL.48AD8B8D
[8] Odstrčilík, J. et al. HTR Winter School in Vienna 2025 – Late Medieval Latin Group: Ground Truth Dataset for Late-Medieval Latin Scripts (2025).
[9] Wrisley, D., The Paris Bible Project, Gueville, E. parisbible/ground_truth: Ground truth v1.0.0 for the Paris Bible Project (Feb 2023). https://doi.org/10.5281/zenodo.7653691
[12] Kapitan, K.A., Vidal-Gorène, C. Crossing the Bifrost: Towards an open access FAIR HTR model for Old Norse manuscripts (May 2025). https://doi.org/10.5281/zenodo.15366896
[14] Eichenberger, N., Suwelack, H. Faithful Transcriptions Data Set: TEI/XML-encoded transcriptions of medieval theological manuscripts (Oct 2021). https://doi.org/10.5281/zenodo.5582483
[15] Hodel, T., Schoch, D., Dängeli, P. Handwritten text recognition ground truth set: StABS Ratsbücher O10, Urfehdenbuch X (Aug 2021). https://doi.org/10.5281/zenodo.5153263
[16] Eichenberger, N. Transcriptions from medieval manuscripts related to the Augustinian canonesses in Inzigkofen (Dec 2025). https://doi.org/10.5281/zenodo.17978574
[18] Clérice, T. et al. CATMuS Medieval: A multilingual large-scale cross-century dataset in Latin script for handwritten text recognition and beyond (Feb 2024). https://inria.hal.science/hal-04453952
[23] Plechatý, M. et al. HTR Winter School 2024 – Medieval Czech – Prague Bible (1488) (Dec 2024).
Intended use
These models are designed for line-level HTR on pre-segmented medieval manuscript images.
They are not page-level OCR systems: they expect a cropped image of a single text line as input and return the transcription of that line.
The models target CATMuS transcription guidelines, which govern abbreviation expansion, allograph normalisation, and the character set used.
Usage with DocWorkflow
The recommended way to use MEDUSA is via DocWorkflow,
the document analysis framework developed at the École nationale des chartes.
DocWorkflow handles ALTO XML input/output, line image extraction, batching, CATMuS post-processing, and scoring in a unified pipeline.
Create a YAML config file (e.g., medusa_inference.yml):
yaml
1run_name:"Medusa0.1Line-9B"2output_dir:"results"3device:"cuda"4save_image:true56data:7test:"path/to/your/alto/data"# directory with ALTO XML + image pairs89tasks:10htr:11type: VLMLineHTR
12config:13use_metadata:true14model_name:'outputs/Medusa0.1Line-9B'15device_map:"auto"16max_new_tokens:12817line_batch_size:818max_pixels:4014081920prompt:>21 Transcribe the handwritten text in this line image.
22 Keep abbreviations as written, do not expand them.
23 Modernize word segmentation (split or join words following modern usage).
24 Use only u and i, never v and j, regardless of the original or modern usage.
25 Do not record allographic variants, use standard letter forms.
26 Output ONLY the transcription.27
Tip. If your dataset follows dataset-specific transcription conventions, you can provide a conventions.yml file alongside your ALTO data.
DocWorkflow will automatically inject the conventions into the prompt via a {conventions} placeholder.
Running inference
docworkflow -c Medusa0.1Line-9B.yml predict -t htr -d test
Direct usage with transformers
The models can also be used directly outside of DocWorkflow, though the CATMuS post-processing step will need to be applied manually if desired.
python
1from transformers import AutoProcessor, AutoModelForImageTextToText
2from PIL import Image
34model_id ="ENC-PSL/Medusa0.1Line-9B"56processor = AutoProcessor.from_pretrained(model_id)7model = AutoModelForImageTextToText.from_pretrained(model_id, device_map="auto")89image = Image.open("path/to/line_image.jpg").convert("RGB")1011prompt ="Transcribe the handwritten text in this line image.\nOutput ONLY the transcription."1213messages =[14{15"role":"user",16"content":[17{"type":"text","text": prompt},18{"type":"image","image": image},19],20}21]2223inputs = processor.apply_chat_template(24[messages],25 tokenize=True,26 add_generation_prompt=True,27 return_dict=True,28 enable_thinking=False,29 return_tensors="pt",30).to(model.device)3132with torch.no_grad():33 generated_ids = model.generate(**inputs, max_new_tokens=128, do_sample=False)3435trimmed = generated_ids[0][inputs["input_ids"].shape[1]:]36transcription = processor.decode(trimmed, skip_special_tokens=True).strip()37print(transcription)
Important. The model is optimised for the prompt given above. Results may degrade if the prompt is modified.
The model outputs raw text; to enforce CATMuS compliance (character whitelist, allograph normalisation),
apply the post-processing step provided in DocWorkflow (src/tasks/htr/postprocessing.py).
1@unpublished{moins:hal-05600991,
2 TITLE = {{MEDUSA 0.1: Medieval European Documents Unified System for Automated text recognition System Report for the ICDAR 2026 Competition on Multilingual Medieval Handwritten Text Recognition}},
3 AUTHOR = {Moins, Th{\'e}o and Cafiero, Florian and Camps, Jean-Baptiste and Conte, Lilla and Guidi, Emilie and Hensley, Brenna and Kapitan, Katarzyna and Macedo, Carolina and Peratello, Paola and Vermaas, Cecile and Vidal-Gor{\`e}ne, Chahan},
4 URL = {https://enc.hal.science/hal-05600991},
5 NOTE = {working paper or preprint},
6 YEAR = {2026},
7 MONTH = Apr,
8 PDF = {https://enc.hal.science/hal-05600991v1/file/MEDUSA__MEDieval_Universal_Script_Analysis-6.pdf},
9 HAL_ID = {hal-05600991},
10 HAL_VERSION = {v3},
11}
Funding
Funded by the European Union (ERC, LostMA, 101117408). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the
European Research Council. Neither the European Union nor the granting authority can be held responsible for them.
This work has received support under the Major Research Program of PSL Research University ``CultureLab'' launched by PSL Research University and implemented by ANR with the references ANR-10-IDEX-0001.
Ce travail a bénéficié d'une aide de l’État gérée par l'Agence Nationale de la Recherche au titre de France 2030 portant la référence « ANR-23-IACL-0008»).
Biblissima+ bénéficie d’une aide de l'Etat gérée par l'ANR au titre du Programme d’investissements d’avenir intégré à France 2030, portant la référence ANR-21-ESRE-0005.
This work was granted access to the HPC resources of IDRIS
under the allocation 2026-AD011015914R1 made by GENCI.