Manuscript Offprint

arXiv:2609.03445

OCR-EDR: Rendering-Aware Diagnosis and Repair for Closed-Loop OCR Improvement

Linnan Zhao, Kang Liu, Hao Yu, Jiabo Zhan, Chong Sun, Chen Li

Abstract

Although document OCR systems perform increasingly well on routine documents, complex formulas, structured text, and long-tail formats remain error-prone. OCR predictions may omit fine-grained content or hallucinate unsupported outputs, while equivalent encodings of the same visible content must be accommodated. Existing OCR evaluation methods mostly report aggregate metrics, offering limited support for analyzing case-level errors and improving OCR performance. We propose OCR-EDR (OCR Error Diagnosis and Repair), a rendering-aware framework that advances from fine-grained diagnosis to iterative repair. Given a source image, an editable OCR prediction, and its rendered image, OCR-EDR first jointly assesses whether the prediction and its rendering are consistent with the source, preserving valid predictions, including rendering-equivalent ones, while diagnosing and localizing genuine errors. It then applies executable edits and may request an updated rendering for iterative reassessment. We construct OCRErrBench from diverse real OCR predictions, covering text and formulas, exact and rendering-equivalent positives, and genuine errors, and develop the DocEDR model to execute the diagnosis-repair loop. On OCRErrBench, DocEDR achieves 94.78% diagnostic accuracy. It repairs 86.23% of erroneous inputs to visual consistency, raises formula Case-F1 by 30.99 percentage points over DOCR-Inspector-7B on DOCRcaseBench, and improves formula CDM by up to 4.62 percentage points on the identified Bad subsets of four OCR systems on UniMER-Test. These results show that OCR-EDR turns fine-grained OCR analysis into verified corrections and performance gains.

Introduction

Although OCR systems perform well on routine documents, complex formulas, structured text, and long-tail formats remain error-prone. Specialized recognizers in traditional OCR pipelines are limited by their recognition capability and training coverage, and may miss fine-grained content or misrecognize characters, symbols, and structures. General vision-language models, in contrast, may hallucinate outputs unsupported by the source image (Liu et al. 2024; Fu et al. 2025; Ouyang et al. 2025). Complicating this analysis, structured OCR may represent the same visible content using different but equivalent encodings, which should not be treated as recognition errors. Current pipelines largely summarize such failures using aggregate scores and error counts, which reveal little about the specific error patterns in individual

Figure

Figure 1: Overview of the DocEDR model. (a) Unified diagnosis-and-repair loop. (b) Diagnostic performance on OCRErrBench using the results in Table 2; Loc-Text and Loc-Formula denote localization F1 over text character spans and normalized formula-token spans, respectively. (c) Formula CDM before and after refinement using the results in Table 6.

cases and provide limited guidance for improving predictions. Fine-grained diagnosis and repair of erroneous cases can both clarify model failure modes and directly improve predictions, providing more targeted feedback for subsequent OCR optimization.

Existing work addresses individual components of this process but does not integrate them into a unified framework. Text-based post-correction maps noisy OCR sequences to cleaner text through statistical, neural, or language-model priors (Dong and Smith 2018; Schaefer and Neudecker 2020; Lyu et al. 2021; Soper, Fujimoto, and Yu 2021; Thomas, Gaizauskas, and Lu 2024), but cannot directly verify whether an edit restores the source document's visual content. A recent diagnostic study, DOCR-Inspector, defines 28 real-world document OCR error types and provides fine-grained feedback (Zhang et al. 2025), but cannot autonomously repair the current prediction, inspect a new rendering, and decide whether to continue or stop. It is also sensitive to representational conventions: 'to versus vrightarrow, and {bfx} versus vextbf{x}, differ as strings but render identically. A format-bound diagnosis can therefore reject a valid output. LATTE introduces visual comparison into formula recognition by using rendered delta-view feedback to localize and iteratively refine LaTeX formulas and tables (Jiang et al. 2025), but operates only on identified errors and repairs them in task-specific formats. It therefore does not unify correct-result preservation, diagnosis across text and formulas, and reuse of verified repairs. Closing the loop requires these capabilities to operate together.

We accordingly formulate OCR Error Diagnosis and Repair (OCR-EDR), illustrated in Figure 2. Given a source region II, an editable OCR prediction pp, and its rendered image R(p)\mathcal{R}(p), OCR-EDR jointly analyzes all three inputs. The source image supplies external visual evidence, the OCR sequence supports symbolic localization and editing, and the rendered image exposes the visual consequence of the current prediction. Their joint analysis allows the policy to preserve correct or rendering-equivalent predictions and to classify, localize, and repair genuine errors. Rather than treating pp as a fixed output, OCR-EDR maintains it as an editable state whose revisions can be rerendered and visually reassessed.

To evaluate these capabilities, we construct OCRErrBench, a 900-case benchmark balanced across text and formulas. It comprises 457 valid (Good) and 443 erroneous (Bad) cases drawn from diverse real OCR predictions. Annotated for validity, error type, location, and target correction, OCRErrBench jointly evaluates preservation, diagnosis, localization, and repair across exact and rendering-equivalent positives and genuine OCR errors. Figure 3 summarizes its construction and verification.

OCR-EDR defines the task and closed-loop process; we further develop the DocEDR model as a unified policy that instantiated it. DocEDR first learns validity assessment, error classification, and localization, then acquires preservation, local or global editing, optional rerendering, visual reassessment, and stopping through staged repair training. Figure 1 summarizes this loop and its performance. On OCR-ErrBench, DocEDR achieves 94.78% diagnostic accuracy and repairs 86.23% of erroneous inputs to visual consistency. In zero-shot formula evaluation on DOCRcaseBench, it improves Case-F1 by 30.99 percentage points over the benchmark's native DOCR-Inspector-7B. On the UniMER-Test printed-expression subsets, it improves formula CDM by up to 4.62 points on the identified Bad subsets of four OCR systems. Thus, DocEDR turns the capabilities defined by OCR-EDR into verified corrections across benchmarks and OCR systems.

Our main contributions are:

  • We formulate OCR-EDR as a unified task and closed-loop paradigm that connects fine-grained diagnosis, executable correction, and rendering-based reassessment while preserving correct and rendering-equivalent predictions.
  • We construct OCRErrBench and a unified evaluation protocol for preservation, diagnosis, localization, and repair across exact and rendering-equivalent positives and genuine OCR errors.
  • We propose the DocEDR model and a staged training strategy that instantiate OCR-EDR as a unified policy for preservation, repair, visual reassessment, and stopping.
  • We demonstrate that cross-benchmark diagnosis can be converted into verified inference-time corrections, yielding consistent gains on error subsets identified across diverse OCR systems.

References (37)