Why OCR breaks on real scans, photos, and PDFs
Demonstrating OCR on a flat scan and working on a live document stream are two different tasks.
As soon as the stream includes smartphone photos, third- and fourth-generation copies, and scans with flat lighting, text recognition accuracy on images drops: lines are read, but the field composition and digits drift apart.
The reason is not the model as such, but the fact that no one checked scan quality before inference.
The first group of failures is geometry and light. A tilt of a few degrees and perspective from angled capture break a line into fragments, while hand shadows and lamp glare make illumination uneven across the frame.
A binarization threshold selected for the whole image eats thin strokes in the darkened half and leaves noise in the bright half.
Image preprocessing is mandatory here: perspective alignment by sheet boundaries, shadow suppression, local background estimation, and adaptive binarization with serif preservation.
The second group is contrast and carrier degradation. Faded text, show-through from the reverse side, a gray background, and small footnote font create only a few brightness gradations between ink and paper.
A model trained on high-contrast samples begins to confuse similar characters and lose punctuation, and with digits this costs the most.
The third group is mixed content in the document.
Composite tables with merged cells, headers and repeated footers, stamps and signatures, handwritten notes over printed text, and two languages in one field create ambiguous markup: where the zone ends and which attribute the value belongs to. Simply reading characters without block detection and field logic does not help here.
Hence the rule: first assess the real corpus, then build the chain — preprocessing, zone detection, recognition, validation by format and checksums. Let's break down how this is covered.
Implementation effect: autofill share, speed, failure class
Before starting, we capture baseline OCR metrics on the customer's real archive: the share of documents that pass without an operator, the processing time for a batch, and extraction quality for each field separately.
A baseline is needed so that "it got better" can be verified rather than felt: a disputed field such as a contract number or date drags the overall result down unnoticed.
The share of automatic parsing on same-type forms grows from 55–65% to 85–93%. The remaining tail is not a "bad system" but documents where the source itself is unreadable: a skewed scan, a stain, a handwritten correction. We send them to an operator by confidence threshold, not the whole batch.
Document processing speed changes nonlinearly: a batch of several hundred pages moves from "hours of shift work" to minutes of machine time. The bottleneck shifts to exception handling, and the operator stops being a mandatory link in the main branch of the process.
The failure class changes qualitatively. Manual input errors go away: digit transposition, a missing table row, a row mismatch with the checksum.
What remains are errors tying a field to the document type or an outdated reference — these are caught by reconciliation rules, not by the operator's eyes.
We calculate field extraction quality separately for each field: one gives 99%, another sags because of free format.
We build a hybrid scheme — Tesseract on clean printed forms, a fine-tuned model on complex scans — so the autofill percentage is predictable, and the exception list shrinks as corrections accumulate.
OCR service operation modes: batch, streaming, hybrid
The operation mode is chosen not by recognition quality but by the stream profile: where documents come from, whether latency is acceptable, and what to do with uncertainly recognized fields.
In a demo, all options look the same — on real volume, the difference is visible in queue length, the share of manual corrections, and whether a run can be restarted without losing already completed results.
Mode comparison
| Mode | When it fits | Limitations |
|---|---|---|
| Batch (archive) | Exports for a period, retrospective digitization, nightly runs over accumulated data | The result is delivered as a whole: an individual document from the middle of the queue cannot be pulled out, and correcting an error affects the entire run |
| Streaming | Continuous incoming stream — scanners on stream, mailboxes, network folders | Queue control and retries are needed; at peaks latency grows, and some documents wait for processing |
| On demand | Single documents from an interface or external system when a response is needed immediately | More expensive per document, handles bursts poorly, and does not accumulate context across same-type forms |
| Hybrid with verification | Mixed stream and fields where the cost of error is high | More difficult to configure confidence thresholds and routes: some fields go to an operator |
The limitations of the modes are not mutually exclusive: batch and stream often live in the same OCR service, while on-demand recognition covers one-off documents from external systems.
Most often we settle on hybrid mode: automation processes the entire stream, and only low-confidence fields and documents that fail validation against reference data and checksums go to manual review.
The share of such fields is single-digit percent, and that is exactly what we use to calculate operator load, not the average quality on a test set.
Implementation stages: from document corpus audit to regulations
We start not with the model but with the corpus: the variety of formats, scan quality, handwritten notes, and stamps over text determine which steps will be needed. We assemble the document processing scheme before setting up recognition, not after.
- Document corpus audit. We break down a sample by form types, scan quality, and languages, calculate shares — and get a list of classes the system must handle.
- Document processing scheme. We fix the file path: intake, page parsing, preprocessing (alignment, background bleaching, noise suppression), recognition, field extraction, writing to the target system, and an operation log.
- Reference sample. We manually annotate and freeze part of the pages — on it we measure quality and compare versions without tuning the result to the current stream.
- Field extraction setup. We build zone templates, dictionaries, and checksum validations: a field is considered extracted only when several independent features agree.
- Quality check. We calculate accuracy by characters and by fields separately, and break errors down by class: scan quality, non-standard layout, handwritten input.
- Recognition acceptance. A run on the held-out part of the corpus against criteria fixed in advance; below the threshold, the document automatically goes to an operator for verification.
- Regulation handover. We provide the flow scheme, configurations, error class descriptions, and operator instructions — retraining and failure handling proceed without us.
This order keeps risk under control: a problematic document class is visible at the check stage, not after launch into production.
Configurations, flow diagrams, and regulations: project artifacts
After handover, the customer is left not with a "model in the cloud" but with a working set of artifacts that the on-call support team can use without us.
Everything is stored in the customer's repository with change history, so any decision can be rolled back rather than restored from correspondence.
- Recognition configuration. Separate profiles for each document type: required fields, confidence threshold for auto-acceptance, post-processing rules — date and number formats, cross-checking of amounts. Alongside is a set of reference pages on which the configuration is run after any change.
- Document flow diagram. From the entry point (scanner, email, exchange folder) through preprocessing and recognition to upload into the accounting system. The diagram marks retry queues and what happens to a document that fails validation.
- Data access policies. Role separation: who sees the source image, who sees only extracted fields. Retention periods for originals, anonymization rules, and a log of access to personal data.
- Operator instructions. How the manual review queue works, how a field is corrected, which discrepancies are considered critical, and in which case a document goes for a second round.
- Regulations for resolving disputed fields. Criteria for "accepted automatically / requires review," the time standard for manual review, to whom a conflict is addressed, and how an operator correction returns to the training sample.
- Operational documentation and monitoring. Deployment of environments, backup, the procedure for updating templates with rollback to the previous version; metrics — the share of documents processed without a human, accuracy for each type, and a spike in failures on a specific template.
Case: OCR system reduced manual input sixfold
Before: manual review held the flow
The input was an incoming document stream of about 4,000 pages per day: applications, acts, payment details. The forms were same-type, but scan quality varied — repeated copies, skewed phone photos.
Recognition ran on a standard Tesseract setup: the engine returned text, and the operator made the decision on it.
The manual input share reached 62%, a batch of 500 pages took three shifts to process, and every fifth document was considered disputed and reviewed in full — although the error was in one field out of ten.
What was changed and what resulted
The task was split into two steps: zone detection, then recognition inside the zone and field extraction.
We prepared annotations on the customer's past documents, added preprocessing — alignment, noise suppression, binarization — and validation rules: checksums, cross-field verification, confidence threshold.
Below the threshold, the document goes to an operator not in full, but with the disputed fragment highlighted.
Manual input share — from 62% to 10%. A batch of 500 pages — from three shifts to 50 minutes. Disputed documents — from 20% to 4%, and in them one field is corrected rather than the form being retyped.
Each recognized field is written to the log together with the model version and decision features: an error shows at which step it occurred, and rollback to the previous version takes minutes.
How OCR of printed text differs from handwriting recognition
Printed text recognition relies on repeating glyphs: the font in the document is fixed, the styles match, so the training sample is collected synthetically, and disputed cases are resolved by a domain dictionary.
Errors here are predictable — confusion of similar characters, gaps during weak scanning — and are closed by validation against the field template: document series, date, amount.
Even lighting and stable line height are enough so that the result does not have to be corrected manually.
Handwritten text does not work that way. The style changes within a single handwriting: slant, connectedness, and pressure depend on the writer, the tool, and how quickly the form was filled in.
No universal sample exists, so handwriting recognition begins with annotating training data on samples of your documents specifically — without it, the model confidently outputs incorrect characters on unfamiliar handwriting.
Requirements for the capture differ even more. For printed text, even illumination and contrast separating text from the background are enough.
In handwriting, what is lost is not lines but the bridges inside letters: glare, a hand shadow, or angled capture turn "sh" into "i", and context does not always restore it.
Hence strict requirements for the sheet plane and lighting at the capture stage, not the processing stage.
Therefore, in both cases — but with different frequency — confirmation of uncertain fields works. The system returns not only the value but also a confidence score, and everything below the threshold goes to an operator for verification.
These same disputed fragments become material for annotating the next version, and the share of manual confirmations gradually declines. Operator load should be planned by your document type, not by someone else's experience with other forms.
Technical doubts: accuracy, data perimeter, volumes
Engineering doubts usually come down to four things: what will happen on dirty scans, whether the system can be kept inside the perimeter, whether it will withstand volume growth, and what to do when the document form changes. We address each point specifically.
What will happen on bad scans — skew, noise, handwritten notes?
The pipeline runs in several passes: alignment and binarization, zone detection, recognition with confidence scoring for each field. Fields below the threshold go to the manual review queue, not to output.
Can the system be deployed inside our perimeter?
Yes — in the customer's closed perimeter, without calls to external services. Images and results do not leave the perimeter, access is separated by roles, and every processing operation is logged. This meets personal data protection requirements and simplifies internal audit.
Will the solution withstand volume growth?
Scaling is horizontal: workers are added to the queue, and the logic is not rewritten. A flow of hundreds of thousands of pages per day goes through the same pipeline, time per document remains stable, and peaks are handled by a priority queue.
What should be done if the document form changes?
The template is described declaratively: field composition, coordinates, validation rules. When the form changes, the configuration is edited, not the recognition code — the new template is picked up on the fly, and archived documents are processed with the previous markup.
Let's discuss the task: what is needed to start recognition
Recognition assessment relies on your documents, not demo scans. We look at real forms — with skew, glare, and stamps over text — and say what share of fields is recognized confidently, where manual review is needed, and how this will affect the flow. Therefore, for the conversation it is worth preparing:
- Document samples — 15–20 scans from different sources: scanner, phone photo, fax, old copies.
- Expected flow — how many pages per day on average and how many during peak hours.
- Perimeter requirements — where data should be stored: your server, a closed network, or an external service.
- Data export format — a tabular file, exchange with an accounting system, which fields are required, and where they go next.
- User roles — who uploads documents, who checks disputed fields, who sees error reports.
- Resolution rules — what counts as a recognition error, which fields are critical, and what to do with unreadable pages.
Based on these inputs, we return with an assessment and work plan: stages, timelines, what we do at each step, and at which stage you will see the first result on your documents. Describe the recognition task — this set is enough to make the conversation specific.







