AI Invoice Data Extraction: LayoutLMv3 and Donut

Invoices arrive in different formats, and manual reconciliation consumes team time every time. We develop turnkey invoice data extraction: we configure form parsing and send the result directly to your accounting system. The result is an incoming document flow without manual reconciliation, and the time to process one invoice is reduced severalfold.
Frequently Asked Questions

Why invoice data extraction breaks at scale

Invoice flow breaks not on a single document but on volume and variety. While there are a dozen suppliers and forms are stable, invoice data extraction looks like a solved task: an operator enters the details in a couple of minutes, and errors are caught by eye.

With thousands of documents per month, manual entry stops scaling, and the backlog of unprocessed documents grows faster than it is cleared.

The classic approach is coordinate-based rules, like "invoice number top right, TIN in the details block." It falls apart on the very first angled scan, on a shifted header, on a new supplier form where the logo overlaps a line.

Each variation requires a new set of rules, and an unnoticed one silently produces an incorrect result—with no error in the log.

Models that consider not only text but also field position on the page remove some of this fragility: field extraction relies on context—what stands next to the target value. A few dozen labeled invoices are enough to handle new forms.

But a model has a confidence threshold below which a document must go to a human, not into accounting.

The cost of an error is discrepancies in accounting, not minutes spent. A half-parsed invoice is paid twice or does not make it into the register, and the discrepancy surfaces during reconciliation, when fixing it is already more expensive. The backlog of unprocessed documents is then closed manually at period end.

We break down how this is solved: with a pipeline where the model extracts fields, checks reconcile them against each other, and the human receives only low-confidence documents.

Implementation effect: processing speed and error rate

After launch, invoice data extraction no longer hit a manual entry bottleneck: documents arrive in batches, recognition runs in parallel, and the operator gets involved only where the model did not reach confidence on key fields.

Throughput grew from dozens to several hundred invoices per day per employee, and the time from file receipt to accounting entry dropped from hours to minutes. Peak month-end close no longer requires temporary team reinforcement.

The main metric here is the share of invoices processed without manual touch. For suppliers with stable layout, it stays around 85-90%; for new counterparties, the first documents are processed manually until the system picks up the template.

Low-confidence documents are not "guessed": they go to the verification queue with the disputed field highlighted—an error in the amount costs more than an extra operator click.

The error rate falls not so much in numbers as in class. Data entry related to the human factor goes away: digit transposition in a number, confusion between invoice date and delivery date, a lost row in a multi-page table.

What remains are substantive discrepancies—the invoice does not reconcile with the contract or acceptance certificate—and it is precisely for them that accounting time is freed up.

Labor costs are redistributed, not eliminated: the operator stops being a data entry operator and becomes an exception controller—one out of ten documents goes to review instead of every one.

Such a gap is achieved by fine-tuning LayoutLMv3 on the customer's invoice archive: the model is tuned to its suppliers and forms, not to an abstract set of documents.

Form parsing approaches: templates, rules, and models

The same invoice arrives in three forms: a clean electronic document from a large supplier, an angled phone scan, and a faded copy from the counterparty's accounting department.

The parsing mode is chosen not by a "general recommendation" but by the composition of the flow: where the form is stable, coordinate field binding is enough; where the form drifts, a model robust to shift, noise, and cropped edges is needed.

Option When it fits Limitations
Template parsing One or two counterparties, the form does not change for months, the flow is uniform Editing the form breaks the binding and requires rebuilding the template; on poor scans, fields remain empty
Extraction rules Typical fields: TIN, document number and date, VAT amounts, line total Fragility on non-standard wording and different letter cases, diverges when the form language changes
Trained model Mixed flow, dozens of suppliers, non-standard forms, phone scans Requires sample labeling for your flow and quality control when new document types appear

In practice, the flow is almost always hybrid: rules cover anchor fields, the model covers the tabular part and free-form wording, and discrepancies go to manual review.

The selection criterion is not "which method is stronger" but the share of fields extracted without correction on your scans: on clean electronic documents, template and model are on par; on poor scans, the former falls behind by a factor. That is why we measure quality before choosing the mode—on your sample, not a demo one.

Implementation stages: from archive audit to handover

Implementation starts not with the model but with an archive audit: until it is clear what the flow consists of, any configuration is guesswork. Below is the workflow, where each stage relies on the artifact of the previous one.

  1. Archive audit. We export several hundred invoices for a period, label form types, and count the share of scans without a text layer, rotations, and handwritten corrections. The output is a map of document types and an honest estimate of the share that extraction will cover without an operator.
  2. Document flow scheme. We describe where the file comes from, where the original is stored, where the result goes, and what happens to a field if model confidence is below the threshold. We agree on the scheme before configuration.
  3. Extraction setup. We train a labeling model on the customer's forms and isolate fields: number, date, counterparty, amounts, tax, line items. Some fields are covered by rules and reconciliation against reference data—this is more stable than trusting everything to the model.
  4. Testing on a holdout sample. We run it on invoices the model has not seen and calculate accuracy for each field separately. Weak spots—line items, handwritten details—are reviewed manually so that an average figure does not hide them.
  5. Acceptance criteria. We fix them before the final run: field accuracy, share of invoices for manual review, package processing time, export format. If they do not match, we fine-tune rather than accept as is.
  6. Handover to operation. We deploy in the customer's environment or a private cloud, enable logging and alerts for accuracy drops, train operators, and provide documentation. A month later, we compare actual metrics with acceptance metrics and fine-tune on new forms.

What the customer receives: configurations and regulations

We hand over artifacts not as an appendix to a report but as a working kit: the customer's team must be able to change parameters, connect a new document type, and troubleshoot failures without our help.

Therefore, the handover includes not only the service but also the configuration, schemes, and rules by which it operates.

  • Solution configuration — field labeling parameters, confidence thresholds, and field validation rules; stored in a repository, changing a setting does not require rebuilding the model.
  • Integration scheme — the document path from email or scan to the accounting system, failure points, exchange formats, and rules for resending without duplicates.
  • Access policies — operator, analyst, and administrator roles, retention periods for source files and recognition results, action log.
  • Documentation — description of invoice fields and matching rules, instructions for connecting a new document type, breakdown of typical errors.
  • Test corpus — a selection of invoices with reference values and per-field metrics: after a change, you can immediately see where accuracy dropped.
  • Operator instructions — how to process the queue of questionable documents and where to look when amounts diverge.
  • Support regulations — what the customer's team handles itself, what is escalated, response times, and the procedure for rolling back to the previous configuration version.

The solution stops depending on one person: changes are made according to instructions, and quality is checked on the same corpus as during implementation.

Case study: incoming document flow without manual reconciliation

The customer is a wholesale supplier with three legal entities and a flow of about 4,000 incoming invoices and acceptance certificates per month. Accounting processed them manually: six operators transferred details and amounts into the accounting system.

At peak, period close stretched to 11 business days, and discrepancies were found only during reconciliation with suppliers.

The implementation case began with a pilot: one legal entity, two high-volume supplier types, a sample of 600 documents.

We labeled fields, trained the model on these examples, and added post-processing rules—reconciliation of line totals with the grand total, validation of details against the counterparty reference, refusal of auto-acceptance on any discrepancy.

We took LayoutLMv3 as the basis: it reads text together with coordinates on the page, so it confidently parses "floating" invoice layouts.

Metrics before and after

Accuracy of key field parsing grew from 88% to 98%, and the share of documents processed without human involvement—from 37% to 91%.

The remaining 9% are not lost: they go to the verification queue, where disputed fields are highlighted, and the operator corrects one or two details instead of entering the entire document.

Period close was reduced from 11 to 3 business days, and the flow grew to 6,500 documents per month without expanding staff.

After the pilot, the solution was rolled out to the remaining legal entities and new form types were added, while the model is fine-tuned on operator corrections—the auto-acceptance share continues to grow.

What to do if template-based invoice parsing is already deployed?

Template parsing does not need to be stopped to start working with models.

The hybrid scheme runs extraction in parallel on the same incoming flow: the model processes the scan, the rules calculate their own version, and both results land in one card marked with which route produced the values. Field discrepancies go to the verification queue and replenish the labeling for fine-tuning.

Parsing migration relies on the archive of already processed invoices: "scan—final values" pairs after operator corrections provide a training sample without manual labeling.

Models of the LayoutLM and Donut class take into account both text and block geometry, so usually a few thousand documents per type are enough for header fields and the tabular part to be read no worse than with rules, and on non-standard supplier forms—noticeably more accurately.

Gradual switching proceeds by document types, not the entire flow at once. First, suppliers with floating layouts are moved to the model, where the template already required constant corrections, while stable forms remain on rules.

The decision is made based on metrics: as long as the share of manual corrections for a type falls, the route remains model-based; if it grows, the type returns to the template.

Rollback of changes is built into the scheme itself: the route for each type and supplier is configuration, not code, so returning to the previous parsing takes minutes and does not require rebuilding.

The route version is saved together with the result, so any invoice can be re-parsed the old way and compared field by field.

Technical concerns: accuracy, formats, integrations

Technical concerns usually come down to four things: whether the model will work on heterogeneous supplier forms, what will happen with poor scans, how to add a new document type after launch, and who is responsible for an error in the accounting system.

We go through them in order—indicating how this is solved at the configuration level, not with promises.

The key principle is one: the model does not "see" the form; it extracts fields by the meaning and context of the document.

Therefore, quality control is built not on trust in recognition but on a confidence threshold for each field: what is below the threshold goes to the operator, what is above goes to the accounting system.

Suppliers have different invoice forms—does each one need a template?

No. Extraction follows the semantic structure of the document, so a new supplier is processed without a separate template: the fields "total," "number," "date," "tax" are found in an unfamiliar layout.

If deviations for a specific counterparty become systemic, we fine-tune on its sample—usually a few dozen confirmed documents are enough.

What about low-quality scans—skew, noise, fax?

Before recognition, preprocessing is performed: alignment, skew correction, noise reduction, and, if necessary, OCR. Documents that even after this do not pass the threshold do not block the flow: they go to the manual entry queue. We calculate the accuracy metric on your document sample, not on general examples.

A new document type appeared after launch—does everything need to be redone?

No. Sample labeling is added, fine-tuning is performed, validation on held-out documents is done, then a shadow run in parallel with the current environment. Switching happens only when the metrics of the new type are no worse than the existing ones. Rollback to the previous model version remains available.

How is integration with the accounting system arranged, and who is responsible for an error?

Exchange goes through the accounting system's API or file exchange—we agree on the format during the design stage.

Fields with low confidence do not go into the system: they remain in the operator queue together with the image fragment and the model version that made the decision. This way an error does not silently enter the postings but is handled at the input.

Let's discuss the task: what is needed to assess the flow

To come back with a work estimate, we do not need access to your environment at the start—describing the invoice flow and infrastructure constraints is enough.

Below is a list of inputs that are usually enough to calculate labor costs and assemble a stage-by-stage implementation plan.

  • Volume and rhythm of the flow: how many invoices arrive per month, what share are scans without a text layer, whether there are peaks during period close.
  • Receipt channels: electronic document exchange, email, network scanner, accounting system export—what already arrives machine-readable and what is processed manually.
  • Formats and quality: PDF with and without a text layer, images, XML; how often rotations, low contrast, and multi-page attachments with tables occur.
  • Fields and validation rules: which fields are mandatory, whether there are counterparty and item reference directories, how amounts, VAT, and line totals are currently reconciled.
  • Landing point for the result: where extracted data should be written and whether a manual confirmation step is needed before posting.
  • Infrastructure and access: whether processing can be placed in your environment or a dedicated site, what requirements exist for source storage, logging, and access separation.
  • Process owners: who from accounting, IT, and security approves parsing rules and accepts the result.

Describe the task in free form, attach 10–20 anonymized invoices of different types—this is enough for us to come back with a timeline estimate, processing scheme, and work plan with acceptance points at each stage.

AI Development Areas

Latest works

  • B2B ADVANCE company website development
    B2B ADVANCE company website development
    1542
  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1393
  • Website development for BELFINGROUP
    Website development for BELFINGROUP
    1081
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1368
  • B2B Advance company logo design
    B2B Advance company logo design
    815
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1139