Skip to content
/ OICEN-HTR Public

Old Icelandic / Norse Handwritten Text Recognition

Notifications You must be signed in to change notification settings

NKCZ/OICEN-HTR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

OICEN-HTR

Old Icelandic / Norse Handwritten Text Recognition

DOI

This repository contains HTR models fine-tuned on Old Icelandic manuscripts. It also contains the ground truth data, but not the images, as they are usually available on Handrit.is.

Current models are better suited for Old Icelandic manuscripts than CATMuS. They produce from moderate to good results.

Link to Zenodo.


Kringla first and second line, comparing CATMuS, AlexS and GT.

Some diacritic marks are not rendered correctly neither in the image above nor in the accompanying PDF (?), see the Word document with Junicode.


  • Annotation from Menota.

  • Fine-tuned on CATMuS Medieval 1.6.0.

  • Training, validation, test set (unless otherwise specified): 0.8, 0.1, 0.1 .

  • Initials excluded...

  • Use it either with Kraken or eScriptorum (recommended).

  • Ground truth data available for re-usability. They can be easily uploaded to an eScriptorum instance and edited there. NB: the image names should match those in the ground truth xml files.

  • Why train separate models for each manuscript? Diverging scribal styles, re-usability on manuscripts with same hands (e.g., AM 242 fol and AM 227 fol), different annotators, initial tests to figure out what works and not, and similar. This will not be done for all manuscripts, but only for those that are of interest.

  • Ultimate goal is to train one model on various manuscripts.

  • Plan:

    • Finish AM 132 fol. (MB). Currently 1/3 of the manuscript is annotated.

    • Finish Codex Regius based on EAE GKS 2365 4to by Guðvarður Már Gunnlaugsson, Haraldur Bernharðsson, Vésteinn Ólason, et al.


Model Accuracy (char, word) Val. Accuracy Annotation based on Images Fine-Tuned on Status Version Notes
AlexS
  • Characters: 239194
  • Errors: 2858
  • Character Accuracy: 98.81%
  • Word Accuracy: 96.70%
  • Report
0.963 (word 0.908) Menota AM 519 a 4to (v. 1.0.5) by de Leeuw van Weene Handrit = ✔️ 1.0 ...
CodWorm
  • Characters: 330105
  • Errors: 2979
  • Character Accuracy: 99.10%
  • Word Accuracy: 96.21%
  • Report
0.965 (word 0.862) Menota AM 242 fol (v. 0.9.9) by Karl Gunnar Johansson Handrit = ✔️ 1.0 Almost all lines. Images resized and cropped (see info).
MB
  • Characters: 1024302
  • Errors: 10128
  • Character Accuracy: 99.01%
  • Word Accuracy: 96.67%
  • Report
0.99 (word 0.972) Menota AM 132 fol (v. 1.0) by de Leeuw van Weene Handrit (but cropped for columns!) = 255/750 columns = 1/3, from the first half of the manuscript (with exceptions; cf. GT). 0.3 Trained on manually cropped columns (share per request). This model is likely overfitted.
Combined
  • Characters: 1081450
  • Errors: 27999
  • Character Accuracy: 97.41%
  • Word Accuracy: 91.42%
  • Report
0.958 (word 0.864) All of the above All of the above = WIP 0.1 A model fine-tuned on all of the manuscripts from above.

Details

  • Annotation based on the facsimile level encoding of the manuscripts (see Menota's approach to encoding manuscripts)

  • eScriptorium was utilised to align text to lines.

  • Compiled into binary with the following command:

ketos compile -F manifest.txt --random-split 0.8 0.1 0.1 -f page --workers 4

(where manifest.txt is the file containing the path of xml files)

  • The models are fine-tuned with the following command:
ketos train -f binary dataset.arrow -i catmus-medieval-1.6.0.mlmodel --resize new -d cuda:0 -o ./AM519 -B 64 -r 0.001 -u NFD

(dataset.arrow is the binary file created with the compile command above)

  • The models are evaluated with the following command:
ketos test -m AM519_best.mlmodel -f binary dataset.arrow -u NFD -d cuda:0 -B 32 --threads 4 --workers 4
  • I tried training without fine-tuning, but the results were not good at all (I did try different learning rates, but the maximal accuracy I managed to get was 5%). I used the following command:
ketos train -f binary dataset.arrow -d cuda:0 -o ./AM519 -B 64 -r 0.001

Other OICE HTR Models (as of June 2025)

The first model (AlexS) from this repository was released on 28.04.2025.

I was unaware of an undergoing development by another team, but in May 2025 Bifrost was released by Kapitan and Vidal-Gorène. They achieved remarkably good results, despite a significantly smaller training set (see comparison above). They used 8 pages from two manuscripts, whereas the "Combined" model from this repository used 73 pages from Alexanders saga, 126 pages from Codex Wormianus, and 255 columns from Möðruvallabók. See their preprint at HAL.

Contact

For inquiries of any kind, find my contact information on my website.

Created on 28.04.2025

Last updated on 28.06.2025 (or check the commits' history)