Greek Sentence-Level HTR β€” CRNN + CTC

A sentence-level Handwritten Text Recognition model for Greek polytonic script, trained on rithwikn/greek_combined_dataset.

Architecture

Component Details
CNN 5-block (64β†’128β†’256β†’256β†’512 channels, BatchNorm + ReLU + MaxPool)
RNN 2Γ— Bidirectional LSTM (512 units each, 30% dropout between layers)
Decoder CTC (BestPath greedy / BeamSearch width-100)
Input size 1024 Γ— 64 px (grayscale)
Max text len 128 characters
Batch size 8

Space-Awareness Improvements

  • Space-weighted CTC loss β€” samples with more words get higher gradient weight (SPACE_WEIGHT=3.0)
  • Trainable space logit bias β€” a learned additive offset on the space class logit (warm-started at +0.5)
  • Space-dense oversampling β€” training samples with β‰₯6 words are duplicated to increase exposure to word boundaries

Usage β€” Restore from Checkpoint

from huggingface_hub import hf_hub_download, list_repo_files

REPO_ID   = "rajesh-1902/greek-htr-crnn-ctc-spacefixweighted"
LOCAL_DIR = "./model_sentence"

# Download all files from latest/
for f in list_repo_files(REPO_ID, repo_type="model"):
    if f.startswith("latest/"):
        hf_hub_download(REPO_ID, filename=f, repo_type="model", local_dir=LOCAL_DIR)

Then run the Colab notebook β€” it will auto-restore from the checkpoint.

Training Details

  • Optimiser: Adam, lr=1e-4
  • Early stopping: 10 epochs no CER improvement
  • Data augmentation: rotation Β±2Β°, brightness jitter, Gaussian blur, horizontal stretch
  • Framework: TensorFlow 2.13 (TF1 graph mode via tf.compat.v1)
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Dataset used to train rajesh-1902/greek-htr-crnn-ctc-spacefixweighted