ArbDR TMM 2026
IEEE Transactions on Multimedia · 2026 · DOI: 10.1109/TMM.2026.3689432

Cascaded Robust Rectification for Arbitrary Document Images

Chaoyun Wang1, Quanxin Huang1, I-Chao Shen2, Takeo Igarashi2, Nanning Zheng1, and Caigui Jiang1*

1Institute of Artificial Intelligence and Robotics, Xi'an Jiaotong University   ·   2The University of Tokyo   ·   *Corresponding Author

TL;DR — ArbDR decomposes arbitrary real-world document distortions—extreme perspective, physical folds, and local text warps—into three lightweight control-grid stages collapsed into a single high-resolution backward warp, reducing AAD error by 14.1%–34.7% across six benchmarks.

Distorted Document Input
ArbDR Rectified Output
↔
Input ArbDR
Interactive Optical Teaser · 3 Paper Regimes

One Architecture for All Capture Regimes

Built for real-world document captures: heavy background clutter (e.g., 65% soil/desk), incomplete cropped boundaries, and severe physical warps. Stage 1 frames the sheet before Stage 2 unwraps folds and Stage 3 refines line entropy.

65% Background · Auto-stopped at 2 F-Net iters · H_align: 1.983° → 1.759° (-11.3%)
Cascaded Stages · LOTTO Receipt on Gravel Soil (Click stage to zoom)
Stage 1 L-Net canonical affine output
1 · L-Net
Reject Clutter
Stage 2 C-Net coarse unwarping output
2 · C-Net
Global Unwarp
Stage 3 F-Net adaptive final output
3 · F-Net
Halign Converged
Architecture & Protocols

Three-Stage Cascaded Pipeline

Each stage predicts a compact 45 × 31 control grid with only 8.0M parameters, analytically composed so the original image is resampled once without multi-stage blur.

Figure 2: ArbDR three-stage cascaded framework
Fig. 2 — Cascaded Rectification Pipeline. L-Net predicts an affine normalization A into canonical view O₀, C-Net removes coarse curvature and pulls the grid back via D₁ = G₁ · A⁻¹, and F-Net refines content alignment until Axis-Aligned Line Entropy Halign converges.
01 · L-Net (Background & Boundary Agnostic)

Canonical Affine Alignment

Unlike corner detectors that fail when edges are cut off or backgrounds exceed 60%, L-Net predicts a foreground control grid inside valid paper regions and projects it into affine transform A = Snorm · Ainit via SVD—cropping clutter while preserving text aspect scale.

02 · C-Net (Global Geometry)

Coarse Shape Unwarping

Operates solely in canonical view O₀ to flatten large-scale folds, curls, and perspective skews, then analytically pulls its 45 × 31 control grid back to raw input coordinates (D₁ = G₁ · A⁻¹) so no intermediate interpolation degrades resolution.

03 · F-Net (Adaptive Line Entropy)

Self-Halting Content Refinement

Composes residual grids Dm+1 = Dm ◁ Gm+1 onto a single final remap. Unsupervised Axis-Aligned Line Entropy Halign tracks tracked LSD text/table edges at every step and halts automatically once alignment converges (~1.2 iters avg.).

Key Innovation · Unsupervised Adaptive Stopping (Halign)

Why Fixed Iterations Fail — and How Line Entropy Halts Automatically

Too few iterations leave heavy warps curved, while too many iterations over-warp clean layouts and inflate distortion (Table IV: Fixed 5-iter LD jumps 9.135 → 11.071). ArbDR measures foreground line-angle dispersion Halign via RBF tracking and adapts step count per image.

Adaptive F-Net Iteration 4 on Curved Table
Step 4 / 4 (Accepted → Converged): Halign = 1.109° (−41.2% vs C-Net). Step 5 rebounds to 1.123° ≥ 0.99×1.109° → Auto-Stopped.
Measured Halign Trajectory (Lower = Straighter Lines)
Severe Table (Stops @ 4) Moderate Contract (Stops @ 1)
2.0° 1.5° 1.0° 0.5° C-Net Iter 1 Iter 2 Iter 3 Iter 4 Iter 5 0.63° Stop 0.64° ✕ 1.89° 1.33° 1.11° Stop 1.12° ✕
Criterion Rule: Extract horizontal & vertical LSD segments from foreground C-Net grid and propagate via RBF interpolation. Accept step m iff Halign(m) < τ · Halign(m−1) with τ = 0.99.
Ablation Impact (Table IV): Cuts fixed-iteration over-warping from 11.071 → 9.528 LD while achieving best AD (0.201), AAD (0.062), and ACER (0.031).
Figure 1: Taxonomy of arbitrary document distortions
Fig. 1 — Distortion Taxonomy. Arbitrary captures span complete vs. incomplete boundaries under perspective, coarse physical shape, large cluttered backgrounds, and local content warps.
Figure 3: Unsupervised stopping criterion via line entropy
Fig. 3 — Axis-Aligned Line Entropy. Foreground LSD segments are tracked via RBF interpolation so F-Net halts automatically without ground-truth supervision.
Supplementary Figure 1: Synthetic incomplete-boundary training data pipeline
Supp. Fig. 1 — Boundary-Agnostic Training Data. Synthesizes paired incomplete-boundary and heavy-background warps with consistent forward/backward flow labels for L-Net, C-Net, and F-Net.
Figure 4: Layout-aligned OCR evaluation pipeline
Fig. 4 — Layout-Aligned OCR (ACER / AED). Warps ground-truth reading blocks via RAFT optical flow to isolate geometric accuracy from OCR reading-order errors.
Figure 5: Masked geometric evaluation AD-M and AAD-M
Fig. 5 — Masked Geometric Metrics (AD-M / AAD-M). Evaluates displacement and angle gradients strictly within valid foreground masks on incomplete pages.
Multi-Regime Case Gallery

Eight Real-World Cases Across All Capture Regimes

Inspect side-by-side ONNX CPU rectifications spanning large cluttered backgrounds (up to 65% non-document area), incomplete cropped boundaries, and severe physical warps. Click any image to zoom or send straight to the Live Studio.

Benchmarks & Visual Proof

State-of-the-Art Accuracy Across Real Captures

Evaluated across six public benchmarks (DocUNet, UDIR, WarpDoc, WarpDoc-Crop, DIR300, DocReal) and leading commercial rectification apps.

Figure 6: Qualitative comparisons across DocUNet, UDIR, WarpDoc, and WarpDoc-Crop
Fig. 6 — Qualitative Comparison. Visual results on DocUNet, UDIR (incomplete boundaries), WarpDoc (cluttered scenes), and WarpDoc-Crop. Click any figure to zoom.
Figure 7: Comparison against Baidu, TextIn, and Youdao
Fig. 7 — Comparison Against Commercial Apps. Tested under cluttered backgrounds, strong curls, and partial boundaries against Baidu, TextIn, and Youdao.
Supplementary Figure: Qualitative comparisons on DIR300 benchmark
DIR300 Qualitative Comparison. Real outdoor and indoor perspectives with shadows and curved bindings (AAD 0.054 · ACER 0.042).
Supplementary Figure: Qualitative comparisons on DocReal Chinese benchmark
DocReal (Chinese Documents). Contracts, receipts, and tables with dense character grids (AAD 0.061 · ACER 0.339).
Supplementary Figure 2: Iterative refinement steps
Supp. Fig. 2 — Iterative Progression. Most global curvature resolves after C-Net, while 1–2 F-Net iterations straighten residual wavy text lines cleanly.
Figure 8: Layout-Aligned OCR ACER comparison cases
Fig. 8 — Layout-Aligned OCR (ACER) Qualitative Examples. Shows why standard OCR CER misfires on multi-column layouts whereas Layout-Aligned ACER isolates true geometric straightness.
Figure 9: Failure cases on extreme high-frequency wrinkles
Fig. 9 — Limitations. Extreme high-frequency paper wrinkles (WarpDoc random) exceed the smoothness prior of the 45 × 31 control grid.

Metric Guide: AAD / AAD-M ↓ measures local geometric angular alignment error against ground-truth unwarping (masked to foreground pixels on incomplete UDIR pages); ACER ↓ measures layout-aligned OCR character error rate independent of reading-order failures.

DocUNet Benchmark
130 complete pages · Lower AAD / ACER is better
-14.1% AAD
ArbDR (Ours)
0.085 · ACER .049
AADD
0.099 · ACER .054
PaperEdge
0.121 · ACER .057
UVDoc
0.125 · ACER .065
UDIR (Incomplete Boundary)
195 partial pages · Masked AAD-M & ACER↓
-34.7% AAD-M
ArbDR (Ours)
0.126 · ACER .103
AADD
0.193 · ACER .115
DocTr++
0.216 · ACER .115
PaperEdge
0.218 · ACER .140
WarpDoc (Cluttered Scene)
1,020 in-the-wild pages · AAD & ACER↓
-34.7% AAD
ArbDR (Ours)
0.062 · ACER .031
AADD
0.095 · ACER .054
PaperEdge
0.195 · ACER .141
DocRes
0.197 · ACER .157
WarpDoc-Crop
1,020 tight-cropped pages · AAD & ACER↓
-27.2% AAD
ArbDR (Ours)
0.059 · ACER .034
AADD
0.081 · ACER .041
PaperEdge
0.110 · ACER .067
DocScanner
0.116 · ACER .058
Full Paper Tables (Six Benchmarks, Ablations, Commercial Apps & CPU ONNX) Click to expand full numbers ▾
Method DocUNet Benchmark (130 images / 50 OCR) UDIR Benchmark (Masked Metrics, 195 images / 70 OCR)
MSSIM↑LD↓AD↓AAD↓CER (std)↓ACER (std)↓ MSSIM-M↑LD-M↓AD-M↓AAD-M↓CER (std)↓ACER (std)↓
DewarpNet0.4748.3620.3980.1640.225 (0.210)0.088 (0.096)0.36118.0870.7540.3330.313 (0.210)0.202 (0.154)
DDCP*0.4719.0050.4280.1580.199 (0.195)0.068 (0.069)0.36019.3660.6500.2590.243 (0.204)0.137 (0.130)
DocTr0.5097.7730.3690.1510.185 (0.200)0.063 (0.061)0.38118.8340.7350.3100.289 (0.223)0.180 (0.144)
DocGeoNet0.5047.7170.3810.1580.187 (0.181)0.068 (0.083)0.38118.7300.7420.3160.287 (0.207)0.200 (0.150)
PaperEdge0.4737.9670.3680.1210.183 (0.218)0.057 (0.058)0.38716.7920.7020.2180.227 (0.214)0.140 (0.142)
FAM0.4978.4160.3770.1510.176 (0.190)0.067 (0.077)0.38816.4150.6730.2860.244 (0.215)0.133 (0.120)
DocScanner0.5177.4400.3360.1220.150 (0.176)0.054 (0.056)0.38818.3790.6790.2690.265 (0.213)0.175 (0.141)
Layout0.5256.7070.3000.1220.180 (0.203)0.057 (0.057)——————
DocTr++0.4649.3010.3710.1460.204 (0.209)0.061 (0.056)0.45212.4480.5290.2160.319 (0.306)0.115 (0.141)
UVDoc0.5456.8270.3160.1250.193 (0.209)0.065 (0.067)0.39617.2600.5710.2390.210 (0.187)0.134 (0.130)
DocRes0.4669.3710.4720.1990.227 (0.207)0.085 (0.082)0.39122.7570.9140.3680.459 (0.312)0.367 (0.316)
AADD0.5436.2490.2780.0990.150 (0.166)0.054 (0.059)0.40617.1910.5930.1930.189 (0.189)0.115 (0.127)
Ours (ArbDR)0.5196.1980.2600.0850.166 (0.195)0.049 (0.050)0.48910.3450.4040.1260.286 (0.306)0.103 (0.151)
Method Total FPS↑ Model FPS↑ WarpDoc Benchmark (1,020 images / 120 OCR) WarpDoc-Crop Benchmark (1,020 images / 120 OCR)
MSSIM↑LD↓AD↓AAD↓CER (std)↓ACER (std)↓ MSSIM↑LD↓AD↓AAD↓CER (std)↓ACER (std)↓
DewarpNet0.4956.40.32731.0750.8920.3640.540 (0.216)0.335 (0.182)0.46513.3030.4530.2060.258 (0.235)0.138 (0.136)
DDCP*0.47118.10.35723.3870.7180.2790.386 (0.249)0.201 (0.171)0.47514.0160.4700.1950.230 (0.238)0.116 (0.133)
DocTr0.5223.10.39427.0030.7760.2980.380 (0.250)0.214 (0.172)0.52111.7030.3470.1460.145 (0.200)0.075 (0.113)
DocGeoNet0.5622.10.40224.7000.7560.3070.396 (0.255)0.246 (0.183)0.52311.6020.3640.1570.165 (0.213)0.082 (0.109)
PaperEdge0.4677.00.39720.3330.5890.1950.219 (0.230)0.141 (0.150)0.50711.2710.3250.1100.110 (0.172)0.067 (0.110)
FAM0.517.30.36826.7810.7550.2960.438 (0.250)0.292 (0.212)0.51911.9640.3670.1540.173 (0.220)0.091 (0.124)
DocScanner0.5921.80.39227.4990.6370.2260.267 (0.271)0.153 (0.163)0.52711.7530.3160.1160.123 (0.193)0.058 (0.100)
DocTr++——0.24543.1261.0770.3380.519 (0.283)0.360 (0.248)0.50912.2920.3630.1550.173 (0.213)0.097 (0.140)
UVDoc0.6967.60.35826.2770.6320.2560.379 (0.249)0.199 (0.162)0.55110.1040.2780.1200.129 (0.192)0.066 (0.099)
DocRes0.4127.20.50112.8560.4550.1970.272 (0.227)0.157 (0.149)0.50313.0650.4240.1850.218 (0.214)0.119 (0.129)
AADD0.5667.00.51415.6420.2760.0950.128 (0.206)0.054 (0.090)0.5669.6100.2180.0810.098 (0.166)0.041 (0.051)
Ours (ArbDR)0.5148.90.5349.5280.2010.0620.079 (0.157)0.031 (0.038)0.5448.9000.1980.0590.073 (0.137)0.034 (0.044)
Method DIR300 Benchmark (300 images) DocReal Benchmark (200 images, Chinese OCR)
MSSIM↑LD↓AD↓AAD↓CER (std)↓ACER (std)↓ MSSIM↑LD↓AD↓AAD↓CER (std)↓ACER (std)↓
DewarpNet0.49213.9440.3320.1470.336 (0.692)0.146 (0.136)0.48113.3960.3480.1460.510 (0.485)0.423 (0.335)
DDCP*0.55211.0250.3570.1330.257 (0.635)0.093 (0.107)0.46316.0150.4580.1380.490 (0.424)0.404 (0.342)
DocTr0.6167.1890.2550.1070.211 (0.364)0.085 (0.093)0.55112.6660.3290.1290.503 (0.431)0.389 (0.306)
DocGeoNet0.6386.4030.2410.1060.206 (0.356)0.091 (0.091)0.55312.0790.3230.1300.518 (0.575)0.398 (0.412)
PaperEdge0.5847.9680.2550.0910.177 (0.614)0.063 (0.095)0.51911.3950.3050.0890.514 (0.544)0.358 (0.436)
FAM0.6077.6800.2430.1080.198 (0.369)0.090 (0.098)0.51213.2470.3540.1380.494 (0.393)0.422 (0.398)
DocScanner0.6237.0210.2260.0890.168 (0.354)0.070 (0.081)0.54212.3460.3140.1140.514 (0.551)0.385 (0.399)
DocTr++0.48419.4780.3460.1440.290 (0.660)0.143 (0.157)0.44419.7230.3530.1280.519 (0.577)0.428 (0.403)
UVDoc0.6217.7300.2190.1010.237 (0.754)0.089 (0.104)0.54911.2160.2700.1080.497 (0.510)0.392 (0.425)
DocRes0.6276.8200.2420.1050.227 (0.380)0.105 (0.117)0.55111.4400.3470.1420.489 (0.449)0.401 (0.344)
AADD0.7024.2610.1310.0570.132 (0.251)0.047 (0.067)0.6158.7910.1930.0750.484 (0.509)0.347 (0.356)
Ours (ArbDR)0.6585.0440.1430.0540.174 (0.638)0.042 (0.057)0.5779.1680.1900.0610.469 (0.476)0.339 (0.348)
GroupSettingMSSIM↑LD↓AD↓AAD↓CER (std)↓ACER (std)↓
Geometric Transform (GT)GT: Similarity (S)0.5309.7980.2140.0620.072 (0.143)0.031 (0.038)
GT: Perspective (P)0.5319.8390.2190.0620.083 (0.158)0.030 (0.040)
GT: Affine (Ours)0.5349.5280.2010.0620.079 (0.157)0.031 (0.038)
Iteration Strategy (IS)IS: 0 (C-Net only)0.5289.1350.2120.0780.088 (0.162)0.036 (0.048)
IS: 1 (Fixed 1)0.5369.4740.2050.0620.081 (0.161)0.033 (0.041)
IS: 2 (Fixed 2)0.5339.9620.2150.0620.071 (0.135)0.034 (0.037)
IS: 3 (Fixed 3)0.52910.4040.2290.0630.068 (0.136)0.033 (0.038)
IS: 4 (Fixed 4)0.52610.7140.2450.0630.074 (0.154)0.033 (0.040)
IS: 5 (Fixed 5)0.52411.0710.2590.0650.067 (0.131)0.035 (0.040)
IS: Adaptive (Ours)0.5349.5280.2010.0620.079 (0.157)0.031 (0.038)
Affine Loss (AL)AL: w/o L_Affine0.53610.1500.2110.0640.070 (0.141)0.032 (0.040)
AL: with L_Affine (Ours)0.5349.5280.2010.0620.079 (0.157)0.031 (0.038)
Commercial Apps on UDIR (Table III)
MethodMSSIM-M↑LD-M↓AD-M↓AAD-M↓CER↓ACER↓
Youdao0.33423.9310.9930.4520.3070.190
Baidu0.37817.8970.5780.2010.2270.111
TextIn0.44912.0810.3750.1200.1810.087
Ours (ArbDR)0.48910.3450.4040.1260.2860.103
CPU ONNX Runtime (deploy/benchmark_cpu.py)
Runtime ModeLatency↓Speedup↑PSNR Parity
PyTorch CPU (Adaptive)995.0 ms1.00×Reference
ONNX Runtime CPU (Adaptive)1342.4 ms0.74×50.33 dB (0.295 MAE)
ONNX Runtime CPU (Fast 1-iter)691.6 ms1.44×30.59 dB (Zero PyTorch)
Zero-PyTorch Online Engine

Live CPU Rectification Studio

Runs native-resolution ONNX Runtime inference on CPU with analytic grid composition — directly inside your browser via WebAssembly on Hugging Face Spaces / GitHub Pages, or via local Python deploy/web_server.py. Drop any photo onto the canvas or click a sample below.

Checking CPU backend...
Presets:
Distorted Document Input
Rectified Output
↔
Input Rectified
Distorted Input
Distorted Document Input Side View
ArbDR Rectified Output
Rectified Output Side View
Latency: —
F-Net: —
L / C / F: —
Resolution: —
Pick any of the 8 real presets above or drop a custom document photo onto the canvas.
Custom CPU Backend URL (Hugging Face Space / Local)
Input I₀ Input I₀
Stage 1 L-Net (O₀) Stage 1 · L-Net (O₀)
Stage 2 C-Net (O₁) Stage 2 · C-Net (O₁)
Stage 3 F-Net (Final) Stage 3 · F-Net (Final)
Reproducibility & Deployment

Quick Start & Deployment

Run lightweight CPU inference with zero PyTorch dependencies, reproduce full IEEE TMM paper benchmarks on GPU, or deploy this studio as a self-contained Docker / Hugging Face Space.

git clone https://github.com/chaoyunwang/ArbDR.git && cd ArbDR
pip install -r deploy/requirements_cpu_onnx.txt
python scripts/download_weights.py --onnx

# Batch rectification on CPU (Fast 1-Iter or full Adaptive stopping)
python deploy/infer_onnx.py --input assets/samples --output outputs/cpu_demo --fast_mode

# Launch local Project Page + Live CPU Demo at http://127.0.0.1:7860
python deploy/web_server.py --host 127.0.0.1 --port 7860
pip install -r requirements.txt
python scripts/download_weights.py --all   # arbdr.pkl (91.6 MB) + RAFT ONNX

# Full 3-stage adaptive rectification (paper default)
python infer.py --checkpoint checkpoints/arbdr.pkl --input <WARPED_DIR> --output outputs/rectified

# Evaluate geometric (MSSIM, LD, AD, AAD / masked -M) & Layout-Aligned OCR (ACER/AED)
python eval/evaluate.py --rect_dir outputs/rectified --gt_dir <GT_DIR> --dataset docunet
# Minimal Python inference API (no PyTorch required)
from deploy.infer_onnx import ArbDROnnxEngine
import cv2

engine = ArbDROnnxEngine(model_dir="deploy/models", num_threads=4)
out = engine.rectify(cv2.imread("photo.jpg"), max_iter=5, iter_mode="adaptive")
cv2.imwrite("rectified.png", out["rectified_bgr"])

# Build a ready-to-push Hugging Face Spaces Docker bundle (CPU Basic Free Tier)
python deploy/huggingface_space/prepare_space.py --output ../ArbDR-HF-Space
WEIGHTS · 91.6 MB

Pretrained PyTorch Model

Official 24.0M-param checkpoint (arbdr.pkl) via download_weights.py or Baidu Netdisk (mdqd).

ONNX CPU · 83.9 MB

Zero-PyTorch Runtime

Three exported FP32 ONNX graphs with analytic NumPy grid composition achieving 50.33 dB PSNR parity on CPU.

ZERO-COST ONLINE DEMO

HF Spaces & GitHub Pages

Runs live in-browser via ONNX Runtime Web (HF Space), plus optional non-root Dockerfile in deploy/huggingface_space/.

Citation

BibTeX

@article{wang2026arbdr,
  title={Cascaded Robust Rectification for Arbitrary Document Images},
  author={Wang, Chaoyun and Huang, Quanxin and Shen, I-Chao and Igarashi, Takeo and Zheng, Nanning and Jiang, Caigui},
  journal={IEEE Transactions on Multimedia},
  year={2026},
  doi={10.1109/TMM.2026.3689432}
}