How to Raise Nanonets Accuracy on Messy Vendor Invoices

November 10, 2026

The first month with any extraction tool looks great. Then Q2 arrives, three new vendors send scanned invoices from 2011-era software, and accuracy falls off a cliff.

This guide is about the recovery path in Nanonets: what to change when field accuracy drops, which fixes cost nothing, and which require retraining. It assumes you already have a working invoice model and a review queue.

Why does accuracy drop when it worked before?

Rarely the model’s fault. In order of frequency: scan quality dropped, a new vendor layout appeared, a field definition shifted (someone started sending a PO number in the “reference” field), or the document class changed — a credit note being processed as an invoice.

Check the failing documents by vendor first. If failures cluster on two vendors, it is a layout problem. If they scatter across all vendors, it is a quality or threshold problem.

Fix 1: Preprocess the images before extraction

This is the cheapest fix and the most skipped. Photographed invoices and old scans improve markedly with three steps:

  • Deskew — rotate to straight. Many scanner APIs and most image tools expose this.
  • Increase DPI — 300 DPI is the sweet spot. Below 200, small characters merge.
  • Convert to grayscale and boost contrast — removes colored backgrounds that confuse text detection.

A 150 DPI skewed phone photo and the same image deskewed at 300 DPI grayscale are, functionally, different documents for a model. Teams routinely get 10-15 accuracy points from preprocessing alone.

Fix 2: Define fields at the level the model needs

“Total” is ambiguous. There is a subtotal, a tax total, a currency total, and sometimes a running total per page. Vague fields produce inconsistent outputs that look like model error.

Define each field with an example and a rule:

  • total_gross — the final amount payable including tax. Example: 1,847.50. Not the subtotal.
  • invoice_number — vendor’s document ID. Excludes PO numbers and customer IDs.
  • due_date — date payment is due, not issue date. If missing, derive from payment terms and mark as derived.

Field-level clarity fixes a surprising share of “accuracy” problems because the model was answering a different question than you meant.

Fix 3: Set thresholds per field, not globally

One confidence threshold for all fields is a blunt instrument. Some fields are cheap to get wrong and some are not.

  • total_gross — high threshold. A wrong total posts wrong money.
  • invoice_number — high threshold, because of duplicate detection.
  • vendor_address — low threshold. Nobody reconciles from it.
  • line_items — medium, and accept partial extraction where the table is unclear.

Per-field thresholds let you auto-post 70% of invoices while routing the risky ones to a human. That is the only configuration where automation and control coexist.

Fix 4: Retrain with corrections, not with volume

The review queue teaches the model, but only if corrections are diverse. Two hundred corrections on the same vendor layout teach it one layout.

A working cadence: weekly, take the corrections from the past seven days, sample 20 that cover different vendors, and confirm they are labeled correctly before adding them to training. Six weeks of that with diverse samples beats six months of bulk uploading.

How do you know it improved?

Measure straight-through processing rate, not raw accuracy. STP is the share of documents that reach the ERP with no human touch. Raw accuracy can improve while STP stays flat if the improved fields were not the blocking ones.

Track two numbers monthly: STP rate and exception rate by vendor. When a vendor’s exception rate stays near zero for a month, you have a stable layout. When it jumps, a template changed and nobody told finance.

What still cannot be fixed

Handwriting. Cursive amounts on a scanned invoice are a coin flip, and no preprocessing resolves it. Route handwritten documents to a human queue from the start rather than trying to solve it with model tuning.

Multi-page invoices where line items continue across pages are the second hard case. Page-level extraction loses the continuation; whole-document extraction sometimes merges unrelated tables. Test both and pick whichever fails less on your actual vendors.

Quick Summary

  • When accuracy drops, diagnose by vendor first — clustering failures mean layout problems, scattered failures mean quality or thresholds.
  • Deskew, upscale to 300 DPI, and grayscale with contrast boost routinely add 10-15 accuracy points.
  • Define each field with an example and an exclusion rule; ambiguous field names cause most “model errors”.
  • Set high confidence thresholds for total and invoice number, low for address, and measure straight-through processing rate rather than raw accuracy.
  • Handwritten amounts and multi-page line-item continuations should route to humans, not be tuned.