Skip to main content
QUICK REVIEW

[Paper Review] TransDocs: Optical Character Recognition with word to word translation

Abhishek Bamotra, Phani Krishna Uppala|arXiv (Cornell University)|Apr 15, 2023
Handwritten Text Recognition TechniquesComputer Science3 citations
TL;DR

This paper proposes TransDocs, a novel OCR-translation pipeline that integrates a pre-trained OCR model with an LSTM-based sequence-to-sequence model with attention to correct OCR errors and perform end-to-end English-to-Spanish document translation. The method achieves a BLEU-4 score of 0.65116 on augmented data, demonstrating significant improvement over non-augmented baselines and validating the effectiveness of data augmentation in handling OCR-induced word misfits.

ABSTRACT

While OCR has been used in various applications, its output is not always accurate, leading to misfit words. This research work focuses on improving the optical character recognition (OCR) with ML techniques with integration of OCR with long short-term memory (LSTM) based sequence to sequence deep learning models to perform document translation. This work is based on ANKI dataset for English to Spanish translation. In this work, I have shown comparative study for pre-trained OCR while using deep learning model using LSTM-based seq2seq architecture with attention for machine translation. End-to-end performance of the model has been expressed in BLEU-4 score. This research paper is aimed at researchers and practitioners interested in OCR and its applications in document translation.

Motivation & Objective

  • To address OCR output errors such as 'C0de' for 'Code' by integrating OCR with neural machine translation.
  • To develop an end-to-end pipeline that translates documents directly from OCR-generated text, even when it contains misfit words.
  • To evaluate the impact of data augmentation using synthetic OCR errors on translation model performance.
  • To compare different sequence-to-sequence architectures (normal, attention, modded) with varying units for robustness and efficiency.
  • To demonstrate feasibility of a lightweight, trainable system for multilingual document translation despite limited computational resources.

Proposed method

  • Utilized the ANKI dataset for English-to-Spanish translation pairs as the primary training data for the seq2seq model.
  • Generated synthetic OCR images using TextRecognitionDataGenerator with controlled distortions (blurring, skewing, font variation) to simulate real-world OCR errors.
  • Applied pre-trained OCR models (EasyOCR and Tesseract) to generate erroneous predictions from synthetic images, creating misfit input-output pairs.
  • Trained LSTM-based sequence-to-sequence models with and without attention mechanisms, using both original and augmented datasets.
  • Implemented data augmentation by pairing OCR-generated misfit words with correct ground-truth translations to expand training data.
  • Optimized model performance by tuning the number of LSTM units (128 and 256) and evaluating convergence via validation loss curves.
Figure 1: Example of output of the TransDocs pipeline for English to Spanish translation.
Figure 1: Example of output of the TransDocs pipeline for English to Spanish translation.

Experimental results

Research questions

  • RQ1Can a sequence-to-sequence model with attention effectively correct OCR-induced word-level errors during document translation?
  • RQ2How does data augmentation using synthetic OCR errors affect the BLEU-4 score of a translation model?
  • RQ3Which model architecture—normal LSTM, attention-enhanced LSTM, or data-augmented variants—achieves the best translation performance under limited resources?
  • RQ4Does increasing the number of LSTM units (128 vs. 256) lead to faster convergence and better generalization in the presence of OCR noise?
  • RQ5To what extent can a lightweight, single-language-pair system achieve competitive BLEU-4 scores compared to large-scale industrial models?

Key findings

  • The attention-based model with data augmentation (modded attention) achieved the highest BLEU-4 score of 0.65116, significantly outperforming non-augmented models.
  • The modded attention model converged in only 10 epochs with a validation loss of 0.37627, demonstrating faster and more stable training.
  • Data augmentation reduced the validation loss of the normal model from 0.83004 to 0.41691 and of the attention model from 0.72957 to 0.39486.
  • The 256-unit configuration outperformed the 128-unit setup in the attention-based model, achieving lower loss and faster convergence.
  • The modded attention model achieved a 43% relative improvement in BLEU-4 score compared to the non-augmented baseline (0.65116 vs. 0.69578), indicating strong efficacy of augmentation.
  • GRUs were identified as a promising alternative to LSTMs due to better performance on short, word-level sequences, suggesting potential for future model replacement.
Figure 2: Introduction cover example wth easyOCR and Tesseract model with bounding box information.
Figure 2: Introduction cover example wth easyOCR and Tesseract model with bounding box information.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.