DastKhat is an open-source Persian handwritten text dataset created for Optical Character Recognition (OCR) and Handwritten Text Recognition (HTR) research.
The project focuses on collecting, processing, and publishing sentence-level handwritten Persian data to help researchers and developers build better Persian handwriting recognition systems.
The dataset contains handwritten Persian sentences collected from multiple contributors with different writing styles. Each handwritten sample is linked to its original Persian text annotation and metadata.
The dataset is publicly available on Hugging Face:
https://huggingface.co/datasets/MrFarahmand/DastKhat
Persian handwriting recognition remains a challenging problem due to:
- Limited publicly available Persian handwriting datasets
- Large variation in handwriting styles
- Complex Persian character forms and cursive writing
- Lack of diverse writer-independent datasets
DastKhat aims to provide an accessible resource for:
- Persian OCR research
- Handwritten Text Recognition models
- Computer Vision experiments
- Document understanding systems
- Academic projects and competitions
| Metric | Value |
|---|---|
| Language | Persian (فارسی) |
| Annotation Level | Sentence |
| Image Format | RGB |
| License | MIT |
| Current Version | v0.1 |
DastKhat/
├── data/
│ ├── samples.csv
│ └── sentences.csv
│
├── docs/
│ ├── badges/
│ │ └── Badges linked to dataset statistics
│ ├── images/
│ │ └── preview.jpg
│ └── Project documentation
│
├── scripts/
│ └── Data collection and processing tools
│
├── LICENSE
└── README.md
The dataset metadata is stored inside the data/ directory.
Contains the predefined Persian sentences used during data collection.
| Field | Description |
|---|---|
sentence_id |
Unique identifier of the sentence |
text |
Persian sentence content |
Example:
sentence_id,text
000001,امروز هوا بسیار خوب است.
000002,یادگیری ماشین یکی از شاخههای هوش مصنوعی است.Contains information about each handwritten sample.
| Field | Description |
|---|---|
sample_id |
Unique identifier for handwritten sample |
participant_id |
Identifier of contributor |
sentence_id |
Related sentence identifier |
text |
Ground truth transcription |
split |
Dataset split |
Example:
sample_id,participant_id,sentence_id,text,split
000001,P001,000001,امروز هوا بسیار خوب است.,trainThe dataset is created through the following workflow:
Sentence Generation
|
v
Handwriting Sheet Creation
|
v
Participant Writing
|
v
Scanning / Image Collection
|
v
Handwritten Region Detection
|
v
Sentence Image Cropping
|
v
Metadata Generation
|
v
Dataset Release
DastKhat is an open-source project and contributions are welcome.
There are several ways to contribute:
Participants can contribute handwritten Persian samples through:
https://www.dastkhatproject.ir
Contributors will be acknowledged in future dataset releases and publications.
Developers can contribute by:
- Improving preprocessing scripts
- Adding data validation tools
- Improving documentation
- Creating visualization tools
- Developing training pipelines
- Reporting bugs and suggesting improvements
Clone the repository:
git clone https://github.com/AmirRezaFarahmand/DastKhat.git
cd DastKhatInstall required dependencies:
pip install -r requirements.txt(Dependency setup will be added as the processing pipeline evolves.)
The scripts/ directory contains utilities used for:
- Dataset generation
- Image preprocessing
- Metadata creation
- Validation
- Dataset maintenance
Each script contains its own documentation and usage instructions.
DastKhat can be used for:
- Persian OCR systems
- Handwritten text recognition models
- CNN/Transformer-based vision models
- Document AI research
- Writer identification experiments
- Handwriting style analysis
Recommended evaluation metrics:
- Character Error Rate (CER)
- Word Error Rate (WER)
- Sequence Accuracy
Initial public release.
Included:
- 8 writers
- 560 handwritten samples
- 700 predefined sentences
Planned improvements:
- Increase number of contributors
- Expand handwriting styles
- Improve dataset validation
- Add more benchmark experiments
- Release training baselines
If you use DastKhat in your research, please cite:
@dataset{farahmandfar2026dastkhat,
author = {Farahmandfar, AmirReza},
title = {DastKhat: A Persian Handwritten Text Dataset},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/datasets/MrFarahmand/DastKhat}
}This project is released under the MIT License.
See:
LICENSE
for more information.
Special thanks to everyone who contributed their handwriting samples and helped make DastKhat possible.
AmirReza Farahmand
- GitHub: https://github.com/AmirRezaFarahmand
- Hugging Face: https://huggingface.co/MrFarahmand
