Introduction
Document binarization—the task of separating foreground text (ink) from the background—is a foundational step in document analysis and optical character recognition (OCR). While straightforward for modern, clean documents, the task becomes significantly more complex when dealing with historical or damaged manuscripts. These documents often suffer from degradations such as "bleed-through" (ink from the reverse side appearing on the front), uneven lighting, chemical stains, and faded ink.
Traditional approaches typically rely on either Convolutional Neural Networks (CNNs) or Vision Transformers (ViTs). CNNs are efficient at capturing local textures but suffer from a limited receptive field, often failing to distinguish large-scale artifacts from text. Conversely, ViTs provide excellent global context through self-attention mechanisms but are computationally expensive and require vast amounts of training data. This paper introduces FourBi, a novel architecture that bridges this gap by utilizing Fast Fourier Convolutions (FFC) to capture both fine-grained local details and broad global context simultaneously.
Methodology: The FourBi Architecture
The core innovation of FourBi is its integration of the Fast Fourier Convolution (FFC) operator within a U-Net-like structure. This allows the model to operate in both the spatial and frequency domains.
The FFC Operator
Unlike standard convolutions that operate on a small local neighborhood of pixels, the FFC operator splits the input signal into two distinct branches:
- Local Branch: This branch employs standard spatial convolutions to capture sharp edges, stroke details, and fine textures.
- Global Branch: This branch utilizes a Real Fast Fourier Transform (FFT) to transition the data into the frequency domain. In this domain, every point contains information derived from the entire image, effectively providing the model with an infinite receptive field. This allows the model to understand the "big picture" of the document layout and background noise without the quadratic computational cost associated with Transformer self-attention.
Scale-Robust Inference and Post-Processing
FourBi demonstrates remarkable scale robustness. The authors trained the model on $256 \times 256$ pixel patches but performed inference on $512 \times 512$ patches. Because FFCs are inherently robust to scale changes, the model can leverage even greater global context at test time than it encountered during training. To ensure seamless results, the authors implemented an overlapping post-processing technique. By running the model on overlapping sections and applying distance-based weighting, they favor the center of each patch—where predictions are most accurate—thereby eliminating "seam" artifacts.
Experimental Evaluation
The authors evaluated FourBi against a comprehensive suite of public benchmarks, focusing on the Document Image Binarization Contest (DIBCO) series from 2009 to 2019. These datasets include a mix of handwritten and typewritten documents with diverse degradation types.
To test the model's ability to generalize beyond Latin scripts, the evaluation included the PHIBD (Persian) and ISOS-BTD (Irish) datasets. Training was further augmented with images from the Bickley Diary, SMADI, and Nabuco datasets to ensure exposure to a wide variety of document conditions.
Key Insights and Results
FourBi consistently achieved state-of-the-art (SOTA) or near-SOTA results across the DIBCO benchmarks, measured by F-Measure (FM) and pseudo-F-Measure (pFM).
- Efficiency vs. Performance: FourBi outperformed the leading Transformer-based model, DocEnTr, on the DIBCO17 dataset while being significantly more efficient. FourBi utilizes only 17.6 million parameters, compared to the 68.8 million required by DocEnTr. This makes FourBi a more practical choice for resource-constrained environments.
- Frequency Domain Advantages: The authors argue that text lines and paper textures often exhibit "pseudo-periodic" patterns. The frequency domain is uniquely suited to identifying and filtering these patterns, allowing the model to distinguish intentional ink from background noise more effectively than spatial-only models.
- Cross-Script Generalization: The model showed strong "zero-shot" style performance on non-Latin scripts. This suggests that FourBi learns the fundamental characteristics of ink and degradation rather than simply memorizing specific character shapes.
Conclusion and Future Work
FourBi represents a significant advancement in document binarization by demonstrating that frequency-domain operations can provide the global context of Transformers with the efficiency of CNNs. While the model is highly robust, it still faces challenges in cases of extreme staining where the degradation is sharper and darker than the ink itself.
Future research may explore the integration of lightweight attention mechanisms to further refine semantic understanding or the application of frequency-based convolutions to multi-spectral document imaging. Currently, FourBi stands as a highly efficient, scalable, and accurate solution for the preservation and digitization of historical documents.
Summary updated