TL;DR
This paper introduces SD7K, the largest real-world dataset for document shadow removal to date, and FSENet, a novel frequency-aware network designed to handle high-resolution images. By decoupling document images into low-frequency color components and high-frequency text details, the proposed method effectively removes complex shadows while preserving crisp font boundaries without exhausting GPU memory.
What Problem Does This Paper Address?
When we take photos of documents using smartphones or casual cameras, shadows often obscure the text, degrading readability and hindering downstream tasks like Optical Character Recognition (OCR).
While natural shadow removal (e.g., removing shadows from a landscape or street view) has advanced significantly, applying these techniques to documents fails for two main reasons:
- Resolution and Detail Preservation: Documents require high-resolution processing to keep fonts and figures sharp. Existing deep learning models usually downsample images to avoid out-of-memory errors, which blurs critical text details.
- Data Scarcity: Current document shadow removal datasets are tiny—often containing only a few hundred images—forcing models to rely on synthetic data that doesn't match real-world lighting complexities.
As shown in Figure 1, previous methods frequently introduce severe artifacts, incorrect white balancing, or blurriness when applied to real-world document shadows.
Methods
The authors propose the Frequency-Aware Shadow Erasing Net (FSENet), which leverages a classic image processing technique—the Laplacian Pyramid (LP)—to break a high-resolution image down into multiple frequency components. This allows the network to process different image attributes separately and efficiently.
1. Low-Frequency Deshading Module
The lowest-frequency layer contains global color and illumination information (where the shadow's main gradient resides). To fix this, the authors use a Dimension-Aware Transformer (DAT) combined with a Tri-layer Attention Alignment (TAA) block. Transformers excel at capturing long-range dependencies, making them ideal for modeling global illumination changes and correcting white balance across the entire document.
2. High-Frequency Restoration Module
The higher-frequency layers contain sharp edges, textures, and font boundaries. Instead of passing these massive maps through heavy transformer blocks, FSENet learns a compact "contour map" to bridge the frequency domains. It then uses a Texture Recovery Module (TRM) packed with dilated convolutions to expand the receptive field efficiently, ensuring text boundaries remain sharp without consuming excessive GPU memory.
Datasets
A core contribution of this work is the Shadowed Document 7K (SD7K) dataset.
- Scale: It contains 7,620 pairs of high-resolution ($2462 \times 3699$) shadow and shadow-free document images, making it over 10 times larger than existing benchmarks like RDSRD or Kligler.
- Diversity: It covers various document types (text, papers, figures, and manga) captured under three distinct light sources (cool light, warm light, and natural sunlight) using over 30 types of physical occluders.
Key Insights and Ideas
- Divide and Conquer via Frequency: Processing high-resolution images directly with transformers is computationally impossible due to the quadratic complexity of self-attention. Decoupling the image into frequency domains allows the network to apply heavy attention mechanisms only to the downsampled low-frequency color maps, while using lightweight convolutional structures for high-frequency textures.
- The Pitfalls of Synthetic Data: Models trained purely on small or synthetically generated datasets fail to generalize to real-world ambient light variations. A massive, physically captured dataset like SD7K is essential for robust performance.
Key Results
FSENet was evaluated against traditional and deep learning baselines across multiple resolutions ($512\times512$, $1024\times1024$, and full resolution).
Quantitative Performance
On the full-resolution SD7K dataset, FSENet achieved state-of-the-art performance across all major metrics:
- PSNR ↑: 28.67 (compared to the next best scalable method, Mask-ShadowGAN, at 24.67)
- RMSE ↓: 10.00 (a massive drop from the input baseline of 44.14)
- SSIM ↑: 0.96
Qualitative Performance
As illustrated in Figure 6, when tested on high-resolution documents, alternative methods either leave behind shadow stains (MaskShadowGAN) or completely distort the document's original color profile (Jung et al.). FSENet consistently recovers clean, uniform backgrounds while maintaining crisp text readability.
Limitations and Future Work
Despite its impressive performance, FSENet is not yet suitable for real-time deployment on edge devices (like smartphones). The network contains roughly 29.34 million parameters, and processing a full-resolution image takes approximately 7.93 seconds on a desktop-grade GPU.
The authors note that future work will focus on network compression and acceleration techniques to make this frequency-aware architecture lightweight enough to run directly inside mobile camera applications.
Summary updated