Intrinsic Decomposition of Document Images In-the-Wild

Sagnik Das, Hassan A. Sial, Ke Ma, Ramón Baldrich, María Vanrell, Dimitris SamarasBMVC 2020

TL;DR

This paper tackles the challenge of accurately digitizing documents captured in real-world, uncontrolled lighting conditions. They introduce a novel two-step deep learning approach that disentangles document reflectance from shading and illumination, leading to significantly improved document image quality and a notable reduction in OCR errors.

What Problem Does This Paper Address?

Capturing document images with mobile devices is ubiquitous, but the resulting images often suffer from distortions due to non-uniform and complex lighting. These artifacts, such as shadows and shading, severely degrade the accuracy of subsequent processing steps like text extraction (OCR). While existing methods exist for shadow and shading removal, they often rely on strong assumptions (e.g., uniform local color statistics, flat paper shapes) that limit their effectiveness on "in-the-wild" document images with varied shapes and lighting. Furthermore, training robust deep learning models for this task is hindered by the difficulty and cost of acquiring large, fully-annotated datasets of real-world document images with ground truth for reflectance and shading.

Methods

The authors propose a unified, two-step deep learning architecture:

  1. WBNet (White-Balancing Network): This network takes a single RGB document image as input and estimates a per-pixel white-balance kernel. This kernel is used to produce a white-balanced image where the illuminant color is neutralized. This step is framed as an image-to-image translation problem, using a UNet-style encoder-decoder. The training leverages a physical constraint: the chromaticity of the predicted white-balanced image should match the chromaticity of the true reflectance.
  2. SMTNet (Shading and Material Texture Network): This network takes the white-balanced image from WBNet and disentangles it into two components: the material (paper color) and the shading. It employs two decoder branches (MNet for material, SNet for shading) that share an encoder. The key innovation here is a self-supervised training approach. It uses the fact that the texture (T) is known (from synthetic data) and the physical model $I = M \otimes T \otimes \lambda$ (where $\lambda$ is shading). The training relies on consistency losses: the chromaticity of the reconstructed reflectance ($M \otimes T$) should match the input white-balanced image's chromaticity, and the predicted shading should be consistent with the shading estimated from the material branch.

Datasets

  • Doc3DShade: A newly introduced dataset created by the authors. It combines physically accurate shading captured under diverse, realistic multi-illuminant conditions with a large collection of real document textures rendered in Blender. This dataset aims to overcome the limitations of purely synthetic datasets by incorporating realistic lighting and material properties. It contains 90,000 images.
  • Doc3D: The public dataset used as a base for creating Doc3DShade.
  • DocUNet benchmark dataset: Used for evaluating intrinsic image decomposition.
  • MIT Intrinsics dataset: Used for evaluating generalization to "paper-like" objects.
  • Real benchmark datasets: Used for qualitative comparison with existing shadow removal methods (from references [1, 24, 26, 44]).

Key Insights and Ideas

  • Physically-Constrained Self-Supervision: The core idea is to leverage the physics of image formation ($I = R \otimes S$) and known components (like texture T) to train deep networks without expensive ground-truth for shading and reflectance. This is achieved through chromaticity consistency losses.
  • Two-Step Approach for Robustness: Separating white-balancing from shading/material disentanglement allows each module to focus on a specific aspect of the problem, leading to better overall performance, especially under challenging illumination.
  • Doc3DShade for Realistic Training: The creation of a dataset with physically captured shading and diverse multi-illuminant conditions is crucial for training models that generalize to real-world scenarios, moving beyond simplified synthetic lighting.
  • Importance of Document-Specific Modeling: The paper highlights that general intrinsic image decomposition methods may not perform well on documents, necessitating specialized approaches that account for text and paper properties.

Key Results

  • OCR Improvement: Using their method as a pre-processing step for OCR resulted in a 26% improvement in character error rate (CER) on the DocUNet benchmark.
  • Intrinsic Image Decomposition: The method shows strong qualitative results on real images, outperforming existing methods in retaining background color and handling non-uniform illumination. Quantitative metrics like MS-SSIM and LD also showed improvement.
  • Generalization: The model demonstrates good generalization to real scenes and even "paper-like" objects from other datasets (MIT-Intrinsics) without fine-tuning.
  • Shadow Removal: While not explicitly trained for shadow removal, the method shows competitive qualitative performance on soft shadows, though it struggles with hard shadows.

Limitations and Future Work

  • Hard Shadows: The paper acknowledges that their model does not explicitly model hard shadows and thus does not generalize well to them. The Doc3DShade dataset also lacks many examples of hard shadows.
  • Future Work: The authors plan to explicitly model shadows in their self-supervised architecture in future work.

Summary updated

BibTeX
@inproceedings{das2020intrinsic,
  author = {Sagnik Das and Hassan A. Sial and Ke Ma and Ramón Baldrich and María Vanrell and Dimitris Samaras},
  title = {{Intrinsic Decomposition of Document Images In-the-Wild}},
  booktitle = {BMVC},
  year = {2020},
  url = {https://openreview.net/forum?id=CL6ikVgSGoW},
}
Figure