arXiv:2609.07159cs.CVSep 2026

Manuscript Offprint

arXiv:2609.07159

Unsupervised Domain Adaptation for Symbol Spotting in Historical Encrypted Manuscripts

Giuseppe De Gregorio, Alicia Fornés, Lei Kang, Beáta Megyesi

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Giuseppe De Gregorio¹[0000-0002-8195-4118], Alicia Fornés¹[0000-0002-9692-5336], and Lei Kang¹[0000-0002-1962-3916] Beáta Megyesi²[0000-0002-4838-6518]

¹ Computer Vision Center (CVC), Universitat Autònoma de Barcelona, Spain {gdegregorio,afornes,lkang}@cvc.uab.cat ² Stockholm University, Sweden beata.megyesi@ling.su.se

Abstract. The decipherment of historical encrypted manuscripts poses a fundamental challenge in Digital Humanities: before any transcription can begin, the symbol inventory of the underlying cipher alphabet must first be identified and characterized. We address this challenge through symbol spotting: given a candidate alphabet specified as a set of rendered font glyphs, the task is to determine whether and where its characters appear in an unseen handwritten document, without any labeled examples from the target script. The main difficulty lies in the domain gap between clean, digitally rendered font queries and degraded handwritten manuscript symbols. We propose a three-stage pipeline that bridges this gap without manual annotation, combining a joint SimCLR+DANN encoder for domain-invariant glyph representations with an embedding-space style-adaptation mechanism applied at retrieval time, requiring no re-training. Experiments on fourteen pages from seven encrypted manuscript collections show that our method outperforms zero-shot foundation models, including CLIP and DINOv2, by a large margin (+0.194 P@1 over CLIP ViT-L/14), and surpasses task-specific trained baselines by +0.138 P@1. We further demonstrate that the Raw-Cover metric, computed in a fully unsupervised setting, provides a meaningful script-family fingerprint that identifies the underlying alphabet of an unknown document. This capability is of direct practical relevance to palaeographers, historians, and other researchers working with undeciphered manuscripts.

Keywords: Symbol Spotting · Historical Manuscripts · Domain Adaptation · Contrastive Learning · Zero-Shot Retrieval

1 Introduction

Recent progress in handwritten text recognition has substantially improved access to historical manuscripts written in known scripts and languages, particularly when sufficient annotated training data is available. In contrast, documents written in non-standard, rare, undeciphered, or otherwise unknown scripts

The code is publicly available at https://github.com/giuseppedeg/symbol-spotting-encrypted-manuscripts remain largely beyond the reach of standard computational approaches, since both labelled data and prior knowledge of the underlying symbol system may be limited or absent. The DECODE database [5, 8] has archived hundreds of such manuscripts, spanning cipher alphabets, personal notations, and invented writing systems whose interpretation remains unresolved. These sources raise methodological questions that differ from those addressed by conventional recognition pipelines, as they require methods capable of operating under conditions of extreme data scarcity and uncertain script structure.

A fundamental prerequisite for deciphering such documents is symbol spotting: given a set of candidate symbols, determining whether and where they appear in the manuscript. In the simplest case, this is a same-domain problem. The candidate symbols and the manuscript symbols share the same visual characteristics, and the task reduces to template matching or learned similarity. However, the definition of the candidate symbol set is itself a non-trivial challenge when the underlying script is unknown or only partially understood. A natural strategy is to query the manuscript against known alphabets (Greek, Latin, Runic, or other historically attested scripts) and use the retrieval signal to identify which character families are present. The most readily available source of such candidate symbols is the digital Unicode standard, for which high-quality fonts exist that can render any registered character as a clean glyph image. This approach is practical and requires no manual annotation, but it introduces a fundamental asymmetry: the query symbols are clean, regularly spaced, digitally rendered glyphs, while the gallery symbols are extracted from degraded, handwritten pages with variable ink, noise, and stroke irregularities. The problem therefore becomes inherently cross-domain, and it is this domain gap between font-rendered queries and manuscript-extracted gallery symbols that is the central challenge we address.

Existing approaches to word and symbol spotting in historical documents broadly fall into two categories. Training-based methods [13, 6, 15] achieve strong results but require labelled examples from the target manuscript, a condition rarely met for encrypted scripts. Zero-shot methods based on large vision-language models such as CLIP [10] or self-supervised transformers such as DINOv2 [9] offer an appealing alternative, but as we demonstrate empirically, their patch-based architectures are poorly suited to the retrieval of isolated glyphs at the small resolutions typical of symbol crops. We propose a three-stage pipeline that bridges this gap without requiring any labelled manuscript data. First, individual glyphs are extracted from manuscript pages, and candidate alphabet symbols are rendered from fonts that approximate historical handwriting styles. Second, a joint DANN+SimCLR encoder is trained to produce domain-invariant embeddings: a contrastive objective [1] encourages structurally similar symbols to cluster together, while a domain adversarial network with gradient reversal [3] penalises features that betray their domain of origin. Third, at retrieval time, a lightweight embedding-space style adaptation shifts each font query towards the local style manifold of the target document, further closing the residual domain gap without any re-training. Our contributions are as follows:

– We frame zero-shot symbol spotting in encrypted manuscripts as a cross-domain retrieval problem and propose a unified pipeline addressing all three stages: extraction, representation, and retrieval.

– We introduce an embedding-space style adaptation mechanism that operates on-the-fly at inference time and consistently improves retrieval performance across all tested configurations.

– We provide an extensive empirical evaluation on fourteen pages from seven encrypted manuscript collections, comparing against zero-shot baselines and task-specific trained models, and conduct a thorough ablation study isolating the contribution of each component.

– We demonstrate that Raw-Cover@k, computed in a fully unsupervised setting, can serve as a script signature for identifying the underlying alphabet family of an unknown document.