Skip to main content
QUICK REVIEW

[Paper Review] High-Fidelity Document Stain Removal via A Large-Scale Real-World Dataset and A Memory-Augmented Transformer

Ming‐Xian Li, Hao Sun|arXiv (Cornell University)|Oct 30, 2024
Handwritten Text Recognition TechniquesComputer Science3 citations
TL;DR

This paper proposes StainRestorer, a memory-augmented Transformer model for high-fidelity document stain removal, leveraging a novel hierarchical DocMemory module and a Stain Removal Transformer (SRTransformer) with dual attention mechanisms. It introduces StainDoc, the first large-scale, high-resolution (2145×2245) dataset with over 5,000 stained-clean image pairs, achieving state-of-the-art performance in PSNR (34.191), SSIM (0.955), and LPIPS (0.067) on the StainDoc dataset.

ABSTRACT

Document images are often degraded by various stains, significantly impacting their readability and hindering downstream applications such as document digitization and analysis. The absence of a comprehensive stained document dataset has limited the effectiveness of existing document enhancement methods in removing stains while preserving fine-grained details. To address this challenge, we construct StainDoc, the first large-scale, high-resolution ($2145 imes2245$) dataset specifically designed for document stain removal. StainDoc comprises over 5,000 pairs of stained and clean document images across multiple scenes. This dataset encompasses a diverse range of stain types, severities, and document backgrounds, facilitating robust training and evaluation of document stain removal algorithms. Furthermore, we propose StainRestorer, a Transformer-based document stain removal approach. StainRestorer employs a memory-augmented Transformer architecture that captures hierarchical stain representations at part, instance, and semantic levels via the DocMemory module. The Stain Removal Transformer (SRTransformer) leverages these feature representations through a dual attention mechanism: an enhanced spatial attention with an expanded receptive field, and a channel attention captures channel-wise feature importance. This combination enables precise stain removal while preserving document content integrity. Extensive experiments demonstrate StainRestorer's superior performance over state-of-the-art methods on the StainDoc dataset and its variants StainDoc\_Mark and StainDoc\_Seal, establishing a new benchmark for document stain removal. Our work highlights the potential of memory-augmented Transformers for this task and contributes a valuable dataset to advance future research.

Motivation & Objective

  • To address the lack of large-scale, high-resolution real-world datasets for document stain removal, which limits model generalization and performance.
  • To develop a deep learning model capable of precisely removing diverse stain types—such as ink and beverage stains—while preserving fine-grained document details like text, fonts, and graphics.
  • To overcome limitations of existing methods that rely on handcrafted features or fail to distinguish stains from genuine document content.
  • To establish a new benchmark for document stain removal through a comprehensive dataset and a novel architecture with hierarchical feature learning.

Proposed method

  • The authors construct StainDoc, a large-scale, high-resolution (2145×2245) dataset containing over 5,000 paired images of stained and clean documents across diverse scenes, stain types, severities, and backgrounds.
  • A novel DocMemory module is proposed to capture hierarchical stain representations at part, instance, and semantic levels using multiple memory units for multi-granularity feature extraction.
  • The Stain Removal Transformer (SRTransformer) employs an enhanced spatial attention mechanism with an expanded receptive field to model long-range dependencies and spatial patterns of stains.
  • A channel attention mechanism is integrated to emphasize channel-wise feature importance, improving the model’s ability to distinguish stain artifacts from real document content.
  • The dual-attention mechanism in SRTransformer enables precise localization and removal of stains while maintaining the integrity of underlying text and graphical elements.
  • The model is trained end-to-end on the StainDoc dataset and evaluated on multiple variants, including StainDoc_Mark and StainDoc_Seal, using standard metrics like PSNR, SSIM, LPIPS, and MAE.

Experimental results

Research questions

  • RQ1How effective is a memory-augmented Transformer architecture in capturing hierarchical stain representations for document stain removal?
  • RQ2Can a dual-attention mechanism combining spatial and channel attention improve stain removal fidelity while preserving document details?
  • RQ3To what extent does a large-scale, real-world dataset like StainDoc improve model generalization and performance compared to existing synthetic or limited datasets?
  • RQ4How does the hierarchical structure of the DocMemory module contribute to distinguishing complex stain patterns from genuine document content?
  • RQ5What is the relative contribution of the DocMemory module and the SRTransformer to the overall performance of the StainRestorer model?

Key findings

  • StainRestorer achieves state-of-the-art performance on the StainDoc dataset, with a PSNR of 34.191, SSIM of 0.955, and LPIPS of 0.067, significantly outperforming existing methods.
  • The ablation study confirms that removing the DocMemory module leads to a notable performance drop, with PSNR decreasing from 23.372 to 23.019, highlighting its critical role in feature representation.
  • Replacing the hierarchical DocMemory with a single-level structure reduces PSNR by 0.255 on StainDoc, demonstrating the benefit of progressive, multi-level feature refinement.
  • The SRTransformer component is essential: replacing it with a standard Vision Transformer reduces PSNR by 0.873 on StainDoc, confirming its effectiveness in spatial mapping and stain localization.
  • On the StainDoc_Mark and StainDoc_Seal variants, StainRestorer achieves PSNR of 34.191 and 33.298, respectively, with LPIPS scores below 0.07, indicating high perceptual quality and robustness.
  • Qualitative results show that StainRestorer effectively removes complex stains like ink and tea stains without introducing artifacts, while preserving text legibility and graphical details.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.