A deep learning based arabic script recognition system: benchmark on KHAT

Riaz Ahmad, Saeeda Naz, Muhammad Zeshan Afzal, Sheikh Faisal Rashid, Marcus Liwicki

Abstract

Handwritten Arabic text recognition presents significant challenges due to its cursive nature, overlapping characters, and complex diacritics. This paper establishes a new benchmark by combining Multi-Dimensional Long Short-Term Memory (MDLSTM) networks with Connectionist Temporal Classification (CTC). By implementing a robust data augmentation pipeline that quintuples the training data, the researchers achieved a character recognition rate of 80.02% on the KHATT dataset, significantly outperforming previous baselines.

Introduction: The Challenge of Arabic Script

While Optical Character Recognition (OCR) for Latin scripts has reached near-perfect accuracy, handwritten Arabic remains a formidable challenge. The script is inherently cursive, with character shapes changing based on their position (initial, medial, final, or isolated) and frequently overlapping.

Beyond cursiveness, Arabic features complex "fine inflammation"—dots (i'jaz), diacritics, and strokes that are essential for meaning but difficult for machines to distinguish from noise. Traditional methods often struggle at the segmentation stage, where the system attempts to isolate individual letters. This research aims to bypass explicit segmentation and improve recognition accuracy on unconstrained, complex handwritten samples.

Example of a handwritten Arabic text line from the KHATT dataset and its corresponding ground truth transcription.

Methodology

The proposed architecture avoids manual character segmentation through a deep learning approach:

  1. Pre-processing: Extra white space is pruned, and text lines are "de-skewed" to ensure horizontal alignment.
  2. Data Augmentation: To address limited dataset sizes, five synthetic variations were generated for every original image, including blurring, contour emphasis, edge enhancement, "bleed-through" effects, and random pixel distortion.
  3. MDLSTM (Multi-Dimensional Long Short-Term Memory): Unlike standard 1D LSTMs, MDLSTMs scan in four directions (horizontal and vertical). This captures spatial relationships of dots and strokes positioned above or below the main text line.
  4. CTC (Connectionist Temporal Classification): This layer maps input sequences to label sequences without requiring explicit character boundaries, performing "implicit segmentation."
The data augmentation pipeline, showing (a) original sample, (b) blur, (c) contours, and (d) edge enhancement.

Datasets and Benchmarking

The study utilizes the KHATT (KFUPM Handwritten Arabic TexT) dataset, comprising 6,728 unique text lines from 1,000 different writers. Through augmentation, this was expanded to 33,640 images. A 5-fold cross-validation approach ensured consistent results across the dataset.

Key Results and Insights

The system achieved a Character Recognition (CR) Rate of 80.02%, a significant improvement over the 75.08% baseline. The Character Error Rate (CER) was 19.98%. Notably, the system outperformed traditional Hidden Markov Model (HMM) tools, which only reached 46.13% on the same data.

Key insights include:

  • The Power of Multi-Directionality: Scanning vertically as well as horizontally is crucial for Arabic. Because dots and diacritics are positioned above or below the primary body of the word, a 1D scan often misses the context needed to distinguish between similar-looking letters.
  • Implicit over Explicit Segmentation: By using CTC, the researchers sidestep the most difficult part of Arabic OCR. Instead of trying to find the "cut point" between two connected letters, the model learns the probability of a character appearing within a window of time/space.
  • Synthetic Variety Matters: The significant jump in accuracy was largely attributed to data augmentation. Simulating "bleed-through" and "blur" helps the model generalize to real-world, messy documents.

Conclusion and Future Directions

While the results are promising, dataset size remains a bottleneck. Future work will explore more diverse data augmentation (simulating different pens and styles), deeper LSTM architectures, and the integration of language models to refine output based on linguistic probability.

Summary updated

BibTeX
@article{ahmad2020deep,
  author = {Riaz Ahmad and Saeeda Naz and Muhammad Zeshan Afzal and Sheikh Faisal Rashid and Marcus Liwicki},
  title = {{A deep learning based arabic script recognition system: benchmark on KHAT}},
  journal = {Int. Arab J. Inf. Technol.},
  year = {2020},
  doi = {10.34028/iajit/17/3/3},
}
Figure