MEDUSA 0.2 — Medieval European Documents Unified System for Automated text recognition
MEDUSA is a family of Vision Language Models (VLMs) fine-tuned for multilingual medieval handwritten text recognition (HTR) at the line level.
These models were developed at the École nationale des chartes – PSL.
Note on versioning. The 0.1 variants correspond to the models submitted to the ICDAR 2026 competition, trained exclusively on Gold and Platinum image–text pairs.
The 0.2 variants add a prior Silver stage using 500,000 synthetic lines, improving coverage of under-resourced languages.
MEDUSA was trained on a corpus of over 640k lines + 500k generated 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.
Training data and curriculum
MEDUSA 0.2 is trained in three successive stages:
Stage 1 — Silver (synthetic)
The Silver stage uses text-only historical corpora to generate 500,000 synthetic line images, providing lexical and script coverage for languages that are absent or scarce in the image–text tiers. Text is sampled from over 20 million words across medieval languages, rendered onto real manuscript background patches with stochastic ink, scan, and document degradation effects.
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)
Mnuscripts dated roughly from the 9th to the 15th century.
Paired image–text data following heterogeneous transcription conventions, used for visual adaptation across manuscript styles and editorial traditions (~423,000 lines). See the MEDUSA 0.1 model card for the full dataset table.
Stage 3 — Platinum
Image–text pairs aligned with the CATMuS diplomatic transcription guidelines, used for final specialization toward the target task (~222,000 lines). See the MEDUSA 0.1 model card for the full dataset table.
Silver-stage references
[1] Helsinki Corpus TEI XML Edition (2011). Designed by Alpo Honkapohja et al. Based on The Helsinki Corpus of English Texts (1991).
[2] Draschner, M., Edlich-Muth, M. Raw text edition of the Middle English 'Floris and Blancheflour' in Edinburgh, National Library of Scotland, MS Advocates 19.2.1 (Jan 2026). https://doi.org/10.5281/zenodo.18244892
[3] Kučera, K., Řehořková, A., Stluka, M. Diakorp v6: Diachronic Corpus of Czech. LINDAT/CLARIAH-CZ (2015). http://hdl.handle.net/11234/1-5413
[4] Haverals, W., Kestemont, M. From exemplar to copy: the scribal appropriation of a Hadewijch manuscript computationally explored. JDMDH 23. https://doi.org/10.46298/jdmdh.10206
[5] Ó Corráin, D. et al. CELT: Corpus of Electronic Texts (1997). http://www.ucc.ie/celt
[24] Corbara, S. et al. Two datasets for the computational authorship analysis of medieval Latin texts (Jun 2020). https://doi.org/10.5281/zenodo.4298503
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.
1run_name:"Medusa0.2Line-9B"2output_dir:"results"3device:"cuda"4save_image:true56data:7test:"path/to/your/alto/data"89tasks:10htr:11type: VLMLineHTR
12config:13use_metadata:true14model_name:'outputs/Medusa0.2Line-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.
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.