Cascaded Robust Rectification for Arbitrary Document Images

Chaoyun Wang, Quanxin Huang, I-Chao Shen, Takeo Igarashi, Nanning Zheng, Caigui JiangarXiv 2025 · OpenReview

Abstract

Document rectification in real-world scenarios poses significant challenges due to extreme variations in camera perspectives and physical distortions. Driven by the insight that complex transformations can be decomposed and resolved progressively, we introduce a novel multi-stage framework that progressively reverses distinct distortion types in a coarse-to-fine manner. Specifically, our framework first performs a global affine transformation to correct perspective distortions arising from the camera's viewpoint, then rectifies geometric deformations resulting from physical paper curling and folding, and finally employs a content-aware iterative process to eliminate fine-grained content distortions. To address limitations in existing evaluation protocols, we also propose two enhanced metrics: layout-aligned OCR metrics (AED/ACER) for a stable assessment that decouples geometric rectification quality from the layout analysis errors of OCR engines, and masked AD/AAD (AD-M/AAD-M) tailored for accurately evaluating geometric distortions in documents with incomplete boundaries. Extensive experiments show that our method establishes new state-of-the-art performance on multiple challenging benchmarks, yielding a substantial reduction of 14.1%--34.7% in the AAD metric and demonstrating superior efficacy in real-world applications.

Introduction

Document rectification—the process of flattening a document image—is a critical precursor for high-quality Optical Character Recognition (OCR) and digital archiving. Despite advancements in deep learning, existing models often falter when faced with "arbitrary" document images captured in uncontrolled environments. These images typically exhibit complex backgrounds, incomplete boundaries (where the document is partially cropped), and a combination of perspective, shape, and content-level distortions.

Overview of distortion categories and document types addressed by the proposed framework.

Furthermore, standard evaluation metrics like Character Error Rate (CER) are frequently unreliable. They are heavily influenced by the OCR engine's layout analysis, which can fail even if the geometric rectification is accurate. This paper addresses these challenges through a cascaded rectification framework and more robust evaluation protocols.

The ArbDR Framework

We propose the Cascaded Robust Rectification (ArbDR) framework, which decomposes the complex rectification task into three specialized stages:

  1. L-Net (Localization): This stage predicts a sparse control grid to perform a global affine transformation. By normalizing the document into a canonical space, it removes background interference and corrects perspective distortion.
  2. C-Net (Coarse Rectification): Using the normalized output, C-Net predicts a dense deformation field to resolve non-linear physical deformations, such as paper curls and large folds.
  3. F-Net (Fine-tuning): This iterative stage targets subtle, local content distortions. To prevent over-correction, we employ an Adaptive Iterative Stopping mechanism based on Axis-Aligned Line Entropy ($H_{align}$), which measures text line alignment.
The proposed cascaded rectification architecture featuring L-Net, C-Net, and F-Net.

Robust Evaluation Metrics

To provide a more faithful assessment of rectification quality, we introduce two sets of metrics:

  • Layout-Aligned OCR Metrics (AED/ACER): These metrics decouple rectification quality from layout analysis errors by enforcing ground-truth reading order during OCR evaluation.
  • Masked Geometric Metrics (AD-M/AAD-M): These focus evaluation strictly on the document area, preventing background noise from skewing results, which is particularly important for documents with incomplete boundaries.

Experimental Results

The ArbDR model was trained on a large-scale composite dataset and evaluated against several benchmarks, including DocUNet, UDIR, and WarpDoc.

  • State-of-the-Art Performance: Our method achieved a 14.1%–34.7% reduction in the AAD metric across multiple benchmarks, setting new performance standards.
  • Commercial Comparison: In head-to-head tests on the UDIR dataset, ArbDR outperformed leading commercial APIs (e.g., Baidu, Youdao) in geometric accuracy.
  • Efficiency: The model is lightweight (24M parameters) and efficient, achieving a high throughput of 48.9 FPS on modern hardware.

Conclusion

The proposed cascaded framework demonstrates that decomposing document rectification into perspective, shape, and content components significantly improves robustness. While the system excels in most real-world scenarios, extremely severe and high-frequency wrinkles remain a challenge due to data scarcity and single-view ambiguity. Future work will explore multi-view 3D modeling to further refine rectification in these extreme cases.

Summary updated

BibTeX
@misc{wang2025cascaded,
  author = {Chaoyun Wang and Quanxin Huang and I-Chao Shen and Takeo Igarashi and Nanning Zheng and Caigui Jiang},
  title = {{Cascaded Robust Rectification for Arbitrary Document Images}},
  year = {2025},
  eprint = {2511.23150},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.23150},
}
Figure