TL;DR
Snapping a photo of a document in the wild usually invites visual chaos: shadows from your phone, motion blur, or blinding glare on glossy paper. Existing "all-in-one" restoration models still require a human (or an upstream classifier) to explicitly tell them what is wrong with the image before fixing it. DocDUR-Net removes the middleman: it automatically diagnoses the degradation directly from the pixels and adapts a single, shared restoration network on the fly—while keeping a manual override switch just in case.
What Problem Does This Paper Address?
Transforming a messy, phone-captured page into a crisp, readable document is a classic computer vision headache. Historically, researchers tackled this with specialized, single-degradation models: one network for shadow removal, another for deblurring, and a third for specular highlights (glare). Maintaining a zoo of separate heavy models in production is painful, and you have to know which model to route the image to beforehand.
Recent "unified" models improved things by packing multiple restoration skills into a single network. However, they still suffer from a major bottleneck: external task selection. You have to feed the network an explicit prompt or task ID (e.g., "Hey, remove shadows on this one"). If you want a truly autonomous pipeline where a user just snaps a picture and gets a clean document, the network needs to figure out what is broken all by itself.
Methods
DocDUR-Net pairs a standard, off-the-shelf image restoration backbone (Restormer) with two lightweight, novel modules that act as a diagnostic doctor and a translator:
- Degradation Perception Module (DPM): Running in parallel with the main backbone, this lightweight multi-stage encoder looks at a resized version of the input image to diagnose the problem. It compresses multi-scale features via global average pooling into a global summary, which then splits into two branches: one extracts a continuous feature vector describing the specific image's quirks, and the other predicts a probability distribution (degradation weights) over the known tasks, calibrated by a learnable temperature parameter.
- Degradation Prior-guided Adaptive Feature Fusion (DP-AFF): Instead of relying solely on what the input looks like, the model maintains a matrix of learnable degradation priors—essentially canonical, memorized "archetypes" of how shadows, blur, and glare behave. DP-AFF uses the predicted degradation weights to blend these learned priors, concatenates the result with the image-specific degradation feature from the DPM, and projects it directly into multiple stages of the Restormer backbone via simple element-wise addition.
- Dual Inference Modes: By default, DocDUR-Net runs in automatic mode, relying on DPM's predictions. However, because DP-AFF uses a clean weight vector to mix priors, a user can easily bypass DPM in manual mode by feeding in a one-hot task vector for explicit control.
The whole system is trained end-to-end using a mix of pixel-level L1, perceptual, and structural similarity (SSIM) losses for image quality, alongside a standard cross-entropy loss to supervise the DPM's task classification.
Datasets
The authors train a single unified model on the union of three existing benchmarks (sampling each task with equal probability to prevent larger datasets from dominating):
- SD7K for document shadow removal (6,479 training / 760 testing pairs).
- TDD for document text deblurring (40,000 training / 1,600 testing pairs).
- DocHighlight for real-world specular highlight removal (1,701 training / 500 testing pairs).
No new datasets were introduced in this work.
Key Insights and Ideas
- Tiny overhead, massive payoff: Adding self-diagnosis doesn't require a bloated architecture. DPM and DP-AFF add just 2.3% more parameters (0.61M parameters on top of a 26.13M backbone), yet jump average restoration quality by 1.261 dB PSNR over a blind unified baseline.
- Instance features + canonical priors beat either alone: Simply injecting input degradation features into the backbone helps (+1.112 dB), but fusing them with learnable task priors pushes performance further, giving the network both general task rules and image-specific nuance.
- "Misclassifications" reveal real-world ambiguity: Out of 2,860 total test images, DPM only "misclassified" 3 samples (all from the highlight dataset, predicted as shadows). When the authors inspected those 3 images, they actually did contain prominent shadows alongside glare! In automatic mode, DocDUR-Net dutifully cleaned up the shadows; switching to manual mode forced it to target the glare instead—proving why keeping a manual override in an autonomous system is a great design choice.
Key Results
- Best-in-class Unified Performance: Operating completely automatically (without task prompts), DocDUR-Net achieves an average PSNR of 29.405 dB and SSIM of 0.960 across all three tasks, beating prompt-dependent unified models like DocRes (28.003 dB / 0.953) and UPOCR (27.426 dB / 0.942).
- Beats Specialists at Their Own Game: Surprisingly, this single unified model outperforms dedicated single-task models on both shadow removal (30.318 dB vs. FSENet's 28.670 dB) and deblurring (28.114 dB vs. NAF-DPM's 26.940 dB). On highlight removal, it takes a close second (29.783 dB) just behind the specialist DocSHRNet (30.198 dB).
- Near-Perfect Perception: DPM hits 99.9% overall classification accuracy across the test suites (100% on shadows and blur, 99.4% on highlights), making automatic mode virtually indistinguishable from manual oracle selection (within 0.071 dB on highlights, and identical on the rest).
Limitations and Future Work
Not discussed in the paper. (Note: While the authors do not include a formal limitations section, their visual analysis of images containing both shadows and glare hints at an implicit boundary—when multiple degradations co-occur in a single image, single-label classification training forces the automatic mode to prioritize one dominant artifact rather than removing all of them simultaneously.)
Summary updated