Contrastive-to-Self-Supervised: A Two-Stage Framework for Script Similarity Learning
Authors: Claire Roman, Philippe Meyer
Organizations: University of Haute Alsace, IRIMAS UR 7499, Mulhouse, France · Université Paris-Saclay, INRAE, AgroParisTech, Micalis Institute, Jouy-en-Josas, France
Learning similarity metrics for glyphs and writing systems faces a fundamental challenge: while individual graphemes within invented alphabets can be reliably labeled, the historical relationships between different scripts remain uncertain and contested. We propose a two-stage framework that addresses this epistemological constraint. First, we train an encoder with contrastive loss on labeled invented alphabets, establishing a teacher model with robust discriminative features. Second, we extend to historically attested scripts through teacher-student distillation, where the student learns unsupervised representations guided by the teacher's knowledge but free to discover latent cross-script similarities. The asymmetric setup enables the student to learn deformation-invariant embeddings while inheriting discriminative structure from clean examples. Our approach bridges supervised contrastive learning and unsupervised discovery, enabling both hard boundaries between distinct systems and soft similarities reflecting potential historical influences. Experiments on diverse writing systems demonstrate effective few-shot glyph recognition and meaningful script clustering without requiring ground-truth evolutionary relationships.
Figures & tables
Figure 1: Two-stage framework. Stage 1: train a teacher encoder fϕ∗ with supervised contrastive learning (SupCon) on labeled invented scripts, yielding a discriminative embedding space. Stage 2: adapt to unlabeled historical scripts via teacher-initialized BYOL: a student fθ with predictor qθ matches a momentum (EMA) target network fξ on two augmented views, using stop-gradient, and without cross-script negatives.
Figure 2: Datasets used in this work. Omniglot is split into supervised (invented alphabets for Stage 1), unsupervised (historical scripts for Stage 2), and evaluation sets. A complementary Unicode character dataset is generated using Noto fonts. Augmented instances per glyph are obtained through random transformations (red boxes).
Backbone
Params
Method
Teacher Type
N20R1
N20R5
NDCG10
Spearman
Simple CNN
2.3M
SupCon
-
85.5
98.75
0.2781
0.548
BYOL
EMA
43.5
83.75
0.1932
0.545
Barlow Twins
-
77.75
97.75
0.2281
0.639
Ours (Target)
SupCon→EMA
88
98.75
0.2930
0.640
Ours (Student)
SupCon→EMA
88
98.75
0.2930
0.639
Siamese CNN
8.7M
SupCon
-
86.75
99.5
0.3011
0.631
Table 1: Comparison of backbone architectures and training strategies on glyph- and script-level evaluation. We report 20-way 1-shot retrieval accuracy (N20R1/N20R5), script-level ranking quality (NDCG@10), and Spearman correlation with curated linguistic similarity levels. “Teacher Type” indicates whether an EMA teacher is used; here, the teacher is obtained by supervised contrastive pretraining followed by EMA self-distillation (SupCon → EMA). Best results are in bold , second best are underlined .
Figure 3: Two-dimensional t-SNE projections [ 22 ] of glyph embeddings for the CJK, Greek and Latin scripts, shown on the left using the teacher model fϕ∗ and on the right the student model fθ . Points correspond to glyph instances; colors/markers indicate script labels. The reported R denotes the separability ratio ( 10 ), illustrating how improved representation geometry yields more coherent cross-script structure.
Athens University of Economics and Business, Greece · Archimedes, Athena Research Center, Greece · Department of Computer and Systems Sciences, Stockholm University, Sweden +5