PHTD / README.md
sana-ngu's picture
Update README.md
9ddc5fc verified
metadata
license: mit
language:
  - fa
tags:
  - HTR
  - Arabic-scripts
  - persian-HTR
size_categories:
  - 1K<n<10K

PHTD Line-Level Dataset (Cleaned and Split Version)

Important: I am not the creator or copyright holder of the original PHTD dataset.
The underlying handwritten Persian page images and pixel-level masks were introduced in the following works:

  1. **Alaei et al., “A New Dataset of Persian Handwritten Documents and Its Segmentation,” **
  2. **Alaei, Pal & Nagabhushan, “Dataset and ground truth for handwritten text in four different scripts,” **

This repository provides a processed, line-level version of that dataset, created for reproducible handwritten text recognition (HTR) research and for use with the CRHV framework.

📌 Citation

If you use this processed line-level dataset, please cite our paper:CER-HV: A CER-Based Human-in-the-Loop Framework for Cleaning Datasets Applied to Arabic-Script HTR and cite the original creators

✨ What This Version Provides

The original PHTD dataset contains page-level images with pixel-wise segmentation masks identifying individual text lines.
However, it does not include:

  • extracted line images,
  • standardized train/validation/test splits,
  • or a leakage-free partition.

This dataset aims to provide exactly that.

✔ Line Image Extraction

Using the original pixel masks provided in the dataset, each text line was isolated by:

  • extracting the minimal bounding box of each mask region,
  • applying a 5-pixel padding margin,
  • masking out all non-target pixels,
  • and generating a clean cropped line image.

This results in accurate line-level samples that preserve the original handwritten content.

✔ Leakage-Free Dataset Splits

The original page set contains near-duplicate pages and text overlaps.
To prevent data leakage between training and evaluation splits:

  • we computed pairwise similarity between pages,
  • identified overlapping and duplicate pages,
  • restricted validation and test sets to non-overlapping pages only.

This ensures that evaluation is fair and does not unintentionally benefit from training-page content.

✔ Standardized Train/Validation/Test Structure

Each split follows a unified directory structure: