← sakibchowdhury131.github.io

SynthNID: Synthetic Data to Improve End-to-end Bangla Document Key Information Extraction

Syed Mostofa Monsur  ·  Shariar Kabir  ·  Sakib Chowdhury
Celloscope Ltd.  —  equal contribution
EMNLP 2023 · Bangla Language Processing Workshop
Paper (PDF) ACL Anthology Code BibTeX
Conference talk recording (BLP-2023 workshop, EMNLP 2023).

Abstract

End-to-end Document Key Information Extraction models require a lot of compute and labeled data to perform well on real datasets. This is particularly challenging for low-resource languages like Bangla where domain-specific multimodal document datasets are scarcely available. In this paper, we have introduced SynthNID, a system to generate domain-specific document image data for training OCR-less end-to-end Key Information Extraction systems. We show the generated data improves the performance of the extraction model on real datasets and the system is easily extendable to generate other types of scanned documents for a wide range of document understanding tasks.

Highlights

Method

Document Key Information Extraction (KIE) systems that rely on OCR plus rule-based parsing are brittle to the many visual transformations found in real scanned documents, and end-to-end vision-transformer models like the OCR-free document understanding transformer need huge labeled datasets that simply don’t exist for Bangla. SynthNID closes this gap by generating realistic, domain-specific synthetic training documents — targeting the Bangladeshi National ID card, which mixes Bangla and English text.

Four-step pipeline: empty overlay, dynamically generated overlay with random names and IDs, composited onto a random background, then noise and blur effects applied
Figure 1 — Synthetic NID generation pipeline. A blank overlay (1) is filled with randomly sampled domain-specific fields — names and IDs (2) — composited onto a randomly chosen background photo (3), then perturbed with blur and noise (4).

Random Bangladeshi first/middle/last names (for both Bangla and English name fields), dates of birth, and ID numbers are sampled and inserted into the dynamic slots of a blank NID overlay. The filled overlay is then composited onto a randomly chosen background image, covering 75–90% of the frame after a random rotation, and finally passed through random blur and noise augmentation. The approach generalizes easily to other scanned-document types beyond the NID card.

For real data, 11,390 NID photos were collected via a mobile app with a guiding capture rectangle (10,890 for training/validation, 500 held out for testing) — naturally including some noisy, faded, or tilted captures that make real data harder than synthetic data for the model.

Experiments

The Donut (OCR-free document understanding transformer) base model is fine-tuned with a BanglaBERT-large multilingual tokenizer to extract six fields from the NID — three Bangla (name, father’s name, mother’s name) and three English/numeric (name, date of birth, ID number) — evaluated with tree edit distance (TED) accuracy against 500 held-out real and 500 synthetic test images.

Training Data (synth:real)Real Test AccuracySynthetic Test Accuracy
BanglaEnglishOverallBanglaEnglishOverall
50K : 0K25.96%31.10%25.02%90.71%94.55%92.37%
0K : 10K76.55%82.92%79.28%80.08%92.80%85.91%
2K : 10K78.76%83.95%81.14%83.57%96.54%89.54%
5K : 10K80.56%83.79%82.01%85.58%98.52%91.55%
10K : 10K81.53%83.73%82.5%85.79%98.79%91.59%
50K : 10K81.35%84.6%82.74%89.06%99.39%93.72%

Training on synthetic data alone (50K:0K) performs well on synthetic test data but poorly on real data — the model never learns to handle real-world variation. Training on real data alone (0K:10K) does much better, but is comparatively weak on Bangla-script fields (76.55%). Adding synthetic data on top of the full real dataset improves real-data accuracy monotonically as more synthetic data is added, with the biggest gains on the Bangla fields — up to a point: mixing in as much synthetic (50K) as real (10K) data gives the best overall real-data accuracy, though Bangla-field accuracy alone peaks slightly earlier at 10K:10K, suggesting diminishing (and eventually slightly negative) returns once synthetic data substantially outweighs real data.

Ethical Considerations

The mobile data-collection app was used internally, with informed consent from participants and strict anonymization applied to real data used for evaluation. All fields inserted into the synthetic documents — names, dates of birth, ID numbers — are randomly generated rather than drawn from any real individual’s data.

Conclusion

SynthNID generates high-quality, domain-specific synthetic documents for Bangla Key Information Extraction, and shows that mixing this synthetic data with real data measurably improves an end-to-end extraction model’s performance on real National ID cards — particularly for Bangla-script fields, where labeled real data is scarcest. The same pipeline extends readily to other scanned-document types beyond the NID card, offering a low-cost way to bootstrap document understanding datasets for low-resource languages.

Citation

@inproceedings{monsur-etal-2023-synthnid,
  title     = {{S}ynth{NID}: Synthetic Data to Improve End-to-end
               {B}angla Document Key Information Extraction},
  author    = {Monsur, Syed Mostofa and Kabir, Shariar and Chowdhury, Sakib},
  booktitle = {Proceedings of the First Workshop on Bangla Language
               Processing (BLP-2023)},
  year      = {2023},
  pages     = {117--123},
  publisher = {Association for Computational Linguistics},
  url       = {https://aclanthology.org/2023.banglalp-1.13/}
}