UVDoc

What is UVDoc? UVDoc is a specialized document image unwarping model built on the PaddleOCR framework. Its primary goal is to correct geometric distortions—such as tilt, perspective deformation, and curvature—in scanned or photographed documents before the OCR engine attempts text recognition. By normalising the visual appearance of a page, UVDoc dramatically improves downstream character error rates.

PaddlePaddle 600K downloads apache-2.0 Image Captioning
Languagesenzh
TagsPaddleOCROCRPaddlePaddledoc_img_unwarpingimage-to-text
Downloads
600K
License
apache-2.0
Pipeline
Image Captioning
Author
PaddlePaddle

Run UVDoc locally on a Q4KM hard drive

Accelerate your deployment with Q4KM hard drives pre‑loaded with the UVDoc model and its PaddleOCR dependencies. Get instant, out‑of‑the‑box performance on any workstation. Get UVDoc on a Q4KM hard...

Shop Q4KM Drives

Technical Overview

What is UVDoc? UVDoc is a specialized document image unwarping model built on the PaddleOCR framework. Its primary goal is to correct geometric distortions—such as tilt, perspective deformation, and curvature—in scanned or photographed documents before the OCR engine attempts text recognition. By normalising the visual appearance of a page, UVDoc dramatically improves downstream character error rates.

Key Features & Capabilities

  • Geometric transformation of arbitrary‑shaped document images (photo‑books, receipts, forms, etc.).
  • Supports both English (en) and Chinese (zh) scripts out‑of‑the‑box.
  • Integrated as a image‑to‑text pipeline component in PaddleOCR, allowing seamless chaining with OCR, layout analysis, table extraction, and more.
  • Fast inference via PaddlePaddle‑GPU (CUDA 11.8 / 12.6) or CPU‑only fallback.
  • Open‑source implementation under the Apache‑2.0 license, encouraging commercial and research use.

Architecture Highlights – UVDoc leverages the TextImageUnwarping module of PaddleOCR, which is built on a lightweight encoder‑decoder network that predicts a dense flow field for each pixel. The flow field is then used to warp the input image into a rectified view. The model is trained on the DocUNet benchmark dataset, which contains a wide variety of real‑world document distortions.

Intended Use Cases – Any application that requires high‑accuracy OCR on non‑ideal document captures, including:

  • Mobile scanning apps (receipts, invoices, ID cards).
  • Enterprise document management pipelines where documents are photographed rather than scanned.
  • Historical document digitisation where pages may be warped or curved.
  • Pre‑processing step for downstream layout analysis (PP‑StructureV3) and table/field extraction.

Benchmark Performance

Relevant Benchmarks – For unwarping models, the most informative metric is the Character Error Rate (CER) of the downstream OCR after the image has been rectified. The DocUNet benchmark is the de‑facto standard for evaluating document image correction.

Reported Results

  • Model: UVDoc
  • Dataset: DocUNet benchmark
  • CER: 0.179 (≈ 17.9 % character error rate)

This CER demonstrates that UVDoc can reduce OCR errors by a substantial margin compared with raw, uncorrected images. In practice, the improvement translates to cleaner extracted text, fewer manual corrections, and higher downstream analytics accuracy.

Comparison to Similar Solutions – Competing unwarping approaches (e.g., DocUNet‑based CNNs or traditional homography methods) typically report CER values in the 0.20–0.30 range on the same benchmark. UVDoc’s sub‑0.18 CER places it among the top‑performing open‑source solutions, especially when combined with PaddleOCR’s state‑of‑the‑art recogniser.

Hardware Requirements

VRAM & Inference – The UVDoc model (~30 MB) comfortably fits into a 2 GB GPU memory budget for single‑image inference. For batch processing (batch size ≥ 8) a 4 GB GPU is recommended to avoid memory fragmentation.

  • Recommended GPU: NVIDIA RTX 3060 (12 GB) or higher for optimal throughput.
  • Minimum GPU: Any CUDA‑compatible GPU with ≥ 2 GB VRAM (CUDA 11.8 or 12.6).
  • CPU‑only fallback: PaddlePaddle’s CPU build (≈ 3.0.0) can run UVDoc on a modern 8‑core CPU, but inference speed drops to ~1–2 fps per image.
  • Storage: Model files occupy < 50 MB; keep an additional 200 MB for temporary warped images and logs.
  • Performance: On an RTX 3080, a single 1024 × 1024 document image is unwarped in ~30 ms (≈ 30 fps).

Use Cases

  • Mobile Receipt Scanning: Users photograph receipts with skewed angles; UVDoc rectifies them before OCR, yielding accurate expense‑tracking data.
  • Enterprise Document Ingestion: Large batches of photographed contracts are pre‑processed with UVDoc, reducing manual data‑entry effort.
  • Historical Archive Digitisation: Curators scan old books with curved pages; UVDoc flattens the images, preserving text fidelity for searchable archives.
  • Legal Evidence Processing: Police officers capture crime‑scene documents on‑the‑go; UVDoc ensures the text is legible for forensic analysis.
  • Integration with PP‑StructureV3: When used as part of the PP‑StructureV3 pipeline, UVDoc improves layout detection, table extraction, and seal recognition accuracy.

Training Details

Training Methodology – UVDoc was trained using the PaddlePaddle 3.0.0 framework with the TextImageUnwarping API. The training pipeline follows a supervised learning regime:

  • Dataset: DocUNet benchmark (≈ 2 k document images with ground‑truth homography transformations).
  • Loss Functions: Combination of L1 pixel‑wise loss and a smoothness regulariser on the predicted flow field.
  • Optimizer: Adam with an initial learning rate of 1e‑4, decayed by a factor of 0.5 every 10 k iterations.
  • Batch Size: 8 images per GPU (CUDA 11.8/12.6).
  • Training Compute: Approximately 4 hours on a single NVIDIA RTX 3090 (24 GB VRAM).

Fine‑Tuning – Users can fine‑tune UVDoc on domain‑specific document collections (e.g., medical forms) by loading the pre‑trained weights with model_name="UVDoc" and continuing training on the new dataset. The same loss configuration applies, and only a few epochs are typically needed to adapt to new distortion patterns.

Licensing Information

License Summary – UVDoc is released under the Apache‑2.0 license. This permissive licence grants you:

  • Freedom to use the model for commercial or non‑commercial projects.
  • Permission to modify, distribute, and create derivative works.
  • Obligation to retain the original copyright notice and provide a copy of the licence.
  • No warranty; the model is provided “as‑is”.

Commercial Use – You may embed UVDoc in SaaS platforms, mobile apps, or on‑premise solutions without paying royalties. The only requirement is proper attribution (e.g., “Powered by PaddlePaddle UVDoc – Apache‑2.0”).

Restrictions – The licence does **not** impose any field‑of‑use limitations, but you must not use the trademark “PaddlePaddle” in a way that suggests endorsement unless you have explicit permission.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives