# Diffusion-Denoising Process with Gated U-Net for High-Quality Document Binarization
## 1 Introduction
GANs have been successfully applied to image-to-image tasks to generate clean, binarized document images from their degraded counterparts [15; 16; 17; 18]. [PERSON] et al. [17] succeeded in removing watermarks and blur using a conditional GAN architecture. Also, a two-stage GAN architecture involving document image enhancement and binarization has been proposed [18]. These deep learning-based approaches have overcome the limitations of traditional binarization algorithms and exhibited improvements in text-region preservation. Nonetheless, these methods still face the challenge of extracting intricate text strokes from non-uniform and complex degradation, occasionally encountering mode collapse [19], which hampers performance due to a focus on specific data distributions. Specifically, these methods are robust against trained noise but do not perform well against untrained noise. To address the aforementioned issues, we propose an innovative approach to document binarization using a diffusion-denoising process combined with a gated U-Net. Our model transmits the probability of the text region as it passes through the layers of the gated U-Net, ultimately generating high-quality binarized document images through an iterative diffusion-denoising process. We present a document binarization model based on the latent diffusion model (LDM) [20], conceptualizing document binarization as an iterative diffusion-denoising process, as shown in Figure 3. In essence, this process generates a clean, binarized document image by progressively eliminating Gaussian noise with each time step. To achieve this, we use the diffusion model in [21], which has proven effective in image-generation tasks. The model operates by introducing and removing Gaussian noise within an image, and it offers the advantage of reduced reliance on extensive training data, learning to remove noise by considering both data distribution and time steps. LDMs have further improved time efficiency and precision in image generation using the diffusion model within the latent space [20]. By applying an LDM to document binarization, we enhance the generalization capabilities against unseen noise and finely adjust the text-stroke features using the latent space. To the best of our knowledge, this is the first study to incorporate an LDM into document binarization. Moreover, we integrate a gated convolution into the model's backbone network to facilitate intricate text-stroke extraction. Gated convolutions have previously shown their effectiveness in binary mask learning within segmentation models [22]. In our study, the gated convolution proves adept at distinguishing between text and background regions by jointly training features through original convolution and gating values, which encode text-region information. We use the gated convolution within the latent space rather than in the pixel space, allowing the proposed model to extract even more detailed text strokes. To demonstrate the effectiveness of our proposed model, we conduct experiments using the Handwritten Document Image Binarization Contest (H-DIBCO) and Document Image Binarization Contest (DIBCO) datasets [23; 24; 25; 26]. Our evaluation employs the four most commonly used metrics in document binarization, and the proposed model outperforms existing state-of-the-art methods in all metrics. In summary, our study makes three significant contributions:  
* We propose a novel approach by redefining document binarization as an iterative diffusion-denoising problem for degraded document images. This is the first study to incorporate an LDM into document binarization to generate high-quality, clean, binarized document images. We use a gated convolution in the latent space for the precise extraction of text strokes. This approach simplifies the differentiation between the text and the background by continually updating the gating value as a guide for delineating the text region. The proposed model produces high-quality, clean, binarized document images and outperforms existing methods on multiple H-DIBCO datasets.