Document Image Preprocessing for OCR Accuracy
Fixing blurry, skewed, or damaged scans beats upgrading the OCR engine itself.

OCR turns document images into text a computer can search, index, and act on. That conversion only holds up as well as the image feeding it, and most real documents don't arrive clean. Historic archives, faxed records, a phone photo of a receipt on a car seat, handwritten intake forms: all of it comes in with blur, noise, ink bleed, low resolution, skew, and uneven lighting baked in before an OCR engine ever sees a pixel. Preprocessing is not a minor tuning knob bolted onto the front of the pipeline. It's the single biggest lever anyone building document AI has, bigger than the choice of OCR model itself, and most teams get this backwards: they spend months swapping in a better model before they've fixed the image the model has to read.
A stronger model can't undo a bad scan. But a well-prepared image gives even a modest, off-the-shelf engine a real shot at getting the text right. Printed-text OCR now runs at 98 to 99% accuracy on clean input, a number that sounds close to solved. That ceiling collapses fast once the input degrades, and the space between "clean" and "degraded" is exactly where preprocessing does its work.
How much accuracy is actually lost to poor input, and what the benchmarks show
The 2025 OCR Accuracy Benchmark from sparkco.ai puts average accuracy at 96.5% across a mix of document types, a five-point gain over 2023 attributed mostly to adaptive model selection and careful document prep work. That average hides the part that matters. Complex layouts, handwriting, and degraded scans all sit well below it, and the spread between best-case and worst-case documents is where the real story lives.
The clearest evidence comes from PreP-OCR, presented at ACL 2025 by researchers from University College Dublin, Trinity College Dublin, the University of Toronto, and Shanghai University. Working across 13,831 pages of real historical documents in English, French, and Spanish, the team found that a preprocessing pipeline cut character error rates by 63.9 to 70.3% compared to running OCR straight on the raw image. That's the difference between a usable transcription and a document someone has to re-key by hand, one character at a time.
Smaller interventions add up too. Sparkco.ai's benchmark work found that noise reduction alone, using something as simple as a Gaussian blur filter, can lift OCR accuracy by up to 15% in noisy conditions. A separate 2025 paper out of ICAIN (published by Springer, dated August 2026) tested a modular preprocessing framework against roughly 5,000 images spanning a range of noise levels and lighting conditions, and found adaptive preprocessing cut character error rate by as much as 25.9% relative to doing nothing at all.
Line those numbers up and the conclusion isn't subtle: preprocessing produces gains that match or beat what you'd get from swapping in a better OCR model. Chasing accuracy by upgrading the model first, before fixing the image feeding it, means optimizing the wrong end of the pipeline. So what's actually happening inside these preprocessing steps that accounts for numbers like that?
The core preprocessing operations and what each one actually fixes
Resolution comes first, and it's non-negotiable. Scanning at 300 DPI or higher is the industry floor, because below that threshold, fine character strokes get lost before any algorithm even runs. No amount of clever processing downstream brings back detail that was never captured in the first place. Skip this step and everything after it is patching a hole that shouldn't exist.
Grayscale conversion strips out color-channel information that adds visual noise without adding anything useful for reading text. Binarization, or thresholding, then separates the actual text from its background. Adaptive methods like CLAHE handle uneven lighting far better than a single global threshold, which tends to fail the moment part of a page sits in shadow and part doesn't.
Deskewing corrects the tilt that scanners and phone cameras introduce almost every time someone snaps a photo instead of using a flatbed. A few degrees of misalignment sounds trivial, but it's enough to break word segmentation and line detection further down the pipeline. Denoising, through Gaussian blur or median filtering, smooths out random pixel-level noise, and the choice between the two matters: median filtering tends to hold onto the edges of text strokes better, which counts for a lot when the goal is keeping character shapes sharp.
Sharpening is a separate operation from denoising, and treating the two as interchangeable is a mistake worth naming directly. Denoising removes variation; sharpening restores edge definition lost to mild blur. Run them in the wrong order and sharpening amplifies the very noise denoising was supposed to strip out. Contour-based text region detection isolates the actual text blocks so the OCR engine isn't burning capacity trying to read a stamp, a logo, or a decorative border. Rescaling, upsampling a low-resolution capture to match whatever input size the OCR model was trained on, cuts down on interpolation artifacts that otherwise creep in.
Order matters more than any single step here. The ICAIN 2025 framework lets users change the sequence of operations and see the results directly, precisely because applying sharpening before denoising amplifies noise instead of cleaning it up. Each technique on its own is fairly well understood, decades old in most cases. The harder problem, the one current research is actually chasing, is how to sequence and adapt these operations across the enormous variety of documents that show up in the real world.
Why a fixed preprocessing sequence fails on real document variety and what adaptive pipelines do instead
A pipeline tuned for clean printed invoices will over-smooth a handwritten form and under-sharpen a faded, decades-old archival page. That's the core failure of treating preprocessing as one fixed recipe applied to everything, and it's a mistake still baked into a lot of production systems. Real document collections aren't uniform. A single sequence of filters can't serve a scanned tax form and a phone photo of a warehouse manifest equally well, and building a pipeline as if it can is where most accuracy gets left on the table.
The real contribution of the ICAIN 2025 framework lies in how it combines filters, most of which are decades old, rather than in any single one of them. It's the modularity that matters: treating preprocessing as a pipeline you can reconfigure, rather than a hardcoded chain applied blindly. PreP-OCR takes a related but distinct approach on the training side. Its restoration model learns from synthetic data built by applying randomized degradations in randomized order, so the model ends up with a broad, general mapping across many kinds of damage rather than memorizing one specific pattern of noise.
There's a practical wrinkle too. PreP-OCR processes large images in patches, pulled from multiple directions and then fused back together, because a single pass across a big scanned page tends to lose coherence right at the edges or across a fold line. The 2025 sparkco.ai benchmark makes a related point from a different angle: documents that go through classification first, before any custom processing, score meaningfully better. Knowing what kind of document is on the table turns out to be a prerequisite for treating it correctly, not an afterthought bolted on later.
So preprocessing configuration is itself a decision that needs routing, either learned or rule-based, not a setting tuned once and left alone. Once images are cleaned up and normalized this way, a different category of technique takes over, one that doesn't just correct known distortions but tries to infer what the clean version of a badly damaged image probably looked like.
Learned image restoration as the next layer beyond classical filtering
Classical preprocessing applies fixed rules to known problems: this image is tilted, rotate it back; this image is dark, brighten it. Learned restoration models do something different. They infer a plausible clean version of an image degraded past the point where simple rules can fix it.
The architectures behind this have moved fast. Early convolutional neural networks gave way to residual blocks, then GANs, then attention mechanisms, then transformers capable of modeling long-range dependencies across an image, and now diffusion models like DiffIR and ResShift. Each generation added capacity to handle a wider range of degradation types at once.
PreP-OCR's first stage is an image restoration model, trained entirely on synthetic pairs of degraded and clean images, with no need for real paired historical documents, which are hard to come by at any scale. What this stage does that classical filtering can't is resolve ambiguity at the level of the character shape itself, not just noise or brightness. Making an image look cleaner and making a smudged letter actually legible as a specific glyph are two different problems, and only one gets solved by classical filtering.
Restoration isn't a complete fix on its own, though. Severely degraded documents still leave behind character-shape ambiguities that no amount of image-level correction resolves, simply because the visual information needed to tell one letter from another was never captured in the first place. That gap pushes the field toward a second stage entirely.
The two-stage pipeline structure that current research converges on
PreP-OCR, presented at ACL 2025 in Vienna, is the clearest published example of where this is heading, and any team building a serious pipeline today should look at this shape rather than bolt on a single restoration step and call it done. Stage one is the image restoration described above, a model trained on synthetic data that cleans up the image before OCR runs at all. Stage two is semantic post-correction: a ByT5 model, fine-tuned on synthetic historical text pairs, that catches errors surviving from stage one using sequence-to-sequence text correction, no image information involved at all.
The logic for splitting the work this way holds up under scrutiny. Restoration handles visual ambiguity, rooted in what the pixels actually show. Post-correction handles linguistic ambiguity, rooted in what words and grammar are likely to appear next to each other. These are genuinely different error sources, and addressing them separately lets the gains from each stage stack instead of overlap.
The results back this up: 63.9 to 70.3% reduction in character error rate across the 13,831-page test set, with the combined two-stage pipeline delivering large reductions in character error rate compared to running OCR on raw images. Preprocessing and post-processing aren't substitutes for each other. They bracket the OCR engine on both sides and, together, set the actual accuracy ceiling it can reach. That logic doesn't stay confined to historical archives, either. It applies anywhere documents show up with unpredictable damage, whether that's a mobile capture in the field, a faxed record, or a low-quality scan sitting in a finance or healthcare workflow. Which raises a fair question: how does anyone know whether any of this is actually working?
How to measure whether preprocessing is actually improving OCR output
Character Error Rate, or CER, is the standard workhorse metric: insertions plus deletions plus substitutions, divided by total character count. It's granular enough to catch single-character mistakes a word-level metric would miss entirely. Word Error Rate, or WER, works the same way but at the word level, easier to read at a glance but less sensitive when errors cluster in dense or technical text.
CER is the metric PreP-OCR reports its results in, a reasonable choice given the kind of errors historical degradation produces: character-level ambiguity, not whole-word substitution. But character accuracy alone doesn't tell the whole story once documents get structurally complex, and leaning on CER as the only measure is a habit worth breaking.
OmniDocBench, presented at CVPR 2025, adds metrics built for exactly that gap. Normalized Edit Distance measures string similarity across text, formulas, and reading order. Structure-aware metrics check whether a parsed table's layout and content actually match the source, because a table can have every character correct and still collapse into the wrong shape entirely, something CER would never catch. OmniDocBench covers 1,651 PDF pages across 10 document types, 5 layout types, and 5 languages, with 28 block-level and 4 span-level annotations, which makes it a useful reference point even outside historical-document work.
There's a catch worth naming, though. OmniDocBench's continuous metrics, edit distance and BLEU among them, tend to penalize small formatting differences that don't actually hurt readability or meaning, so the choice of evaluation method shapes what "improvement" looks like on paper. A separate concern raised in recent work (arXiv:2605.00911) cuts deeper still: raw OCR accuracy scores turn out to be poor predictors of how well a downstream retrieval-augmented generation pipeline performs. Judging preprocessing in isolation, without asking how the output actually gets used, misses the point entirely.
Where preprocessing sits in a production document pipeline and why its placement changes the latency equation
A 2026 paper on microservice architecture for document understanding, by Fehlis and colleagues, surfaces two findings that cut against intuition. First, inference-heavy steps like OCR and restoration models shape end-to-end latency in ways that downstream parsing steps do not. Second, how GPU capacity is allocated across shared inference steps can become the binding constraint, in ways that simply adding worker processes does not resolve.
The practical implication is concrete: keeping GPU-bound inference work, OCR and restoration models both, separate from CPU-bound orchestration logic. Use asynchronous processing for anything I/O-bound. Let each stage of the pipeline scale on its own, independent of the others.
Any preprocessing step running a learned model, neural denoising or diffusion-based restoration, has to be treated as an inference workload competing for the same GPU resources as the OCR engine itself, not as some lightweight transform that runs for free. Getting this wrong is a common design mistake: teams route learned restoration onto CPU workers expecting it to behave like classical filtering, and it doesn't, and the whole pipeline stalls waiting on a step that was never meant to run there. The ICAIN 2025 framework's own scaling tests confirm the split from the other direction: classical operations, grayscale conversion, CLAHE, median filtering, run fine on CPU alone. Learned restoration is where GPU actually earns its keep, and routing it there, into the same inference queue as OCR, while measuring each stage's latency contribution separately, is the right call. Throughput is only half the production problem, though. The other half is knowing when the pipeline has quietly failed.
Confidence scoring and failure detection as the production contract between preprocessing and downstream agents
An orchestrator sitting downstream of OCR receives structured text and acts on it. It never sees the source image, and it has no independent way to know the extraction was unreliable unless the pipeline hands it that signal explicitly. Preprocessing quality correlates directly with extraction confidence, but only a system that tracks per-field confidence scores makes that correlation visible, and skipping this step is how quiet failures make it all the way to production.
The failure mode worth worrying about is the silent one. A restoration model that under-corrects a blurred character doesn't fail loudly. It produces a plausible-looking but wrong character, and a downstream agent acts on that wrong value with nothing flagging the mistake. Call it the document-AI equivalent of a dropped row in a large data extraction job: nothing crashes, the output just quietly isn't what it claims to be.
The same arXiv paper cited above (2605.00911) makes a related point: high OCR accuracy scores don't reliably predict strong downstream retrieval performance, because structural and semantic errors cause real retrieval failures even while character-level accuracy looks fine on paper. Evaluation has to run end to end, not stop at the OCR boundary, and any team that stops there is measuring the wrong thing.
This matters more by the month, not less. Gartner reports a 1,445% surge in inquiries about multi-agent systems between Q1 2024 and Q2 2025, and every one of those pipelines depends on document ingestion quality somewhere upstream, at a pace that's outrunning the tooling built to catch ingestion failures. A pipeline built to actually surface these problems provides per-field confidence scores, quality flags at each preprocessing stage (DPI too low, skew past threshold, restoration confidence under a set cutoff), and automated checks against expected structure. That's what catches the failure at the pipeline boundary, instead of leaving someone to find it three systems downstream. What preprocessing needs to catch, though, isn't identical across every industry. It shifts with the kind of document coming in the door.
How preprocessing requirements differ across healthcare, finance, logistics, and real estate documents
Healthcare documents arrive in a genuinely difficult mix: handwritten prescriptions, faxed lab results, older PDF reports, exports pulled from EHR systems, each with its own distinct pattern of degradation. Fax transmission introduces a signature distortion of its own, a mix of dropout and compression artifacts that classical scanning never produces, and handwriting on top of that means the pipeline has to handle two very different degradation profiles at once, not one.
Financial documents lean toward dense, structured layouts: tables of figures, multi-column statements, forms with small print, where a single misread digit changes a number's meaning entirely rather than just garbling a word. That raises the stakes on binarization and resolution specifically. A blurred "3" read as an "8" in a dollar figure is a materially different kind of error than a blurred letter in a sentence a reader can still infer from context, and treating the two as equivalent risk is a mistake finance workflows can't afford.
Logistics documents, shipping manifests, customs forms, delivery confirmations, tend to arrive as phone captures taken quickly in the field, often at odd angles and under whatever lighting happens to be available at a loading dock or a truck cab. That pushes deskewing and adaptive thresholding for uneven lighting to the front of the pipeline, ahead of steps that matter more for a flatbed scan.
Real estate documents split between dense legal text, contracts, title records, and forms mixing typed and handwritten fields. That variety argues for the same adaptive, document-classified approach described earlier. Knowing in advance whether the input is a scanned deed from twenty years ago or a freshly typed disclosure form changes which preprocessing sequence gets the best result, and running one fixed recipe across all of it wastes exactly the gains the research keeps finding.
Sources
- PreP-OCR: A Complete Pipeline forDocument Image Restoration and Enhanced OCR Accuracy
- Modular and Interactive Preprocessing Framework for Enhanced OCR in Noisy Document Images | Springer Nature Link
- OCR Accuracy Comparison 2025: Benchmark Analysis
- 2025 OCR Accuracy Benchmark Results: A Deep Dive Analysis
- Boost Tesseract OCR Accuracy: Advanced Tips & Techniques
- arxiv.org


