DocPristine: Content-Aware Document Appearance Enhancement under Real-World Mixed Degradations

Zihan Huang, Junle Liu, Zhonghao Ye, Yuyi Zhang, Peirong Zhang, Hanlin Li, Yongxin Shi, Lianwen JinarXiv 2026

TL;DR

Ever snapped a photo of a receipt or textbook page, only to end up with an unreadable mess of glare, shadows, and motion blur? Existing restoration models struggle when these issues overlap, often washing out fine text strokes right along with the shadows. DocPristine solves this by tapping into a surprising superpower of document-trained vision encoders: their ability to keep "staring" right at the text even through heavy visual noise, using that focus to guide pixel-level cleanup.

What Problem Does This Paper Address?

Transforming a messy smartphone photo of a page into a crisp, PDF-like scan is called Document Appearance Enhancement (DAE). In the real world, degradations rarely show up alone—a glossy page might have a harsh camera flash (specular highlight), a cast shadow from your hand, paper texture, and slight blur all overlapping in the exact same spot.

Current DAE methods hit three main walls when dealing with these "mixed degradations":

  1. Cascading errors: Single-task models force you to fix one issue at a time (e.g., deblurring, then shadow removal). Early mistakes compound, and fixing one artifact can destroy the visual cues needed to fix the next.
  2. Fragile low-level cues: Many models guide restoration using edge maps or background estimations. Where glare and blur collide, text blends into the page, causing these low-level cues to miss fine strokes, math symbols, or table lines.
  3. Spatially blind LLMs: Recent approaches ask multimodal LLMs to diagnose the image ("this has shadows and blur"). That gives a nice global summary, but zero spatial guidance on where the tiny, endangered text strokes actually live.
Comparison of DAE paradigms: fragile low-level visual cues, spatially blind LLM diagnosis, and DocPristine's content-aware document feature guidance.

Methods

Instead of inventing a restoration network from scratch, the authors pair a standard image-restoration backbone (Restormer) with a frozen, pretrained document Vision Transformer (MonkeyOCRv2-B). While Restormer handles pixel reconstruction, the frozen ViT acts as a content-aware spotter.

To bridge the frozen ViT and the trainable restoration network, DocPristine introduces three novel modules:

  • Adaptive Multi-Layer Feature Fusion (AMFF): Different depths of a vision encoder see different things—shallow layers capture color and lighting, while deep layers grasp text structure. AMFF learns spatial weights to blend features from four different ViT depths (layers 3, 6, 9, and 12) tailored to what each specific patch of the page needs.
  • Hierarchical Gated Conditioning (HGC): Injected at multiple scales in the encoder and decoder, HGC acts like a smart valve. Using spatial gates, it regulates how much ViT guidance flows into the pixel features, separating background cleanup from delicate text recovery.
  • Shifted-Window Cross-Attention (SWCA): Placed at the network's bottleneck, SWCA lets degraded pixel queries borrow structural clues from neighboring regions. If glare wipes out half a word, shifting the attention window lets the model peek at intact letters nearby to infer font size and alignment.
Figure 3. Overall architecture and key components of DocPristine, which integrates features from a document-adapted visual encoder into the restoration backbone through Adaptive Multi-Layer Feature Fusion (AMFF), Hierarchical Gated Conditioning (HGC), and Shifted- Window Cross-Attention (SWCA).

Datasets

Training and testing mixed-degradation models has been bottlenecked by data scarcity, so the authors built DocACE:

  • DocACE-Synthetic (Training): Generated on the fly from 141,649 clean pages (sourced from DocLayNet, Doraemon, M6Doc, CDLA, and arXiv). The pipeline warps geometry (via Doc3D), layers on realistic paper shadows/textures (Doc3DShade), simulates uneven lighting/glare, and adds blur—yielding pixel-aligned dirty and clean pairs.
  • DocACE-Real (Benchmark): 120 challenging real-world phone captures (drawn from Wild-, Pure-, and Real5-OmniDocBench) featuring co-occurring degradations. Unlike older benchmarks (DocUNet and RealDAE, also used here for evaluation) that focus mostly on lighting/color and lack OCR metrics, or MixedDoc which uses synthetic artifacts without PDF-like targets, DocACE-Real provides human-verified, Photoshop/CamScanner-restored reference images plus ground-truth annotations for text, formulas, and tables.

Key Insights and Ideas

  • Document ViTs have X-ray vision for text: When the authors visualized self-attention maps on badly degraded pages, general-purpose encoders like DINOv3-L wandered aimlessly. Document-adapted ViTs (like MonkeyOCRv2-B and WeVisDoc), however, stayed locked onto text lines despite heavy glare and shadows. Freezing this knowledge gives restoration networks a rock-solid spatial map for free.
Figure 2. Visualization of attention maps from different visual encoders on clean and degraded document images.
  • Shallow layers fix the paper; deep layers save the ink: Ablation studies revealed a neat division of labor. Relying solely on shallow ViT features (layer 3) actually topped pixel metrics on older benchmarks (DocUNet/RealDAE) where the main goal is evening out background lighting. But on gnarly mixed degradations (DocACE-Real), deeper layers (layer 12) drove OCR accuracy way up by preserving character structure. Fusing all four gives the best of both worlds.

Key Results

Across DocUNet, RealDAE, and DocACE-Real, DocPristine takes the crown in visual quality (PSNR and SSIM):

  • Visual Restoration: On DocACE-Real, DocPristine hits 21.86 dB PSNR and 0.9140 SSIM, jumping +3.42 dB and +0.0603 SSIM ahead of the runner-up, DocRes. On DocUNet, it boosts SSIM by 0.0350 over Uni-DocDiff.
  • Downstream Parsing: Using PaddleOCR-VL-1.6 to read the restored pages on DocACE-Real, DocPristine lifts the overall parsing score (OCROverall, combining text, math formulas, and tables) from 78.61 on raw degraded photos to 83.66—beating DocRes across every sub-metric, including a +1.87 point jump on table structure recognition.
  • Compact Guidance Wins: Intriguingly, the smaller 0.1B-parameter MonkeyOCRv2-B encoder outperformed larger 0.3B ViTs (including Qwen3.5-4B's ViT and DINOv3-L) as a guidance source.

Limitations and Future Work

Not discussed in the paper. (Note: The authors do not include a dedicated limitations or future directions section in the main manuscript.)

Summary updated

Abstract

Camera-captured documents often exhibit mixed degradations, such as highlights, shadows, and blur, that distort backgrounds and obscure text details. Document appearance enhancement (DAE) aims to mitigate these degradations and improve readability. Existing document appearance enhancement methods rely either on input-derived visual cues that can become unreliable under severe degradation or on LLM-based degradation diagnosis that lacks spatial guidance. Notably, we find that pretrained document visual encoders continue to attend to text regions in degraded documents, providing content-aware guidance. Based on this insight, we propose DocPristine, which adaptively fuses multi-layer features from a frozen document visual encoder and injects them into a pixel restoration network. To integrate these features into a pixel restoration network, DocPristine combines Adaptive Multi-Layer Feature Fusion (AMFF), Hierarchical Gated Conditioning (HGC), and Shifted-Window Cross-Attention (SWCA). Specifically, SWCA draws on structural cues from neighboring locations across window boundaries to recover fine text details.We also introduce DocACE, with a synthetic mixed-degradation training set (DocACE-Synthetic) and a real-world test set (DocACE-Real) containing manually restored ground-truth images and document parsing annotations. Comprehensive experiments across three benchmarks demonstrate that DocPristine achieves state-of-the-art appearance enhancement quality and consistently improves downstream document parsing. Code, models, and data will be publicly available.
BibTeX
@misc{huang2026docpristine,
  author = {Zihan Huang and Junle Liu and Zhonghao Ye and Yuyi Zhang and Peirong Zhang and Hanlin Li and Yongxin Shi and Lianwen Jin},
  title = {{DocPristine: Content-Aware Document Appearance Enhancement under Real-World Mixed Degradations}},
  year = {2026},
  eprint = {2611.32176},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.32176},
}
Figure