bbOCR: An Open-source Multi-domain OCR Pipeline for Bengali Documents

Imam Mohammad Zulkarnain, Shayekh Bin Islam, Md. Zami Al Zunaed Farabe, Md. Mehedi Hasan Shawon, Jawaril Munshad Abedin, Beig Rajibul Hasan, Marsia Haque Meghla, Md. Istiak Hossain Shihab, Syed Mobassir Hossen, Md. Nazmuddoha Ansary, Asif Shahriyar Sushmit, Farig SadequearXiv 2023 · DOI

Abstract

Bengali is the sixth most spoken language globally, yet it remains underserved by modern Document AI tools. We present bbOCR, a comprehensive, open-source OCR pipeline designed to transform complex Bengali documents into structured, searchable HTML. By integrating advanced preprocessing, layout analysis, and a novel recognition model (APSIS-Net), bbOCR significantly outperforms existing solutions like Tesseract in character and word accuracy across diverse document domains.

Introduction

Despite its vast speaker base of over 330 million, Bengali is categorized as a "low-resource" language in the Document AI field. The script's complex alphasyllabary nature poses significant challenges for standard OCR engines. Furthermore, real-world digitization requires more than simple text recognition; it must account for physical document degradation, such as warping from book spines, poor lighting, and intricate multi-column layouts. Existing open-source tools often fail to provide a holistic solution that preserves document structure while maintaining high recognition accuracy.

Methodology

The bbOCR (Bengali.AI-BRACU OCR) pipeline decomposes the digitization process into five specialized stages:

  1. Preprocessing: To handle physical artifacts, the system employs PaperEdge for geometric unwarping and DocTr for illumination correction and shadow removal.
  2. Document Layout Analysis (DLA): A YOLOv8-based model identifies and classifies regions of interest, such as paragraphs, images, and tables.
  3. Line and Word Detection: Utilizing a Differentiable Binarization Network (DBNet), the pipeline precisely locates text lines and individual words within the identified regions.
  4. Word Recognition (APSIS-Net): A novel CNN-based attention encoder with a positional alignment branch predicts Unicode text from word-level images.
  5. HTML Reconstruction: A rule-based module synthesizes the coordinates and recognized text into a structured HTML format, preserving the original visual flow.
The multi-stage bbOCR pipeline architecture.

Experimental Setup and Datasets

To train and evaluate bbOCR, the authors developed several key resources:

  • Synthetic Datasets: Bengali SynthTIGER (10.2M samples) and Bengali SynthINDIC (700k samples) were created to provide high-volume training data across diverse fonts and augmentations.
  • BCD3 Benchmark: The Bengali Complete Document Decomposition Dataset contains 228 scanned pages from nine domains, including magazines and historical newspapers, featuring 88.5k manually annotated words.
  • BaDLAD: This large-scale dataset was utilized for training the layout analysis module.
Example of a complex document layout from the BCD3 dataset.

Results and Discussion

Comparative analysis against Tesseract demonstrates the superior performance of bbOCR. The system achieved a Character Error Rate (CER) of 0.59 and a Word Error Rate (WER) of 0.80, significantly lower than Tesseract's 0.78 CER and 0.97 WER.

Key insights from the development process include:

  • Preprocessing Impact: Accuracy improves dramatically when geometric and illumination corrections are applied prior to recognition.
  • Synthetic Data Utility: Adapting synthetic generation tools for Bengali ligatures allows for effective model generalization without the need for massive manual annotation.
  • Structural Preservation: The focus on HTML reconstruction ensures that digitized documents remain useful for archival and search applications by maintaining their original layout.

Conclusion and Future Work

While bbOCR represents a significant advancement for Bengali digitization, limitations remain. The current pipeline is optimized for printed text and struggles with handwriting or extremely low-resolution images. Additionally, while table regions are identified, internal cell structure extraction is not yet supported. Future work will focus on expanding language support, improving handwriting recognition, and enhancing the intelligence of the layout reconstruction module.

Summary updated

BibTeX
@misc{zulkarnain2023bbocr,
  author = {Imam Mohammad Zulkarnain and Shayekh Bin Islam and Md. Zami Al Zunaed Farabe and Md. Mehedi Hasan Shawon and Jawaril Munshad Abedin and Beig Rajibul Hasan and Marsia Haque Meghla and Md. Istiak Hossain Shihab and Syed Mobassir Hossen and Md. Nazmuddoha Ansary and Asif Shahriyar Sushmit and Farig Sadeque},
  title = {{bbOCR: An Open-source Multi-domain OCR Pipeline for Bengali Documents}},
  year = {2023},
  eprint = {2308.10647},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.10647},
}
Figure