Multi-Engine OCR Evaluation: From Text Recognition to Structured Understanding

    Evaluating OCR systems requires more than checking a single accuracy score. This article breaks down OCR evaluation into six key tasks, ranging from basic text extraction to table parsing and spatial localization. It covers how to design reliable test datasets, evaluate structured outputs, choose the right technology stack, and integrate OCR results into search, knowledge bases, and automated workflows.

    In document digitization projects, OCR is often misunderstood as simply “converting images to text.” In reality, a complete document understanding system must simultaneously handle text recognition, layout analysis, table restoration, field extraction, coordinate localization, and result validation. One engine might perform well on standard printed text but fail at complex tables, cross-page documents, or word-level coordinate returns. Therefore, evaluating OCR cannot rely on a single overall score or mix all tasks into one metric.

    This article breaks down a typical OCR evaluation into six categories of tasks and combines common phenomena from real document testing to explain how to choose a technical route, design an evaluation set, and feed recognition results into search, knowledge bases, review, and automated workflows.

    1. Break Down OCR Evaluation into Distinct Tasks

    Different tasks require different system capabilities. They can be examined across at least the following six dimensions:

    1. Plain text extraction;
    2. Markdown or structured text restoration;
    3. Schema-free information extraction;
    4. Fixed Schema field extraction;
    5. Table structure parsing;
    6. Spatial localization and word-level coordinate return.

    These six categories are not a simple progressive relationship. They rely on different technical modules and have different final evaluation criteria.

    For example, plain text extraction focuses on whether characters are recognized correctly. Markdown extraction must also consider heading hierarchy, list relationships, and reading order. Table parsing requires determining rows, columns, merged cells, and cross-page relationships. Spatial localization must not only return the text content but also provide stable, accurate coordinates that can be mapped back to the original image.

    Therefore, in actual projects, rather than asking “which OCR is the best,” you should clarify:

    • Are the documents scanned copies, digital PDFs, or a mix of images and text?
    • Will the results be read by humans or directly consumed by programs?
    • Do you need to preserve the original layout?
    • Do you need precise evidence localization for each field?
    • Are errors allowed to be manually reviewed, or must the process be fully automated?
    • Is the budget more concerned with per-page cost or overall processing efficiency?

    Answering these questions first gives actual meaning to your evaluation results.

    2. Plain Text Extraction: Foundational but Not to Be Ignored

    The goal of plain text extraction is to convert unsearchable scanned documents into searchable text. Archive digitization, historical newspaper sorting, paper contract archiving, and internal data searches typically fall into this category.

    Key metrics for this task include:

    • Character Error Rate (CER);
    • Word Error Rate (WER);
    • Recognition accuracy for numbers, dates, and amounts;
    • Mixed language (e.g., Chinese and English) performance;
    • Punctuation and line break handling;
    • Batch processing throughput;
    • Cost per page or per document.

    On documents with clean backgrounds, regular fonts, and simple layouts, most mature OCR engines can achieve good results. However, real-world business documents often contain seals, low resolution, skewing, shadows, folds, handwritten annotations, and complex fonts, which can significantly widen the performance gap.

    Moreover, an overall CER does not fully represent business quality. For a standard article, a few typos might be acceptable. But for invoice numbers, ID numbers, amounts, and dates, a single character error can render the entire record unusable. Therefore, when evaluating, you should separately track the accuracy of critical fields rather than just calculating an average recognition rate.

    In engineering practice, plain text extraction often serves as the first phase. The recognized text can then feed into full-text search systems, classification models, knowledge bases, or large language models. However, if the document requires structural preservation, you cannot stop at plain text output.

    3. Markdown Extraction: From Reading Characters to Understanding Layouts

    The core of Markdown extraction is not merely outputting a specific format, but preserving the logical structure of the document as much as possible, including:

    • Headings and their hierarchy;
    • Paragraph boundaries;
    • Ordered and unordered lists;
    • Tables;
    • Distinction between headers/footers and the body text;
    • Images, annotations, and reference relationships;
    • Correct reading order for multi-column documents.

    For enterprise search, knowledge base construction, and Retrieval-Augmented Generation (RAG) systems, structural information is critical. If a set of regulations is simply concatenated into continuous text, the model may not distinguish between chapter headings, clause content, and footnotes, causing a drop in retrieval accuracy.

    Markdown evaluation cannot only look at text consistency; it must also check structural validity. For example:

    • Are second-level headings mistakenly recognized as body text?
    • Are two-column pages read from left to right, top to bottom?
    • Are tables incorrectly split into multiple text segments?
    • Are headers and footers repeatedly inserted into the body text?
    • Are cross-page paragraphs truncated?
    • Is list numbering continuous?

    General Vision-Language Models (VLMs) typically have stronger generalization capabilities in complex layout understanding, making them suitable for scenarios with diverse document types and rapidly changing templates. However, these methods may suffer from output format fluctuations, detail omissions, and unstable results. For systems with strict formatting requirements, post-processing, format validation, and manual spot-checking are usually necessary.

    4. Schema-Free Extraction: For Exploratory Processing

    Schema-free extraction means the system does not know the fixed fields in advance but automatically discovers important tags and their corresponding values based on the document content.

    For example, the system can identify the following from a business document:

    • Document title;
    • Organization name;
    • Date;
    • Amount;
    • Person in charge;
    • Key clauses;
    • Risk warnings.

    This capability is suitable for non-standardized documents, historical data sorting, and preliminary information inventories. Its advantage is flexibility, as there is no need to pre-design fields for every document type. The downside is that the output structure may be unstable, and the same type of document might yield different field names across different samples.

    Therefore, the evaluation focus for schema-free extraction includes:

    1. Whether truly important information was found;
    2. Whether critical facts were omitted;
    3. Whether field names are consistent;
    4. Whether a field was incorrectly split or merged;
    5. Whether the extraction result retains the original context;
    6. Whether uncertain information can be explicitly flagged.

    In production environments, it is recommended to position schema-free extraction as a “discovery and initial screening” capability, rather than using it as the final input for financial, legal, or regulatory workflows. For critical results, rule validation, confidence scoring, and manual review should be applied.

    5. Fixed Schema Extraction: Stability Over Flexibility

    Fixed Schema extraction is the opposite of schema-free extraction. The business side pre-defines fields, for example:

    1. {
    2. "document_number": "",
    3. "supplier": "",
    4. "issue_date": "",
    5. "total_amount": "",
    6. "payment_terms": ""
    7. }

    The system only needs to find the corresponding values from the document and return them in the agreed format. This approach is better suited for business scenarios like invoices, orders, contracts, customs declarations, bank vouchers, and forms.

    Key evaluation metrics for fixed Schema include:

    • Field-level accuracy;
    • Field recall rate;
    • Null value detection accuracy;
    • Date and amount normalization accuracy;
    • Multi-value field handling capability;
    • Ability to associate fields with original evidence;
    • Whether the output format consistently meets specifications.

    For these tasks, you should not only check whether “the model generated an answer” but also determine if the answer came from the correct location. For instance, a contract might contain multiple dates and amounts. If the system only returns one value without specifying whether it corresponds to the signing date or the effective date, the result is not business-ready.

    A more robust approach is to have each field return its value, confidence score, and evidence location simultaneously, for example:

    1. {
    2. "field": "total_amount",
    3. "value": "10000.00",
    4. "confidence": 0.96,
    5. "evidence": {
    6. "page": 1,
    7. "text": "Total Amount: 10000.00",
    8. "bbox": [120, 530, 360, 570]
    9. }
    10. }

    Note that field names and API formats should be designed according to your actual system, and you should not assume all OCR services support the exact same return structure.

    6. Table Extraction: The Task That Reveals the Biggest Gaps

    Tables may seem like simple text arrangements, but they actually contain complex two-dimensional relationships. The system must simultaneously recognize:

    • Rows and columns;
    • Cell boundaries;
    • Merged cells;
    • Empty cells;
    • Headers and data regions;
    • Multi-level headers;
    • Cross-page tables;
    • Line breaks and multi-line text within cells.

    Table evaluation should separately check content accuracy and structural accuracy. Even if every number is recognized correctly, a misaligned column renders the final data unusable.

    Common errors include:

    • Columns merging due to missing borders;
    • Multi-level headers flattened into a single row;
    • Right-side amounts assigned to the wrong column;
    • Repeated or missing headers in cross-page tables;
    • Note areas treated as regular data;
    • Multiple items within a cell incorrectly split apart.

    Advantages may vary across different document categories. For forms with clear rules and obvious gridlines, traditional pipelines combining layout analysis with geometric rules are suitable. For materials with complex layouts and highly variable templates, VLMs can be used for initial parsing, followed by a table validator for corrections.

    For critical fields like amounts, quantities, and tax rates, it is recommended to add column total validation, numeric format validation, and contextual consistency checks. For example, if there is a basic mathematical relationship between item amounts, quantities, and unit prices, these business rules can be leveraged to detect recognition errors.

    7. Spatial Localization: The Weakness of General Vision-Language Models

    Spatial localization refers to returning the position of text, lines, paragraphs, or fields within the original page. It is commonly used for:

    • Sensitive information redaction;
    • Original text highlighting;
    • Field evidence display;
    • Visual Question Answering (VQA) result tracing;
    • Document review;
    • Layout reconstruction;
    • Associating text with graphic regions.

    If a system only returns an answer without indicating where it came from on the page, users cannot easily verify the result, making auditing and error correction difficult.

    In word-level coordinate tasks, traditional OCR pipelines often have the upper hand. Their workflow typically includes image preprocessing, text detection, text recognition, and coordinate mapping, stably returning bounding boxes for words or text blocks. While general VLMs excel at understanding entire pages, they may not accurately provide precise coordinates for every word, especially with small fonts, dense tables, and complex backgrounds.

    Therefore, an actual system can adopt a hybrid architecture: using a VLM for semantic extraction, a dedicated OCR localization module for word-level coordinates, and then linking the two through text matching or layout indexing. This achieves strong semantic understanding while preserving verifiable spatial evidence.

    8. Designing a Reliable Evaluation Dataset

    If you only use a few sample documents, evaluation results are easily skewed by randomness. A more rational approach is to build a real-world dataset covering multiple document types, stratified across the following dimensions:

    • Document source: Scanned copies, digital documents, photographed copies;
    • Layout complexity: Single-column, multi-column, tables, mixed layouts;
    • Image quality: Clear, blurry, skewed, shadowed, low-resolution;
    • Language type: English, mixed languages;
    • Business category: Contracts, invoices, reports, archives, application forms;
    • Information density: Sparse text, dense text, complex tables.

    Test data should include both normal and hard samples. For each task type, define manual annotation guidelines in advance, clarifying how to handle headers/footers, blurry characters, empty fields, merged cells, and multiple valid answers.

    Evaluation results are best presented as a multidimensional matrix rather than a single total score. For example:

    Task Primary Metrics Key Issues to Watch
    Plain Text CER, WER Numbers, dates, mixed languages
    Markdown Structural accuracy Headings, lists, reading order
    Schema-Free Information recall Field discovery and consistency
    Fixed Schema Field accuracy Format, null values, evidence
    Table Cell and structural accuracy Rows/columns, merges, cross-page
    Spatial Localization Coordinate deviation, coverage Word-level bounding boxes and mapping

    9. Selection Strategy: There Is No “Universal OCR”

    From an engineering perspective, OCR selection can follow these principles:

    First, when dealing with large volumes of text and simple layouts, prioritize processing speed, cost, and basic recognition accuracy.

    Second, when document types are complex and templates change frequently, focus on the model’s generalization and structural understanding capabilities.

    Third, when the number of fields is fixed and business processes are strict, adopt a Schema-driven extraction approach paired with rule validation.

    Fourth, when tables are the core data source, you must build a dedicated table evaluation set; you cannot substitute it with general text recognition results.

    Fifth, when involving redaction, auditing, and evidence tracing, word-level or line-level coordinates are mandatory capabilities, and you cannot rely solely on natural language answers.

    Sixth, complex production systems are often not suited for a single engine. You can combine traditional OCR, layout analysis, VLMs, rule engines, and manual review based on the task to form a layered processing architecture.

    Ultimately, the optimal solution is not one engine ranking first in all tasks, but rather achieving stable, verifiable, and maintainable comprehensive results at a reasonable cost after clarifying business objectives. The true value of OCR lies not just in “recognizing text,” but in enabling document content to be searched, understood, structurally processed, and, when necessary, traced back to the original page for evidence validation.