File size: 2,335 Bytes
eccb364
 
 
 
 
 
 
 
 
 
dd9a802
 
 
 
 
 
 
cf954f2
 
dd9a802
 
 
 
cf954f2
 
 
9ddc5fc
 
cf954f2
dd9a802
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
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](https://www.arxiv.org/abs/2601.16713) 
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: