Case study · Document AI

Teaching AI to check the paperwork that gets freight paid.

Every delivery ends with a proof-of-delivery document, and invoicing waits until someone verifies it. I led end-to-end development of AI validation for those documents and defined how the document-processing pipeline is measured.

The questionHow do you measure document AI quality before you have labels, and keep measuring after launch?

BeforeEvery delivery document was checked by hand before invoicing, and only about 5% arrived linked to their shipment.
AfterMore than half of incoming volume is auto-processed at over 90% accuracy, attribution rose from about 5% to 88%, and invoicing moves faster, which supports a 48-hour delivery-document service commitment.

The problem

Proof-of-delivery documents arrive as photos, scans, and PDFs from drivers and warehouses. Before automation, people matched each document to its shipment and checked it by hand, and invoices waited on that review.

Attribution was the first blocker: very few documents arrived reliably linked to their shipment.

From business problem to technical problem

The first job is translation. Here is how the ask changed shape before any code was written.

  1. Business askInvoices wait on someone checking delivery paperwork. Can we get paid faster without paying for mistakes?
  2. Technical questionClassify, attribute, and validate each document, and know which results are safe to approve automatically.
  3. What success looks likeAccuracy on automatically processed documents, measured by randomized audits, with uncertain cases routed to people.

Paths I weighed

There was more than one reasonable way to do this. These are the options I compared and why I picked one.

Considered

Keep full manual review

Upside. Maximum control.

Cost. Slow, costly, and grows with volume.

Considered

Automate everything

Upside. Fastest.

Cost. Errors flow straight into invoices, with no way to tell which ones.

Chosen

Automate by confidence, audit continuously

Upside. Captures most of the volume safely and keeps quality measured.

Cost. Needs calibration and an ongoing audit habit.

What I built

  1. ClassifyIdentify the document type on arrival
  2. AttributeLink each document to its shipment
  3. ValidateAI checks of the fields invoicing depends on
  4. RouteConfident results auto-process; the rest go to review
  5. AuditWeekly randomized audits feed back into quality

I led the validation system end to end and defined the evaluation methodology and metrics for the wider document-processing pipeline. I also led its migration to a more scalable, lower-cost workflow.

Every document is classified, attributed to its shipment, and validated, then a confidence threshold sends it to automatic processing or to people. Stage logs in the warehouse feed label-free clustering and a weekly randomized audit, which tunes the thresholds and rules.
The top path runs on every document; the bottom path keeps quality measured after launch.

How it got built, scaled, and fixed

  1. Build

    Before any labels existed, unsupervised clustering surfaced the main failure modes.

  2. Scale

    Weekly randomized audits with inter-annotator agreement kept accuracy measured as volume and document mix grew.

  3. Fix

    When cost and throughput became the constraint, I led the migration to a more scalable, lower-cost workflow.

Decisions that mattered

Measure quality without labels

Unsupervised clustering gave a label-free view of quality, surfacing failure modes before any annotation budget was spent.

Audit continuously

Weekly randomized audits with inter-annotator agreement keep accuracy measured rather than assumed as document mix changes.

Automate what is confident

Confidence thresholds send uncertain documents to people. I also designed the confidence-threshold policy engineering adopted for automated invoice matching.

What transfers

Start measuring before you can label. Unsupervised structure gives an early, honest view of quality, and small randomized audits keep it honest once the system is live. Automate the confident cases and send the rest to people.

Methods

Vision-language modelsDocument classificationUnsupervised clusteringInter-annotator agreementConfidence thresholds

Collaborative work with product and engineering partners; this page describes my contribution. Diagrams are simplified.