OCR & KYC pipeline
Reading Lao identity documents for a bank's digital KYC
An OCR microservice that turns a photo of a Lao passport, national ID card or family book into structured customer data. It runs on APB Bank's own servers, inside the bank's digital onboarding flow.
The product
When a customer opens an account, the bank's onboarding portal sends a photo of their identity document to the service and gets clean JSON back within seconds: name in Lao and English, document number, dates, address and more. It reads passports, national ID cards in both their older and newer designs, and family books, returning each household member separately. Every request is logged, searchable and included in emailed processing reports.
The problem it solves
APB Bank in Laos was moving KYC to digital. Its onboarding portal, built by GRG Banking and integrated by Techzone Solution, could capture document images but couldn't turn them into data. Lao documents are hard for off-the-shelf OCR: Lao script, layouts that change by document and year of issue, several people on one family-book page, and phone photos taken at an angle. And customer identity data couldn't leave the bank.
My role
I built the whole pipeline at Credentech, end to end: the OCR, the extractors, the client API, the database, the GPU-to-CPU failover and the deployment on APB's servers. I worked with Techzone and GRG on the integration, and I support it in production.
Architecture and decisions
A microservice behind the bank's portal. Nginx sits in front of a FastAPI service on the bank's own servers, with PostgreSQL on a separate database server. The bank's systems see one authenticated API.
GPU first, CPU as the safety net. The primary node runs OCR on an NVIDIA L4 GPU. If GPU inference fails, requests move to a CPU-only secondary node automatically. It's slower, but onboarding never stops.
OCR plus purpose-built extractors. Surya OCR reads the text, then an extractor for each layout maps it onto named fields the bank can write straight into a customer record.
Auth for a licensed B2B service. Client credentials, short-lived JWTs, argon2-hashed secrets and a per-client licence expiry that switches access off automatically.
Engineering challenges
Lao script through an OCR engine. Labels come back garbled, so the extractors match them fuzzily, and Lao misread as look-alike Thai characters is mapped back. Dates are placed by their nearby labels first and by their order second.
Photos that aren't upright. Each image is tried at 0°, 90° and 270°, and the reading that fills the most fields wins. It stops early once enough fields are found, so a good photo costs one pass.
A licence expiry that looked like an outage. The bank reported that OCR had stopped. I checked every layer and each one was healthy: APB's licence had expired, turning every sign-in into a 401. After the renewal I wrote a runbook with a troubleshooting decision tree, so the next issue takes minutes, not a search.
Results
~95% field-extraction accuracy, measured per field on 70+ samples of each document type.
500+ KYC documents a day processed for APB Bank.
~99% uptime on the bank's own servers, with automatic GPU-to-CPU failover.
How it helps the bank
A new customer's identity documents become a filled-in record in seconds, so onboarding no longer waits on someone typing fields by hand, and fewer keying errors reach the core banking system. Lao names and addresses come through in Lao, every document leaves an audit trail the bank can search for compliance, and all of it runs inside the bank's own network.
