Graph-Based Aggregation for Writer Identification and Retrieval

Oliver Pilizar, Marco Peer, Florian KleberarXiv 2026 · DOI

TL;DR

Recognizing who wrote a handwritten page is nearly a solved problem for modern AI, yet performance craters when only a single line or word is available. This paper swaps out blunt feature-averaging techniques for Graph Neural Networks (GNNs) that wire local ink strokes into spatial webs. By explicitly mapping how handwriting features relate to their neighbors, the model preserves subtle stylistic quirks and beats state-of-the-art methods when working with sparse data.

What Problem Does This Paper Address?

Imagine trying to match an anonymous medieval scroll or a forensic ransom note to a known author—tasks known respectively as Writer Identification (WI) (assigning an author) and Writer Retrieval (WR) (finding other texts by the same hand).

When algorithms have a full page of text to inspect, they achieve near-perfect retrieval scores (92–97% mean Average Precision, or mAP). Give them just a single line, however, and performance drops to 47–75%; hand them a single word, and it collapses to 3–14%.

Why the steep drop-off? Standard pipelines extract hundreds of tiny visual descriptors from the ink strokes and squash them into a single summary vector using basic math like mean or sum pooling. Averaging works fine when you have a page's worth of statistical redundancy, but on a short line of text, it washes out the delicate, fine-grained spatial quirks that give a writer away. Even previous attempts at "smart" learned aggregators (like Transformers) struggled to beat simple mean pooling because they didn't explicitly capture spatial geometry.

Methods

Instead of throwing local handwriting features into a blender, the authors connect them into a graph and let a Graph Neural Network (GNN) learn how to aggregate them.

First comes hybrid feature extraction ( standard tools combined in a unified node):

  1. Keypoints & Patches: They find SIFT keypoints right along the handwriting strokes and crop $32 \times 32$ pixel image patches around them.
  2. Visual & Textual Vectors: Each node can hold a mix of up to four ingredients: SIFT descriptors (S), $(x,y)$ keypoint coordinates (K), visual embeddings from a ResNet-20 CNN trained on those $32 \times 32$ patches (P), and fastText word embeddings of the ground-truth text plus a language tag (W).
Contours of 32x32 image patches centered on SIFT keypoints along the handwriting strokes.

Next comes graph construction—the core novelty. How should nodes within and across words be wired together? The authors test three strategies:

  • Full: Every node in a word connects to every other node in that word.
  • KNN: Nodes connect only to their $k=4$ nearest spatial neighbors within a word, forming natural local clusters.
  • 1Line: Starting from the top-left, a single continuous thread iteratively links each node to its closest unconnected neighbor, creating a sparse, repeatable path across the word. (In all three modes, consecutive words are linked at their outer boundaries.)
Fig. 2: Line-level depiction of the three connection modes: (a) Full, (b) KNN, (c) 1Line. Orange edges indicate connections between different words.

Finally, these graphs pass through configurable GNN convolutional layers—testing GCN, GAT, GATv2, GraphSAGE, and GIN (Graph Isomorphism Network)—before a global mean pooling layer outputs a final representation for classification (WI) or Euclidean distance comparison (WR).

Datasets

  • CVL Dataset: Contains handwritten texts from 310 writers (English and German). The standard 283-writer test set is used for line- and page-level Writer Retrieval. To evaluate Writer Identification without data leakage, the 27-writer training set is split 70%/15%/15% into train/validation/test subsets per author.
  • IAM Dataset: Contains texts from 657 writers. Rather than being fed into the GNN directly, IAM is used to pre-train the ResNet-20 patch extractor during WI experiments so the CNN never sees the test writers ahead of time.
  • No new benchmarks are introduced.

Key Insights and Ideas

  • Less is more when wiring graphs: In retrieval, the dense Full graph drops mAP by ~15–17 percentage points compared to KNN and 1Line. When everything connects to everything, local structural signals get muddied; sparse, spatially grounded paths (1Line) give the GNN clear geometric structure to work with.
  • Raw coordinates hurt, visual patches rule: CNN patch embeddings (P) do the heavy lifting. Surprisingly, appending raw $(x,y)$ SIFT coordinates (K) consistently degrades retrieval accuracy, likely injecting noisy position bias rather than transferable style cues.
  • Discriminative power beats attention: While attention-based GNNs (GAT, GATv2) seem intuitively ideal for spotting rare handwriting quirks, GIN—an architecture mathematically designed to maximize structural discrimination—handily outperforms every other layer type.
  • GNNs shine in low-data regimes: When plotted against existing state-of-the-art methods (like ResNet20 + NetVLAD), the GNN approach wins out when fewer feature points (~250 per line) are extracted, proving its ability to squeeze more signal out of scarce ink.

Key Results

  • Line-Level Writer Retrieval (CVL): Moving from standard GCN (53.69% mAP) to GIN jumps baseline performance to 60.24% mAP. Scaling up the GIN hidden dimensions (to 512/1024) with a tuned learning rate (0.0001) using only CNN patch embeddings (P) and 1Line edges reaches a mean of 65.14% mAP (peaking at 66.58% mAP) and 94.57% Top-1 accuracy—beating ResNet20+NetVLAD at ~250 features per line.
  • Line-Level Writer Identification (CVL): GNNs near perfection here. GIN hits 99.6% test accuracy, and CNN patches (P or SP) reach 99.26%, largely indifferent to how the graph edges are wired.
  • Document-Level Retrieval (CVL): Wiring whole pages as one long line improves GNN performance over single lines (hitting 79.36% mAP with SP), though it trails specialized page-level state-of-the-art (~96–97% mAP).

Limitations and Future Work

  • Page-level gap & sample scarcity: Because CVL only provides 7 training pages per author, document-level GNN training suffers from small sample sizes and doesn't match top pooling-based page-level benchmarks.
  • Feature count scaling: When extraction is cranked up beyond 500–1,000 feature points per line, traditional NetVLAD pooling eventually overtakes the GNN's retrieval mAP.
  • Reliance on word ground-truths: Configurations using fastText word embeddings (W) require transcription ground truths and language IDs—though notably, the best custom model (P) didn't need them at all.
  • Future directions: The authors suggest compressing high-dimensional node features via PCA, extracting denser keypoints, adding weighted edges, and building hierarchical, multi-level graphs that bridge word, line, and page structures simultaneously.

Summary updated

BibTeX
@misc{pilizar2026graph,
  author = {Oliver Pilizar and Marco Peer and Florian Kleber},
  title = {{Graph-Based Aggregation for Writer Identification and Retrieval}},
  year = {2026},
  eprint = {2611.37481},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.37481},
}
Figure