High-Resolution Document Shadow Removal via A Large-Scale Real-World Dataset and A Frequency-Aware Shadow Erasing Net

Zinuo Li, Xuhang Chen, Chi-Man Pun, Xiaodong Cun

Introduction

Capturing documents with smartphones is a common practice, but it often introduces distracting shadows that degrade human readability and impede downstream tasks like Optical Character Recognition (OCR). While natural image shadow removal has seen significant progress, document shadow removal presents unique challenges. Documents require the preservation of fine-grained details—tiny fonts, thin lines, and complex figures—at high resolutions.

Researchers from the University of Macau have addressed these challenges by releasing SD7K, the largest real-world high-resolution document shadow removal dataset to date, and proposing FSENet, a novel frequency-aware network. By decoupling images into low-frequency (illumination) and high-frequency (texture) components, their method achieves state-of-the-art results in restoring document clarity without the "hallucination" artifacts common in previous models.

The SD7K Dataset

A major bottleneck in document shadow removal has been the lack of large-scale, diverse training data. The authors introduce Shadowed Document 7K (SD7K) to fill this gap.

  • Scale: It contains 7,620 high-resolution (2462 × 3699) image pairs, making it roughly ten times larger than previous benchmarks like RDSRD or Kligler.
  • Diversity: The dataset covers various document types, including academic papers, manga, and complex figures, under three distinct lighting conditions: cool light, warm light, and natural sunlight.
  • Annotations: It includes manually annotated shadow masks, which are crucial for training robust detection and removal models.

FSENet: Frequency-aware Shadow Erasing Net

The core innovation of this work is FSENet, which adopts a "divide and conquer" strategy based on the Laplacian Pyramid. The architecture is designed to handle global illumination and local texture separately.

  1. Frequency Decoupling: The network splits the high-resolution input into multiple frequency layers. The lowest frequency layer captures global color and illumination (the shadow), while higher frequency layers contain sharp edges and textures (the content).
  2. Low-Frequency Deshading: To correct global lighting, the authors utilize a Dimension-Aware Transformer (DAT). Transformers excel at modeling long-range dependencies, allowing the model to reference "unshadowed" parts of the page to accurately correct shadowed regions.
  3. High-Frequency Restoration: For sharp details, a Texture Recovery Module (TRM) with dilated convolutions is employed. This increases the receptive field without sacrificing resolution, ensuring fonts remain crisp.
  4. Feature Alignment: A Tri-layer Attention Alignment (TAA) block merges these features back together, preventing misalignments between color corrections and text edges.

Key Results and Insights

The fundamental insight of FSENet is that shadows are primarily a low-frequency phenomenon, whereas document content is high-frequency. By treating them separately, the model avoids the "blurry text" problem typical of standard CNNs.

Qualitative comparison of FSENet against state-of-the-art methods on the SD7K dataset. FSENet (f) preserves text clarity and color consistency better than previous approaches.

FSENet significantly outperformed existing methods across both quantitative and qualitative metrics:

  • Quantitative Performance: On the SD7K dataset at full resolution, FSENet achieved a PSNR of 28.67 and an RMSE of 10.00, a substantial improvement over the previous state-of-the-art, BMNet (PSNR 24.70, RMSE 15.96).
  • Qualitative Superiority: As shown in the visual comparisons, FSENet is much better at preserving the original document's aspect ratio and fine textures. Unlike previous models, it avoids leaving "ghost" shadows or creating unreadable, blurry text in heavily shadowed regions.

Conclusion and Future Work

While FSENet sets a new benchmark for quality, its primary limitation is computational cost. The use of Transformers on high-resolution images requires significant GPU memory, making it currently unsuitable for real-time mobile applications. Future research will likely focus on model compression and distillation to bring this high-quality shadow removal to edge devices. Additionally, the authors suggest exploring even more complex scenarios, such as multi-source shadows or extreme low-light conditions.

Summary updated

BibTeX
@inproceedings{li2023high,
  author = {Zinuo Li and Xuhang Chen and Chi-Man Pun and Xiaodong Cun},
  title = {{High-Resolution Document Shadow Removal via A Large-Scale Real-World Dataset and A Frequency-Aware Shadow Erasing Net}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
}
Figure