cs.CVOct 16, 2026

Generative Text Modelling and Language-Guided Visual Attention for Deciphering Palimpsests

Authors: Robin Hollifeldt, Tianru Zhang, Jessica Ström, Ekta Vats

Organizations: Uppsala University, Uppsala, Sweden

Abstract

Recovering obscured text in palimpsests, i.e. the manuscripts where the original writing (under-text) was erased and overwritten for reuse, is vital for preserving lost information. Due to the nature of the material, such a task can be highly challenging and time-consuming. This paper presents an approach towards automated palimpsest handwritten text modeling for under-text recovery. We investigate generative models, including Generative Adversarial Networks (GANs) and diffusion models, and design a custom denoising diffusion model that learns structured noise patterns to reconstruct the under-text. The recovered text is subsequently processed by a fine-tuned, attention-based handwritten text recognition network. Furthermore, we investigate a language-guided recognition framework that leverages textual class descriptions as informative priors, enabling the text recognition model to distinguish meaningful features from noise. This is achieved by grounding task-specific descriptions, phrased in words or sentences, through visual attention maps generated by pretrained vision-language models like CLIP (Contrastive Language-Image Pre-training). To facilitate future research and benchmarking, we release new datasets for synthetic palimpsests (currently scarce), CLIP-compatible text descriptions, and pre-trained models with code.

Figures & tables

Explore similar work

Aug 28, 2026

Text Restoration of Ancient Documents with Language Models

Purpose - This study investigates the feasibility of restoring missing text caused by physical lacunae in damaged ancient manuscripts using language models. Methodology - The study proposes different scenarios to replicate real-world conditions. Language models of different architectures are applied according to their suitability to each scenario. We also propose several decoding strategies that further enhance performance and address the discrepancy between lacuna boundaries and the models' tokenization schemes. Findings - The results reveal that text restoration of these documents cannot be fully automated, but it can serve as a useful tool to assist paleographers in their work. Model performance varies greatly depending on which structural part of the document needs to be restored and whether the character length of missing text is available. Originality - This is the first study and to analyze model performance on formulaic and non-formulaic content and the impact of lacuna length awareness in manuscript restoration. Both are recurring challenges in paleographers' manual restoration work. Through systematic comparison and both qualitative and quantitative analysis of different models' performance under varying settings, this study offers a guideline for developing assistive tools to support paleographers.
Apr 11, 2026

DocRevive: A Unified Pipeline for Document Text Restoration

In Document Understanding, the challenge of reconstructing damaged, occluded, or incomplete text remains a critical yet unexplored problem. Subsequent document understanding tasks can benefit from a document reconstruction process. In response, this paper presents a novel unified pipeline combining state-of-the-art Optical Character Recognition (OCR), advanced image analysis, masked language modeling, and diffusion-based models to restore and reconstruct text while preserving visual integrity. We create a synthetic dataset of 30{,}078 degraded document images that simulates diverse document degradation scenarios, setting a benchmark for restoration tasks. Our pipeline detects and recognizes text, identifies degradation with an occlusion detector, and uses an inpainting model for semantically coherent reconstruction. A diffusion-based module seamlessly reintegrates text, matching font, size, and alignment. To evaluate restoration quality, we propose a Unified Context Similarity Metric (UCSM), incorporating edit, semantic, and length similarities with a contextual predictability measure that penalizes deviations when the correct text is contextually obvious. Our work advances document restoration, benefiting archival research and digital preservation while setting a new standard for text reconstruction. The OPRB dataset and code are available at Hugging Face and Github respectively.
Jul 10, 2026

TextileNet: Towards Zero-shot Text-style Segmentation of Manuscripts

Automatic writer identification systems have progressed remarkably in recent years, yet their deployment in archival paleography remains limited by the scarcity of labeled training data, open scribe sets, and degraded image quality. We present TextileNet, a fully convolutional multi-task network trained exclusively on synthetic data to produce dense pixel-level texture embeddings, which we transfer zeroshot to historical manuscript analysis. As an original contribution to evaluation methodology, we designed a paleographic visual quiz of 80 pair and triplet questions and administered it to a range from lay participants to senior paleographers under strict anonymity, establishing to our knowledge for the first time a human baseline for script-style discrimination on late medieval text. We employ TextileNet embeddings to perform zero-shot retrieval on sub-word granularity for hand and gender identification. Our experimental results help in building the credibility of TextileNet in the paleographic domain, but more than that demonstrate in experimental terms that the question of gender in handwriting needs to be treated with caution.