Back to AI case studies

Classifying 300,000 invoices at 98% accuracy

Training a Random Forest on 300,000 invoices to classify five categories at 98% accuracy, served behind a FastAPI service in Docker.

Invoices and tax documents spread across a desk beside a calculator
Category
Machine Learning
Published
February 11, 2026
Client
Mixed-vendor invoice routing
  • Scikit-learn
  • FastAPI
  • Docker

This is a classic machine learning engineer use case: reduce a repetitive business queue by combining robust preprocessing, model quality, and clean API delivery.

What I built

A classification model that sorts incoming invoices into five categories automatically. It was trained on 300,000 invoices spanning many different vendor formats, and it reaches 98% accuracy on that mix.

How it works

The model is a Random Forest trained with Scikit-learn. The real work was upstream of the algorithm: cleaning and featurising invoices that arrive in wildly inconsistent layouts so the classifier sees a stable signal rather than formatting noise. Once trained, it’s served behind a FastAPI endpoint and packaged with Docker, so it drops into an existing system as a simple service call.

Why it matters

Invoice triage is exactly the kind of repetitive judgement work that eats people’s time without using their skill. Turning it into an instant, 98%- accurate routing step means the manual sorting queue essentially disappears, and the few genuinely ambiguous cases are the only ones a human needs to look at.

If your team is still triaging invoices manually, start with AI engineering services, review adjacent AI case studies, or contact me for a scoped rollout.

Related reading: Catching fraud across 6.3 million transactions and Shipping ML behind a FastAPI service that stays up.

Next article Automating document workflows for law firms

Building something similar?

If you have a workflow that's slow, manual, or hard to scale, I can tell you what AI can realistically do about it.