CVIP 2024

Enhancing Accuracy in Indic Handwritten Text Recognition

A transformer-based recognizer (PARSeq) for handwritten text across ten Indic scripts, boosted by transfer learning from printed text.

Evani Lalitha Ajoy Mondal C. V. Jawahar
Centre for Visual Information Technology (CVIT), International Institute of Information Technology, Hyderabad, India
Paper Code
TL;DR — We adapt PARSeq, a transformer model originally built for scene-text recognition, to handwritten text across ten Indic scripts (Hindi, Bengali, Telugu, Tamil, Gujarati, Gurumukhi, Odia, Kannada, Malayalam, Urdu), beating prior CNN–RNN baselines on most languages. Pre-training on printed text before fine-tuning on handwritten text gives a further, consistent accuracy boost.
Map of India showing which Indic script is dominant in which state
Figure 1. India map representing the ten scripts dominantly used in several states.
10
Indic Scripts
evaluated
6.93
Best WER %
(Hindi)
0.98
Best CER %
(Malayalam)

Bridging Printed and Handwritten Recognition

Handwritten Text Recognition (HTR) presents a significant challenge in computer vision due to various factors such as individual writing styles, noise, blur, and other imperfections in the text. This challenge is further exacerbated when dealing with languages using Indic scripts, characterized by complex character structures, extensive character inventories, and specific cultural nuances. In this study, we address these challenges by focusing on enhancing handwritten text recognition for ten Indic languages: Hindi, Bengali, Telugu, Tamil, Gujarati, Gurumukhi, Oriya, Kannada, Malayalam, and Urdu.

We aim to improve recognition accuracy by leveraging the Permuted Autoregressive Sequence Model (PARSeq), an extension of the transformer-based model. Our results demonstrate the superiority of the PARSeq model over existing approaches, particularly in achieving state-of-the-art performance across most languages. Additionally, we investigate the efficacy of transfer learning from printed text to handwritten text, revealing its potential to enhance recognition performance. The trained models and code are publicly available.

What We Contribute

1. Transformer-based Indic HTR

Implement a transformer-based model using PARSeq to enhance recognition accuracy for Indic handwritten text.

2. State-of-the-art comparison

Compare against existing CNN/RNN-based approaches, showcasing state-of-the-art performance across most of the ten languages.

3. Transfer learning from print to handwriting

Investigate the impact of pre-training on printed text before fine-tuning on handwritten text, highlighting its effectiveness.

PARSeq: Permuted Autoregressive Sequence Model

PARSeq's encoder is a 12-layer Vision Transformer (ViT); its decoder is a single transformer layer trained with permutation language modeling, so it learns to predict output tokens in many different orders rather than strictly left-to-right, letting it draw on bidirectional context at inference time. All models were trained on the IIIT-INDIC-HW-WORDS dataset on four NVIDIA GeForce GTX 1080 Ti GPUs.

Dataset: IIIT-INDIC-HW-WORDS (Gongidi & Jawahar, ICDAR 2021) — not released with this paper; we use it as our training/evaluation data. Download from CVIT →

PARSeq architecture diagram
Figure 2. PARSeq architecture. [B], [E], and [P] are beginning-of-sequence (BOS), end-of-sequence (EOS), and padding tokens, respectively. Lce is the cross-entropy loss.

Experimental Evaluation

PARSeq is compared against two CNN/RNN-based baselines on the IIIT-INDIC-HW-WORDS dataset across ten Indic languages, using Word Error Rate (WER) and Character Error Rate (CER, both lower is better).

Quantitative Comparison

WER and CER across languages. Bold indicates our best result.

LanguageCRNNMondal et al.Ours (PARSeq)
WER↓CER↓WER↓CER↓WER↓CER↓
Hindi26.223.179.061.986.932.93
Telugu23.983.1812.112.1510.372.50
Bengali15.714.8512.342.3516.354.17
Gujarati18.592.399.211.1912.042.74
Gurumukhi18.373.4210.772.111.923.24
Kannada7.651.798.571.016.551.13
Odia19.19312.321.3214.863.38
Malayalam10.231.929.371.125.970.98
Tamil7.821.929.181.258.021.43
Urdu24.115.0718.763.8917.815.51
Qualitative comparison between CNN-RNN and PARSeq predictions
Figure 5. Qualitative comparison between the CNN–RNN model and PARSeq across ten Indic languages. Ground truth text is highlighted in blue, while incorrectly recognized text is highlighted in red.

Post-OCR Error Correction

Beyond the model itself, we apply a lexicon-based post-processing step to the predictions. A lexicon is built by concatenating the training, validation, and test sets; each predicted word is then compared against it by edit distance, and the top-k closest lexicon words are treated as candidates. At Recall 1, the single closest candidate replaces the prediction; at Recall 2–5, the candidate among the top 2–5 with the least edit distance to the ground truth is chosen. Error rates drop sharply as recall increases, confirming that most of PARSeq's mistakes are near-misses a lexicon can catch.

WER and CER (%) after post-OCR correction, at each recall level. Lower is better.

LanguageRecall 1Recall 2Recall 3Recall 4Recall 5
WER↓CER↓WER↓CER↓WER↓CER↓WER↓CER↓WER↓CER↓
Hindi4.142.033.061.592.521.342.161.151.931.05
Telugu2.841.541.681.051.310.861.130.761.040.07
Bengali7.773.665.62.84.62.324.062.083.681.83
Gujarati4.411.922.521.261.870.971.550.831.380.74
Gurumukhi6.762.874.072.063.611.63.041.382.671.21
Kannada1.640.610.870.410.710.330.490.250.390.21
Odia6.082.623.611.782.721.432.321.262.081.34
Malayalam1.290.540.710.360.530.290.440.240.350.2
Tamil1.60.780.960.540.80.470.660.410.560.37
Urdu14.755.9811.984.7910.344.129.043.648.013.29

Ablation Study: Effect of Transfer Learning

Word Error Rate with vs. without pre-training on printed text before training on handwritten text. Bold indicates the best result.

LanguageTrained modelPre-trained + Trained model
Bengali23.6919.08
Gujarati17.6912.32
Gurumukhi14.6311.92
Kannada11.597.28
Odia21.0316.78
Malayalam10.495.97
Tamil9.828.02

BibTeX

@inproceedings{evani2024indichtr, abbr = {CVIP}, title = {Enhancing Accuracy in Indic Handwritten Text Recognition}, author = {Evani, Lalitha and Mondal, Ajoy and Jawahar, C. V.}, booktitle = {International Conference on Computer Vision and Image Processing (CVIP)}, series = {Lecture Notes in Computer Science}, volume = {2473}, pages = {234--248}, publisher = {Springer Nature Switzerland}, year = {2024}, doi = {10.1007/978-3-031-93688-3_17}, url = {https://link.springer.com/chapter/10.1007/978-3-031-93688-3_17} }

Funding

This work is supported by MeitY, Government of India, through the NLTM Bhashini project.

Paper