Offline Receipt OCR Engine for Android
OCR • TensorFlow Lite • On-Device AI • Receipt Parsing
OCR • TensorFlow Lite • On-Device AI • Receipt Parsing
This project delivers a fully offline OCR engine designed specifically for receipt processing on Android devices. The entire pipeline runs locally, without cloud APIs or external services and is built to operate efficiently on mobile hardware. The system includes a custom preprocessing framework, a lightweight OCR model optimized for receipts, and a TensorFlow Lite conversion ready for integration into an Android testing environment.
The client needed a receipt reading system that worked entirely offline, without sending any data to external servers or using cloud OCR such as Azure Document Intelligence. Their existing solution depended on third party APIs and could not run on device. The goal was to build a local OCR engine capable of handling real receipts, extracted from their database, while remaining fast enough to operate on mobile hardware and compatible with their future Android/React Native app.
I designed a three-stage machine learning pipeline focused on offline performance. The process began with preparing and cleaning thousands of receipt images and TXT outputs exported from the client’s database. These were used to train and fine-tune OCR architectures suited for lightweight mobile deployment, including Donut for OCR and RoBERTa for classification tasks.
During the second phase, I built an application capable of running both OCR and LLM based extraction using compact models such as Qwen-2-0.5B, which proved fast and accurate enough for device level inference. In the final phase, the complete system was converted to TensorFlow Lite so it could run locally on Android, without any cloud communication.
All receipt images and Azure TXT outputs were cleaned, split and prepared for model training. Each receipt line was cropped and normalized, and the dataset was reorganized to support OCR fine-tuning and LLM-based extraction. This stage produced the full training-ready corpus.
Multiple OCR models were tested, including Donut for text extraction and RoBERTa for classification. The best-performing combination was trained on the client's data, and an application capable of running OCR and LLM extraction was delivered along with source code, model weights and explanations of the training steps performed.
The models and inference logic were converted into a TensorFlow Lite format suitable for mobile deployment. The output was a complete, test-ready code package aligned with Android constraints, ready to be integrated into the client’s app and evaluated on real devices.
The offline pipeline was successfully built, tested and delivered. The OCR engine ran locally, with no cloud dependencies and no external API calls. The client was able to execute the models, inspect the codebase and test multiple receipt samples. Accuracy achivied, more then 95%. Additional versions were provided for easier execution, including improvements to path handling and performance.
OCR + NLP system reached over 95% accuracy on real receipts.
Processes 1 000+ receipts in seconds, fully offline.
Eliminated cloud OCR — the entire pipeline runs locally.
Accuracy improved using new receipt data and Azure TXT exports.
Delivered a ready-to-deploy TensorFlow Lite model for Android integration.