Our client is a financial company processing invoices from thousands of suppliers every day. Before the solution was deployed, thirty data entry staff were manually keying invoice numbers, totals, payment dates, and supplier codes from scanned images into their ERP system.
The pipeline we built has three main stages. Stage one: image preprocessing — deskewing, noise removal, contrast enhancement, and segmentation of key invoice regions. Input image quality is the single biggest factor affecting final accuracy.
Stage two: an OCR engine extracts text from the preprocessed image. We tested four different engines and used an ensemble approach — output from the two best engines was passed to stage three for cross-validation.
Stage three: the LLM receives the raw OCR text and extracts specific fields (invoice number, date, total, VAT, supplier code) returning structured JSON. The LLM handles the enormous diversity of invoice formats that rule-based approaches cannot.
The biggest challenge was handwritten invoices and low-quality scans (faxed copies, phone photos taken in poor lighting). For this group, accuracy only reached seventy percent — below the acceptance threshold. The solution: automatic routing of low-confidence invoices to a manual review queue.
Results after three months: eighty-eight percent of invoices fully processed automatically, average processing time down from four minutes to twelve seconds, and the data entry team reduced from thirty people to five handling only exceptions.
Share