This model is open to anyone who wants to fine-tune this model to whatever burmese-language related OCR task. This model works particularly well in printed Burmese PDFs and documents of different fonts and writing styles, further training on burmese handwritten data and mixed data (mixture of printed and handwritten documents) will help to drive down error rates for this model. This model already works particularly well for handwritten data given the sparse training set that was available to me!
Burmese Line-level recognition OCR
CRNN + CTC + Beam Search architecture
Made with the intention of training for Myanmar (Burmese) receipt line recognition but generalizes well to general printed burmese of different fonts as shown in the results. Would perform much better with more real world burmese receipt line-level training data. Given the heterogenous and sparse nature of burmese handwritten data that I had to work with, 19% CER is a good starting point but can be improved with access to more training data. (Feel free to reach out to me ethenhanthit@gmail.com if you'd like to work with me on this project)
This model was trained on a mix weigted random sampling batches - derived from burmese datasets found via the internet from various sources. Synthetically generated data made to match line items typically found in burmese receipts - were also geneerated from this sources. Each training batch has an equal mix of each souce including synthetic data.
Results
Test set of personally collected real-world Burmese receipts (held-out test) = 19.4% CER myOCR validation (Printed Burmese books, press docs) = 0.97% CER alex validation (Printed Burmese documents) = 2.38% CER BHSD validation (Handwritten Burmese sentences) = 21.75% CER
Files
crnn_best.ptβ CRNN model weightschar_lm_4gram_v5.jsonβ modelhistory.jsonβ training metrics per epoch
Quick usage
See the full code and inference example at https://github.com/ethenhan12/yayshay
from huggingface_hub import hf_hub_download
import torch
ckpt_path = hf_hub_download("ethanhan12/burmese_line_level_ocr", "crnn_best.pt")
lm_path = hf_hub_download("ethanhan12/burmese_line_level_ocr", "char_lm_4gram_v5.json")
Training data
5-way balanced mix (20% each):
alexbeatson/burmese_ocr_dataβ printed Burmese (government docs)DatarrX/Burmese-Handwritten-Sentence-Datasetβ handwritten sentencesPyaeLinn/myNRC-OCR_Sample-Datasetβ handwritten Burmese dates (NRC fields)chuuhtetnaing/myOCRβ printed Burmese (books/press)- synthetic receipts generated from these datasets
All data inputs have been preprocessed by Otsu for generating line-level inputs.
Citations and Key Dataset Sources
- Shi, Bai, Yao 2017 β CRNN (TPAMI)
- Graves et al. 2006 β Connectionist Temporal Classification (ICML)
- Hannun et al. 2014 β DeepSpeech beam search + LM fusion
- Aung, Thu, Oo 2024 β myOCR (iSAI-NLP)
Citations
If you use this model or its code, please cite the architecture references and the training datasets:
Architecture
@article{shi2017crnn,
title={An End-to-End Trainable Neural Network for Image-Based Sequence Recognition
and Its Application to Scene Text Recognition},
author={Shi, Baoguang and Bai, Xiang and Yao, Cong},
journal={IEEE TPAMI},
volume={39},
number={11},
pages={2298--2304},
year={2017}
}
@inproceedings{graves2006ctc,
title={Connectionist Temporal Classification: Labelling Unsegmented Sequence Data
with Recurrent Neural Networks},
author={Graves, Alex and Fern{\'a}ndez, Santiago and Gomez, Faustino and Schmidhuber, J{\"u}rgen},
booktitle={ICML},
year={2006}
}
@article{hannun2014deepspeech,
title={First-Pass Large Vocabulary Continuous Speech Recognition using
Bi-Directional Recurrent DNNs},
author={Hannun, Awni and Maas, Andrew and Jurafsky, Daniel and Ng, Andrew},
journal={arXiv:1408.2873},
year={2014}
}
Training datasets
@misc{alexbeatson2023burmeseocr,
title={burmese\_ocr\_data},
author={Beatson, Alex},
year={2023},
howpublished={Hugging Face Datasets},
doi={10.57967/hf/3361},
url={https://huggingface.co/datasets/alexbeatson/burmese_ocr_data}
}
@misc{datarrx_bhsd,
title={Burmese Handwritten Sentence Dataset (BHSD)},
author={DatarrX},
howpublished={Hugging Face Datasets},
url={https://huggingface.co/datasets/DatarrX/Burmese-Handwritten-Sentence-Dataset}
}
@misc{pyaelinn_mynrc,
title={myNRC-OCR Sample Dataset},
author={Pyae Linn},
howpublished={Hugging Face Datasets (gated)},
url={https://huggingface.co/datasets/PyaeLinn/myNRC-OCR_Sample-Dataset}
}
@misc{chuuhtetnaing_myocr,
title={myOCR (preprocessed HuggingFace fork of LULab/myOCR)},
author={Chuu Htet Naing},
howpublished={Hugging Face Datasets},
url={https://huggingface.co/datasets/chuuhtetnaing/myOCR}
}
Sample outputs :
Here in our outputs - we see that it performs reliably well on burmese documents, it starts to degrade once it gets fed more informal and unstructured handwriting with image degradations.
See https://github.com/HanThitNyiNyi/burmeseocr for full code and documentation.
Acknowledgments
Thanks to the authors of the datasets above for making Burmese language resources openly available, as well as thanks to the authors of the myOCR paper - Thura Aung, Ye Kyaw Thu, and Myat Noe Oo whose paper and dataset provided the foundation this work builds on.


