Skip to main content
QUICK REVIEW

[Paper Review] UVDoc: Neural Grid-based Document Unwarping

Floor Verhoeven, Tanguy Magne|arXiv (Cornell University)|Jan 1, 2023
Advanced Vision and ImagingComputer Science4 citations
TL;DR

This paper introduces UVDoc, a novel neural grid-based document unwarping method that uses a dual-task fully convolutional network to predict 3D document shape and 2D unwarping grids from single RGB images. The key contribution is a new pseudo-photorealistic dataset, UVDoc, which reduces the domain gap between synthetic and real-world images, enabling state-of-the-art performance on benchmark datasets with improved metrics including lighting-corrected MS-SSIM and line straightness evaluation.

ABSTRACT

Restoring the original, flat appearance of a printed document from casual photographs of bent and wrinkled pages is a common everyday problem. In this paper we propose a novel method for grid-based single-image document unwarping. Our method performs geometric distortion correction via a fully convolutional deep neural network that learns to predict the 3D grid mesh of the document and the corresponding 2D unwarping grid in a dual-task fashion, implicitly encoding the coupling between the shape of a 3D piece of paper and its 2D image. In order to allow unwarping models to train on data that is more realistic in appearance than the commonly used synthetic Doc3D dataset, we create and publish our own dataset, called UVDoc, which combines pseudo-photorealistic document images with physically accurate 3D shape and unwarping function annotations. Our dataset is labeled with all the information necessary to train our unwarping network, without having to engineer separate loss functions that can deal with the lack of ground-truth typically found in document in the wild datasets. We perform an in-depth evaluation that demonstrates that with the inclusion of our novel pseudo-photorealistic dataset, our relatively small network architecture achieves state-of-the-art results on the DocUNet benchmark. We show that the pseudo-photorealistic nature of our UVDoc dataset allows for new and better evaluation methods, such as lighting-corrected MS-SSIM. We provide a novel benchmark dataset that facilitates such evaluations, and propose a metric that quantifies line straightness after unwarping. Our code, results and UVDoc dataset are available at https://github.com/tanguymagne/UVDoc.

Motivation & Objective

  • To address the domain gap between synthetic training data and real-world document photographs in document unwarping.
  • To develop a deep learning model that jointly predicts 3D document shape and 2D unwarping grids for geometric distortion correction.
  • To create a high-quality, realistic dataset with rich ground-truth annotations to enable robust training and evaluation.
  • To enable new evaluation paradigms by decoupling deformation and shading effects through paired shaded and unshaded images.
  • To introduce a novel line straightness metric for quantifying unwarping quality beyond standard image fidelity metrics.

Proposed method

  • A dual-head fully convolutional neural network is trained to predict both a 3D grid mesh of the document's 3D shape and a 2D backward unwarping grid in a single forward pass.
  • The network is trained end-to-end using a combination of L1, perceptual, and content-aware losses to improve alignment with document content.
  • The UVDoc dataset is created using image compositing techniques with real paper textures and controlled lighting to achieve pseudo-photorealistic appearance.
  • Each image in UVDoc is paired with a shaded version (UV-lit) and an unshaded version, enabling lighting-corrected evaluation.
  • The dataset includes 20,000 images with ground-truth 3D geometry and unwarping functions, annotated for direct training of grid-based models.
  • A new line straightness metric is proposed to quantitatively evaluate the structural quality of unwrapped text lines after correction.

Experimental results

Research questions

  • RQ1Can a neural network trained on pseudo-photorealistic data achieve better generalization and performance on real-world document unwarping benchmarks than models trained on purely synthetic data?
  • RQ2How does the inclusion of physically accurate 3D shape and unwarping function annotations in a realistic image distribution affect model performance and evaluation fidelity?
  • RQ3To what extent can a dual-task network architecture that jointly predicts 3D shape and 2D unwarping grids improve geometric correction compared to single-task approaches?
  • RQ4Can the availability of paired shaded and unshaded images in the dataset enable more robust evaluation by decoupling shading artifacts from geometric distortion?
  • RQ5Does the proposed line straightness metric provide a more meaningful evaluation of unwarping quality than standard image similarity metrics?

Key findings

  • The proposed method achieves state-of-the-art performance on the DocUNet benchmark, improving MS-SSIM from 0.475 to 0.504 and reducing CER from 0.222 to 0.228 when finetuned with UVDoc data.
  • On the UVDoc benchmark, the method achieves an MS-SSIM of 0.725 and reduces line straightness error (H-line) from 3.48 to 2.88 and V-line from 4.75 to 3.56 compared to models trained only on Doc3D.
  • Ablation studies show that using both the 3D grid prediction head and the content-aware loss (L𝑟) leads to the best performance, reducing H-line error to 1.85 and V-line error to 2.53.
  • The use of UVDoc data in training improves the model’s ability to preserve text structure, as evidenced by a 15% reduction in AD (average distortion) and 12% reduction in CER (character error rate) on the UVDoc benchmark.
  • The lighting-corrected MS-SSIM metric, enabled by the paired shaded and unshaded images in UVDoc, provides a more accurate and robust evaluation of unwarping quality than standard MS-SSIM.
  • The proposed line straightness metric demonstrates strong correlation with human perception and reveals performance differences not captured by standard metrics, especially in text line alignment.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.