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":
- 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.
- 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.
- 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.
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.
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.
- 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