# Task-Driven Real-World Super-Resolution of Document Scans
## 1 Introduction  
Limited spatial resolution of scanned documents often poses a substantial challenge for optical character recognition (OCR) systems, in particular when input images suffer from the noise and other distortions [1] that result from sensor limitations, compression artifacts, motion blur, or suboptimal lighting conditions. In order to allow for the effective processing of low-resolution (LR) scans with existing OCR systems, their quality can be enhanced with super-resolution (SR) techniques. They operate either from a single image [2, 3] or multiple observations of the same scene [4, 5]. The state-of-the-art single-image SR (SISR) approaches have been underpinned with deep learning, since [PERSON] et al. proposed the first convolutional neural network (CNN) for SR (SRCNN) [6]. It was followedby more advanced solutions, including fast SRCNN (FSRCNN) [7], a very deep SR network (VDSR) [8], and a residual SR network (SRResNet) [9] that was trained within a generative adversarial network (GAN) setting. These techniques, as well as recently developed solutions [2], demonstrate impressive performance on simulated benchmarks, with LR images obtained from original images that are later treated as HR references during training and validation. However, as noted by [PERSON] et al. [10], these models often fail to generalize to real-world data where degradation is neither uniform nor well modeled by the kernels used for downsampling. This gave rise to real-world SR that is aimed at super-resolving original rather than simulated images [11]. While such techniques consist in exploiting real-world datasets, they are rarely validated in task-specific scenarios [12]. To address these limitations, we propose a task-driven SISR framework designed specifically for text document images. Our approach shifts the training objective from pure image fidelity--commonly expressed with peak signal-to-noise ratio (PSNR)--to task-oriented performance. We introduce additional loss function components derived from pretrained semantic models into our training framework: (_i_) text detection components based on connectionist text proposal network (CTPN) [13], which encourage reconstruction of text-presence features; (_ii_) a loss derived from intermediate activations of a pretrained convolutional recurrent neural network (CRNN) [14; 15], promoting character recognition; (_iii_) a keypoint alignment loss using the Key.Net detector [16], which enhances structural consistency between the output and ground truth; and (_iv_) a color consistency loss based on the hue component of the hue-saturation-value (HSV) color space that helps maintain chromatic coherence without distorting tonal relationships. These complementary objectives are integrated into a unified multi-task loss function. A major challenge in such multi-objective optimization is determining appropriate weights for each task, taking into account that static weights may lead to unstable convergence or underfitting. To overcome this problem, we employ dynamic weight averaging (DWA) [17], which automatically adjusts task weights during training based on their relative learning dynamics. This encourages balanced training and ensures that no single loss component dominates the remaining ones. The research reported in this paper was aimed at verifying whether including the task-oriented loss function components contributes to finding more valuable regions of the real-world SR solution space than relying on conventional loss functions underpinned with pixel-wise image fidelity. Therefore, we have designed a comprehensive experimental setup involving real and simulated LR-HR document pairs. Real-world scans are acquired using a controlled multi-resolution acquisition procedure, while simulated pairs are generated through standard downsampling. We demonstrate that our task-driven training framework improves text detection performance measured with the intersection over union (IoU) metric, in particular for real-world scans.