Handwritten Urdu Character Recognition using 1-Dimensional BLSTM Classifier

Saad Bin Ahmed, Saeeda Naz, Salahuddin Swati, Muhammad Imran RazzakarXiv 2017

Introduction

Optical Character Recognition (OCR) for cursive scripts like Urdu presents significant computational challenges. Unlike the flatter Naskh style common in Arabic, Urdu predominantly utilizes the Nasta’liq script. Nasta’liq is characterized by its diagonal flow from top-right to bottom-left, the absence of a fixed baseline, and complex overlapping ligatures.

Structural features of the Urdu Nasta’liq script, including writing direction and ligatures.

Historically, the development of Urdu OCR has been hindered by the lack of standardized, large-scale public datasets for handwritten text. This paper addresses this gap by introducing the Urdu Nastaliq Handwritten Dataset (UNHD) and proposing a recognition system based on a 1-Dimensional Bidirectional Long Short-Term Memory (BLSTM) classifier.

The Urdu Nastaliq Handwritten Dataset (UNHD)

The UNHD is a comprehensive benchmark designed to facilitate research in handwritten Urdu recognition. It comprises 10,000 lines of text contributed by 500 different writers, totaling approximately 312,000 words and 187,200 characters. The dataset is diverse, covering digits, various parts of speech, and common ligatures, making it a unique resource compared to existing synthetic or Latin-based datasets.

Methodology

The proposed recognition pipeline involves several critical stages to manage the script's inherent complexity:

  1. Data Acquisition and Preprocessing: To simplify noise removal, samples were collected using red ink. This allowed for easy isolation of text from standard scanner noise. Preprocessing steps included grayscale conversion, skew correction via horizontal projection, and text-line segmentation.
  2. Feature Extraction: A sliding window approach (30x1 pixels) was used to extract sequential pixel features from the segmented lines.
  3. Classification: A 1D-BLSTM network was employed. BLSTMs are particularly suited for Nasta’liq because they capture both preceding and succeeding context, which is essential as character shapes change based on their position (initial, middle, final, or isolated).
The multi-stage preprocessing pipeline from original image to segmented textlines.

Key Results and Insights

The study demonstrates that sequence-learning models are vital for Nasta’liq due to its contextual dependencies. Experimental results showed that the system achieved a character-level error rate (CER) between 6.04% and 7.93%.

A key finding was the impact of network architecture on performance: a hidden layer size of 100 neurons was found to be optimal. Beyond this point, the error rate increased, likely due to overfitting. Furthermore, the "red ink trick" proved to be an effective hardware-level preprocessing strategy, significantly improving data integrity during binarization.

Conclusion and Future Directions

The introduction of the UNHD provides a much-needed foundation for Urdu handwriting research. While the 1D-BLSTM achieved promising results, future work will explore 2-Dimensional BLSTMs to better capture the vertical dependencies of the script. Additionally, integrating language models and expanding the dataset to 1,000 writers are planned to further enhance recognition accuracy and stylistic robustness.

Summary updated

BibTeX
@misc{ahmed2017handwritten,
  author = {Saad Bin Ahmed and Saeeda Naz and Salahuddin Swati and Muhammad Imran Razzak},
  title = {{Handwritten Urdu Character Recognition using 1-Dimensional BLSTM Classifier}},
  year = {2017},
  eprint = {1705.05455},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1705.05455},
}
Figure