SauvolaNet: Learning Adaptive Sauvola Network for Degraded Document Binarization

Deng Li, Yue Wu, Yicong Zhou

Abstract

SauvolaNet re-imagines the classic Sauvola thresholding algorithm as a trainable neural network layer, bridging the gap between traditional heuristic-based image processing and modern deep learning. By decomposing the binarization task into explainable, lightweight modules, the proposed architecture achieves state-of-the-art results on document binarization benchmarks. Remarkably, SauvolaNet utilizes only 40,000 parameters—approximately 1% the size of MobileNetV2—while delivering inference speeds over 5x faster than competing deep learning solutions.

Introduction

Document binarization—the conversion of grayscale images into binary black and white—is a foundational step for Optical Character Recognition (OCR). Historical and degraded documents often present significant challenges, including ink bleed-through, stains, uneven lighting, and fading.

Historically, researchers relied on local thresholding algorithms like Sauvola’s method. While computationally efficient, these methods are brittle and require manual parameter tuning. Conversely, modern Deep Neural Networks (DNNs) offer high robustness but function as computationally heavy "black boxes" with millions of parameters. SauvolaNet aims to provide the best of both worlds: the explainability and efficiency of classic algorithms combined with the adaptive learning power of DNNs.

Methodology

SauvolaNet decomposes the binarization process into three distinct, explainable modules that integrate domain knowledge directly into the network architecture.

SauvolaNet Architecture Overview

1. Multi-Window Sauvola (MWS)

Instead of a single fixed window, the network utilizes eight different window sizes (ranging from $7 \times 7$ to $63 \times 63$). The authors re-implemented the Sauvola formula as a differentiable DNN layer, allowing internal constants ($k$ and $r$) to be learned from data. To maintain efficiency, the model employs integral images to calculate local means and variances, ensuring $O(1)$ complexity regardless of window size.

2. Pixelwise Window Attention (PWA)

Recognizing that different regions of a document require different scales of analysis (e.g., fine text vs. large stains), the PWA module predicts a spatial "attention map." This lightweight sub-network determines the most appropriate window size for every individual pixel.

3. Adaptive Sauvola Threshold (AST)

The AST module fuses the outputs of the MWS and PWA. It weights the thresholds calculated across the eight windows according to the attention map, producing a final, spatially adaptive threshold for the entire image.

Experimental Results

The researchers evaluated SauvolaNet across 13 public datasets, including the DIBCO series (2009–2018), PHIDB, and Bickley-diary. Performance was measured using F-Measure (FM), Distance Reciprocal Distortion (DRD), and PSNR.

Performance Comparison: F-Measure vs. FPS vs. Parameters

Efficiency and Speed

As shown in the performance comparison, SauvolaNet occupies a unique position in the design space. With only 40K parameters, it is significantly smaller than DeepOtsu (~15.4M) and MobileNetV2 (~3.4M). On an NVIDIA 2080Ti, it achieves superior throughput, running at least 5x faster than other state-of-the-art DNN-based approaches.

Accuracy

SauvolaNet achieved the highest F-Measure on several major benchmarks, including DIBCO 2011 (94.32%) and H-DIBCO 2014 (97.83%). Qualitatively, the model excels at removing "ghost" text from ink bleed-through while preserving sharp edges on foreground characters.

Conclusion

SauvolaNet demonstrates that baking domain knowledge into a neural architecture can lead to massive gains in efficiency without sacrificing accuracy. By treating a classic algorithm as a differentiable layer, the model remains transparent and explainable. Future work may explore dynamic window scaling and optimizing the attention sub-network for pure CPU execution to further enhance accessibility for legacy hardware.

Summary updated

BibTeX
@inproceedings{li2021sauvolanet,
  author = {Deng Li and Yue Wu and Yicong Zhou},
  title = {{SauvolaNet: Learning Adaptive Sauvola Network for Degraded Document Binarization}},
  booktitle = {ICDAR},
  year = {2021},
  doi = {10.1007/978-3-030-86337-1\_36},
}
Figure