Abstract
The recognition of Arabic script and its derivatives such as Urdu, Persian, and Pashto is a difficult task due to the complexity of the script. Particularly, Urdu text recognition is more difficult due to its Nasta'liq writing style, which inherits a complex calligraphic nature. This presents major issues owing to diagonality in writing, high cursiveness, context sensitivity, and overlapping of characters. We present Multi-dimensional Long Short Term Memory (MDLSTM) Recurrent Neural Networks with an output layer designed for sequence labeling for recognition of printed Urdu text-lines written in the Nasta'liq writing style. Experiments show that MDLSTM attained a recognition accuracy of 98% for the unconstrained Urdu Nasta'liq printed text, which significantly outperforms the state-of-the-art techniques.
Introduction: The Challenge of Nasta’liq Script
Recognizing Urdu text in the Nasta’liq writing style is one of the most significant challenges in optical character recognition (OCR). Unlike the Naskh style used in Arabic, Nasta’liq is highly calligraphic and "diagonal"—the pen moves not just right-to-left, but also top-to-bottom.
The script presents several hurdles:
- Context Sensitivity: A character's shape changes drastically depending on its neighbors (initial, middle, final, or isolated positions).
- Complex Segmentation: Characters overlap vertically and horizontally, making explicit segmentation (cutting the image into individual letters) extremely error-prone.
- Scalability: Urdu has over 26,000 possible ligatures, making holistic word-based approaches computationally impractical.
Methodology
The researchers implemented a system based on Multi-dimensional Long Short Term Memory (MDLSTM) neural networks combined with a Connectionist Temporal Classification (CTC) layer.
Multi-dimensional Scanning
While standard LSTMs process data in a 1D sequence, MDLSTMs scan 2D images in four directions: top-to-bottom, bottom-to-top, left-to-right, and right-to-left. This multi-directional approach is crucial for Nasta’liq because it captures the diagonal flow and vertical overlaps that 1D horizontal scans miss.
Implicit Segmentation via CTC
Instead of trying to segment the image into characters before recognition, the CTC layer allows the network to align predicted labels with the input sequence probabilistically. This "implicit" approach bypasses the most difficult step of traditional OCR. Furthermore, the model uses raw pixel values from a 4x1 sliding patch as features, allowing the network to learn optimal representations directly from the data rather than relying on hand-crafted statistical features.
Datasets and Experimental Setup
The study utilized the Urdu Printed Text Image (UPTI) dataset, a standard benchmark for Urdu OCR. The dataset contains 10,000 text-line images with approximately 970,649 character instances. The model was trained to recognize 44 unique labels, including the 38 basic Urdu characters and common variations.
Results and Discussion
The MDLSTM system achieved a 98% recognition accuracy (2.0% character error rate), significantly outperforming previous methods such as 1D-BLSTM (94.85%) and MDLSTM using statistical features (94.97%).
A key finding was the ambiguity of the "space" character. In Nasta’liq, the gap following a "non-joiner" character (like dal or alif) often looks identical to a space between words. If these "space" errors are ignored, the model's accuracy reaches 99.82%, demonstrating its exceptional ability to recognize actual character morphologies.
Conclusion
The use of MDLSTMs with implicit segmentation provides a robust solution for the complexities of Urdu Nasta’liq OCR. Future work involves integrating language models to resolve linguistic ambiguities, such as the distinction between inter-word spaces and intra-word gaps, and testing the model on real-world, degraded historical documents.
Summary updated