NAF-DPM: A Nonlinear Activation-Free Diffusion Probabilistic Model for Document Enhancement
Giordano Cicchetti, Danilo Comminiello
TL;DR
NAF-DPM presents a fast, activation-free diffusion framework for document enhancement that targets deblurring and binarization. It integrates a lightweight NAFNet-based initial predictor with a conditional diffusion model that refines residual high-frequency details, and employs an ODE-based solver (dpmsolver) to achieve rapid sampling. An OCR-guided differentiable finetuning module (via a CRNN and CTC loss) further improves character fidelity, reducing OCR errors. Across DeblurringDataset and DIBCO benchmarks, NAF-DPM achieves state-of-the-art or competitive results in pixel-level and perceptual metrics while substantially reducing character errors in OCR outputs, demonstrating practical impact for real-world document preprocessing.
Abstract
Real-world documents may suffer various forms of degradation, often resulting in lower accuracy in optical character recognition (OCR) systems. Therefore, a crucial preprocessing step is essential to eliminate noise while preserving text and key features of documents. In this paper, we propose NAF-DPM, a novel generative framework based on a diffusion probabilistic model (DPM) designed to restore the original quality of degraded documents. While DPMs are recognized for their high-quality generated images, they are also known for their large inference time. To mitigate this problem we provide the DPM with an efficient nonlinear activation-free (NAF) network and we employ as a sampler a fast solver of ordinary differential equations, which can converge in a few iterations. To better preserve text characters, we introduce an additional differentiable module based on convolutional recurrent neural networks, simulating the behavior of an OCR system during training. Experiments conducted on various datasets showcase the superiority of our approach, achieving state-of-the-art performance in terms of pixel-level and perceptual similarity metrics. Furthermore, the results demonstrate a notable character error reduction made by OCR systems when transcribing real-world document images enhanced by our framework. Code and pre-trained models are available at https://github.com/ispamm/NAF-DPM.
