Open-Source OCR Large Models: A Comparative Evaluation and Selection Guide
This guide explains how to evaluate open-source OCR large models beyond a single accuracy score. It covers defining target scenarios, building a reproducible layered evaluation set, the four capability differences between model types, execution practices for comparable results, and a layered document-parsing architecture, helping readers choose models based on scenario weights rather than leaderboards.
1. Why OCR Quality Is Hard to Summarize in One Number
In the past, evaluating an OCR solution came down to two things: text recognition accuracy and support for the required languages. Now that large models have entered document understanding, OCR output has evolved from “a set of text lines with coordinates” into “structured documents with hierarchy.” For the same PDF, different solutions may return plain text, Markdown, or nested structures with table tags. These outputs differ enormously in downstream usability, yet a single accuracy number can hardly capture the difference.
So before evaluating open-source OCR large models, you need to define the target scenario. Common scenarios fall into four categories:
- Plain text extraction: body-text extraction from contracts, official documents, and scanned books, focusing on character accuracy and paragraph order.
- Layout restoration: technical manuals, white papers, and papers, where heading hierarchy, lists, footnotes, and the positions of text and images must be preserved.
- Tables and receipts: financial reports, invoices, and forms, focusing on cell assignment, merged cells, and tables that span pages.
- Complex layouts and multimodal Q&A: multi-column layouts, handwritten annotations, formulas, text within charts, and even direct question answering based on the layout.
Weights differ completely across scenarios. Hand a two-column paper to a solution that only handles single-column receipts well, and even with every character recognized correctly, the reading order may be scrambled. Conversely, handing a simple form to a strong layout model may not be worth the latency and compute cost.
2. Building a Reproducible Evaluation Set: A Step That Matters More Than Model Selection
Most evaluation conclusions contradict each other because the evaluation sets are not reproducible. It is worth building a small but structurally complete evaluation set along the lines below.
The first layer is stratified sampling. Cross-sample across three dimensions: document type (body-text, table-heavy, receipt, and mixed text-and-image), scan quality (native digital, ordinary scan, phone photo, and low-resolution fax), and language (Chinese, English, mixed Chinese-English, and a few minor languages), with no fewer than several samples in each cell. This prevents the overall score from being inflated by one category of easy samples.
The second layer is annotation granularity. In addition to the full text, annotate reading order, heading hierarchy, and the row and column assignment of table cells. A simplified annotation structure can look like this:
{"doc_id": "sample_0421","pages": [{"page": 1,"blocks": [{"type": "title", "level": 1, "text": "..."},{"type": "paragraph", "text": "..."},{"type": "table", "rows": 4, "cols": 5, "cells": [["", "", "..."]]},{"type": "figure_caption", "text": "..."}],"reading_order": [0, 1, 2, 3]}]}
The third layer is metric definition. At the character level, use precision and recall based on normalized edit distance. At the structural level, measure heading-level accuracy, exact table-cell match rate, and reading-order accuracy separately. For tables, do not just check whether the text is recognized correctly; also check whether the row and column assignment is correct. In practice, this is the most error-prone step and the one that most affects downstream data ingestion.
3. Four Capability Divides Among Open-Source OCR Large Models
Setting specific products aside, the capability differences among current open-source solutions mainly come down to four divides.
The first is the decoding paradigm. One type of solution follows the two-stage “detection box + recognition” approach, decoupling layout analysis from text recognition. Its advantage is that modules are replaceable and single-page latency is controllable. Another type uses an end-to-end vision-to-sequence generation paradigm that maps a full-page image directly to structured text. Its advantage is strong joint modeling of layout and reading order; its drawback is sensitivity to the splitting strategy for high-resolution long documents, and generative decoding carries the risk of “fluent-looking output that rewrites the content,” so it must be paired with confidence checks and alignment verification against the original text.
The second is the resolution and image-splitting strategy. Document tasks have far higher information density than natural scenes, and compressing images to a fixed small size directly loses small text and footnotes. A common approach is dynamic resolution combined with block-based splitting and stitching, but poorly handled split boundaries can cut off tables and paragraphs. Evaluation should specifically include samples that cross split boundaries.
The third is structured output capability. Whether a model can stably output hierarchical markup and correctly express merged cells and continued tables across pages determines whether results can go directly into a knowledge base or database. Watch out for cases where “the format looks correct but the hierarchy is scrambled.” It is better to run a schema validation script on the output than to rely on visual spot checks.
The fourth is long-document handling and batch throughput. Processing hundred-page documents involves page scheduling, concurrency control, and GPU memory usage; strong single-page metrics do not mean a whole document is usable. In engineering terms, focus on average latency per page, peak GPU memory, and failure retry rate, rather than peak throughput alone.
4. Running the Evaluation: Turning Subjective Impressions into Comparable Data
Fix the inference parameters, the hardware environment, and the preprocessing pipeline, then compare item by item. Preprocessing is especially critical: denoising, deskewing, seal-occlusion removal, and binarization thresholds can all significantly change results. If preprocessing is inconsistent across solutions, the conclusions are not comparable.
A simplified batch evaluation flow can be written as:
def evaluate(pipeline, samples):report = {"char_acc": [], "table_cell_exact": [], "order_acc": []}for s in samples:result = pipeline.run(s["image_path"])report["char_acc"].append(char_accuracy(result.text, s["gt_text"]))report["table_cell_exact"].append(cell_exact_match(result.tables, s["gt_tables"]))report["order_acc"].append(reading_order_accuracy(result.blocks, s["gt_order"]))return {k: sum(v) / len(v) for k, v in report.items()}
Beyond accuracy, be sure to record three engineering metrics: the type distribution of failed samples (blank pages, oversized images, or encrypted documents), manual review time, and the rework rate after output reaches downstream systems. In practice, manual review time often reflects the real cost better than accuracy does.
5. Architecture Recommendations: Do Not Expect One Model to Solve Everything
A robust document-parsing pipeline is usually layered: first perform page classification and layout analysis to determine whether a page is body text, a table, or a receipt; then route it to different recognition strategies by type; then assemble the structure and run post-processing validation; and finally write the results into a retrieval or business system. For fields that demand extremely high character-level accuracy (amounts, ID numbers, order numbers), you can add rule-based checks and a second review rather than fully trusting the generated output.
For large-scale deployment, general cloud capabilities can take on surrounding responsibilities: object storage holds the original and parsed artifacts, a message queue handles peak shaving and task distribution, a container platform hosts elastic inference services, and logging and monitoring with alerting track failure rates and latency fluctuations. In document-parsing scenarios like this, Baidu AI Cloud provides general infrastructure and platform capabilities, but the specific selection should still be validated against your own evaluation set.
6. Conclusion: Use Scenario Weights Instead of Leaderboards
There is no universal best open-source OCR large model. The right approach is to break the scenario down in detail, build a reproducible layered evaluation set, score on four dimensions—character accuracy, structural restoration, reading order, and engineering metrics—and then reach a selection conclusion based on weights. For long documents with complex layouts that need to be ingested and retrieved, prioritize end-to-end structured capability and add a validation step. For receipt and form fields that are fixed, a two-stage approach combined with rule-based checks is usually more stable and more economical. Once the evaluation process is fixed in place, you only need to rerun it when models iterate, and the conclusion will naturally be clear.
