Sitemap

Glyphos: Ancient Greek OCR for Printed and Handwritten Text

4 min readDec 5, 2025

--

Philip Booth

1. Introduction

Ancient Greek texts present challenges that modern OCR systems are not built to handle. Polytonic Greek contains dozens of accented variants for each vowel, historical ligatures, irregular character spacing, and complex breathing marks. While printed Greek is moderately tractable, handwritten Greek remains extremely difficult due to stylistic variation and diacritic instability.

My project, Glyphos, aims to build a specialized OCR pipeline tailored for Ancient Greek, first for printed text, then extended to handwritten text, using image preprocessing, Bidirectional LSTMs with CTC loss, and transfer learning. The project draws directly from my background: after spending the summer of 2021 manually transcribing Latin and Greek Ad Usum Delphini, I wanted to understand why OCR fails on Ancient Greek and whether a dedicated model could meaningfully improve accuracy.

2. Motivation and Social Impact

Accurate Greek OCR benefits scholarship across Classics, history, linguistics, and digital humanities:

  • It reduces reliance on manual transcription, still the norm today.
  • Existing OCR engines frequently drop diacritics, breathings, and iota subscripts.
  • Ancient Greek manuscripts remain largely inaccessible for large-scale digital analysis.

Glyphos aims to fill this gap by developing an OCR system that respects the structure and typography of Ancient Greek. The project ties together my interests in Classics and Data Science and aligns with the course’s goals of creativity, technical rigor, and social impact.

3. Dataset

The project uses the GROPLY-DB dataset, which contains both printed and handwritten Ancient Greek text.

Printed Subset

  • ~5,000 clean printed lines
  • Consistent typography
  • Ideal for baseline training

Handwritten Subset

  • ~693 handwritten lines
  • Minimal stylistic variation
  • Highly irregular diacritics
  • Too small for training a model from scratch

This imbalance shaped the modeling approach: printed → handwritten transfer became the most effective strategy.

4. Methodology

4.1 Preprocessing

I used OpenCV-based preprocessing (per the original project proposal):

  • Conversion to grayscale
  • Thresholding and noise reduction
  • Height normalization to 48 px
  • Sequence formatting for CTC decoding

These steps regularize the input for LSTM-based recognition.

4.2 Model Architectures

A. Bidirectional LSTM (Printed → Handwritten Transfer Learning)

This became the strongest model in the project.

Training Pipeline:

  1. Train on ~4,500 printed lines to learn:
  • character geometry
  • diacritic placement
  • stroke proportions

2. Fine-tune on 554 handwritten lines

3. Validate on 69 unseen handwritten lines

Performance:

  • 72.5% character accuracy
  • 27.5% CER — the best result in the project
  • Successfully adapted to handwritten slant, cursive connections, and diacritic compression

This result demonstrates that printed Greek is an effective pretraining domain for handwritten Greek, something I wanted to test from the start.

B. TcOCR Transfer Learning Attempt (English → Greek)

Before developing the printed→handwritten LSTM, I explored a second transfer strategy: using TcOCR, a pretrained handwriting model originally trained on English.

Approach:

  • Replace the English vocabulary with a custom Ancient Greek vocabulary
  • Fine-tune on handwritten Greek lines

Performance:

  • 15.48% accuracy
  • 84.52% CER (the worst-performing model)
  • Model produced English-like stroke approximations and nonsensical Greek sequences

The example predictions on slide page 7 make this clear: the model fails dramatically on accents and overall structure.

Get Philip Booth’s stories in your inbox

Join Medium for free to get updates from this writer.

This experiment demonstrated that cross-alphabet transfer (English → Greek) does not work, while within-alphabet transfer (printed Greek → handwritten Greek) does.

C. Bidirectional LSTM (Handwritten Only)

I also trained an LSTM solely on the handwritten subset.

  • Training loss → nearly zero
  • Validation accuracy → extremely low
  • Model memorized the training lines but did not generalize

This result confirmed the expected limitation of low-resource handwritten OCR: 693 lines is nowhere near enough to train a generalizable handwritten model from scratch.

5. Demo Notebook

I created a public Kaggle notebook showing:

  • printed predictions
  • handwritten predictions
  • LSTM vs. transfer-trained vs. TcOCR results
  • true text vs. model outputs

This serves as the public engagement component of the project.

6. Results Summary

| Model                          | Training Data               | CER            | Notes                               |
| ------------------------------ | --------------------------- | -------------- | ----------------------------------- |
| **Printed → Handwritten LSTM** | Printed lines → handwritten | **27.5%** | **Best-performing model** |
| **TcOCR Fine-tuned** | English → Greek | **84.52%** | Cross-alphabet transfer fails |
| **Handwritten-only LSTM** | 693 handwritten lines | extremely high | Memorization without generalization |

7. Discussion

Why handwritten Greek is difficult

As illustrated in my slides:

  • ~260 character classes (letters + diacritics)
  • Frequent diacritic collisions
  • Highly variable handwriting
  • Sparse training data
  • Slanted or cursive strokes hide breathing marks

These visual inconsistencies cause even state-of-the-art OCR systems to collapse under noise.

Why the printed→handwritten model worked

The printed pretraining stage taught the model a stable character schema, which fine-tuning could adapt to personal handwriting style.

Why TcOCR failed

TcOCR was trained on English handwriting, which differs fundamentally in:

  • stroke shapes
  • alphabet geometry
  • diacritic absence
  • baseline structure

Therefore, the model could not adapt meaningfully to Ancient Greek.

8. Limitations

  1. Handwritten dataset is too small to support deep models.
  2. Only one handwriting style is represented.
  3. No segmentation model (lines are pre-segmented).
  4. High error rate on real manuscripts due to noise and variability.
  5. Diacritics are extremely fragile, collapsing into loops or specks.

9. Future Work

A. Expand handwritten training corpus

Using classroom notes, manuscripts, or synthetic handwriting generation.

B. Upgrade to CNN–BiLSTM–CTC

A CRNN architecture would likely outperform LSTM-only models.

C. Add semantic post-processing

Using embeddings or RAG methods to match extracted lines to known texts — helpful for quotation extraction in research.

D. Build a manuscript-digitization pipeline

Including segmentation, Unicode normalization, and searchable database output.

These directions align with the ideas on my “Further Research” slide: digitizing manuscripts, OCR + semantic retrieval, and digitized note transcription.

10. Conclusion

This project produced a functioning Ancient Greek OCR pipeline, achieving 27.5% CER on handwritten lines using a printed→handwritten transfer-trained LSTM, which is a very strong baseline for a low-resource script.

Key takeaways:

  • Handwritten Ancient Greek OCR is significantly harder than I expected.
  • Printed Greek provides a strong pretraining domain for handwritten Greek.
  • Cross-alphabet transfer learning (TcOCR) fails, while same-alphabet transfer succeeds.
  • The most significant bottleneck is data scarcity, not model capacity.
  • The project successfully bridges my interests in Classics, data science, and computer vision.

But Glyphos shows that thoughtful modeling and domain-specific insight can move the problem meaningfully forward.

--

--