DeepEllipse + AY — CircleID Open-Set Writer Identification
Official reproduction package for the paper:
DeepEllipse: Geometric–Time-Frequency Representation with Batch-Affinity Reasoning for Open-Set Writer Identification of Hand-Drawn Circles (IEEE TIFS under review, ICDAR 2026 CircleID)
This package contains the released checkpoints of the paper's best system
(DeepEllipse + AY, Private ACC 67.9%), the inference code
(code/ + reproduce_best_ay.py) that regenerates the submission CSVs from the
released intermediates, and the submission CSVs themselves. No training code and
no third-party baseline implementations are included.
Expected scores (Private / Public)
| Setting | Private ACC | Public ACC | Source |
|---|---|---|---|
| DeepEllipse + AY (k=2, h=5, λ=0.5, r=65%) | 67.9% | 62.15% | Main Table IV / Fig. 6–9 |
| DeepEllipse (Y-only, r=65%) | 54.1% | — | Main Table IV |
| ResNet-18 RGB (k45, r=65%) | 48.7% | — | Suppl. Table VIII |
All numbers are single-run readings on the Kaggle CircleID Private leaderboard.
Two routes to A (--ay-from)
reproduce_best_ay.py offers two ways of obtaining the style-affinity adjacency
A, selectable with --ay-from:
--ay-from |
What it does | Requires | Label agreement with reference_submission.csv |
|---|---|---|---|
f_ellipse (default) |
runs the released affinity head over the released f_ellipse features |
CPU only, no images | 100.0000% (5,905 / 5,905) |
model |
re-derives f_ellipse from the raw test images using the frozen DeepEllipse backbone (including the GCC-φ-Pyramid module) |
CUDA GPU + test feature cache | 100.0000% (5,905 / 5,905) |
Both routes load the full backbone plus the GCC-φ-Pyramid (869 tensors matched;
the 104 standalone phi_transformers keys are unused while gcc_enabled=True)
and are checked as a hard gate against reference_submission.csv. Use f_ellipse for a CPU-only run; use model to
drive the pipeline from images. The GCC source lives in
code/gcc_phi_pyramid.py and is wired from code/section43_v3_1.py.
Files
| File | Size | Description |
|---|---|---|
deepellipse.pth |
274 MB | DeepEllipse backbone. Contains both the GCC-φ-Pyramid (enc43.segment_pool.gcc.*) and the standalone phi_transformers branch selected by --paper-679. |
resnet_rgb.pth |
135 MB | ResNet-18 point-feature extractor used inside DeepEllipse, plus the standalone RGB baseline head (k45). |
bce_head.pth |
7.9 MB | Style-affinity BCE head (pkmix, ep20) producing the adjacency A. |
deep_ellipse_logits.json |
6.0 MB | Released Y logits for all 5,905 test images. |
resnet_test_logits.json |
5.6 MB | Released ResNet-18 RGB test logits (k45) for the baseline CSV. |
f_ellipse_test_k45.npz |
22.9 MB | Released f_ellipse features (input to the affinity head); enables the exact CPU-only route. |
class_names_45.json |
406 B | The 45 LabelEncoder slots: ['-1', 'W01', ..., 'W51']. |
reference_submission.csv |
228 KB | Official submission used as the reproduction reference. |
deepellipse_y_only_r65_submit.csv |
228 KB | Released submission: DeepEllipse Y-only (Private 54.1%). |
sample_submission.csv |
156 KB | Kaggle submission format template. |
test_with_pen.csv |
508 KB | Test split manifest (image id → path / pen id), a copy of data_split/test_with_pen.csv. |
reproduce_best_ay.py |
13 KB | Self-contained inference script (see below). |
code/ |
— | Inference modules: model definition (incl. gcc_phi_pyramid.py), feature pipeline, ay_infer.py (graph refinement + Top-K/r rejection), ay_bce_head.py, and infer_helpers.py (checkpoint-architecture resolution, loading and feature extraction). |
precompute_val_test.sh |
1 KB | Rebuilds the test-side feature cache from raw images (only needed for --ay-from model). |
requirements.txt |
300 B | Python dependencies. |
Data
The CircleID competition data (scanned hand-drawn circle images) must be downloaded from Kaggle:
kaggle competitions download -c icdar-2026-circleid-writer-identification
The default --ay-from f_ellipse route needs no images and no cache — every
input it consumes is in this folder. Only --ay-from model additionally needs:
- the test images (extracted into a dataset directory), and
- the test-side feature cache (no augmentation, one variant per image):
export CIRCLE_IMAGE_ROOT=/path/to/original_data/
FEA_CACHE_ROOT=/path/to/circle_id_fea_cache bash precompute_val_test.sh
Reproduce the official submission
CPU-only, exact route (default):
python reproduce_best_ay.py --out ./outputs
Full pipeline from raw images (--ay-from model needs a CUDA GPU):
export CIRCLE_FEA_CACHE=/path/to/circle_id_fea_cache
export CIRCLE_IMAGE_ROOT=/path/to/original_data/
python reproduce_best_ay.py --ay-from model --test-csv test_with_pen.csv --out ./outputs
Recompute class logits Y with the frozen CE head (instead of the released JSON):
python reproduce_best_ay.py --ay-from model --y-from model --device cuda:0 --out ./outputs
With the GCC-φ-Pyramid module enabled (the default route above), CE-recomputed
Y matches the released JSON to floating-point noise (argmax identical; Y-only
submit 100%).
Advanced path (--paper-679)
This is an optional legacy reproduction route: the mainline result above already reproduces the released labels with GCC enabled, and the section below documents the alternate forward used in an earlier version of the pipeline.
The single released backbone deepellipse.pth carries both
weight sets:
enc43.segment_pool.gcc.*— the trained GCC-φ-Pyramid (BU/TD gates, DW convs,gcc.phi_tx.*); used whengcc_enabled=True(the default routes above).enc43.segment_pool.phi_transformers.*— the standalone per-stage SelfAttn@φ branch used by the paper's headline AY number; used only whengcc_enabled=False.
--paper-679 selects the second forward (gcc_enabled=False) and forces
--ay-from model / --y-from model unless you override them:
python reproduce_best_ay.py --paper-679 --device cuda:0 --out ./outputs_paper679
Result on the test split: best_ay_k2_h5_a05_r65_submit.csv reproduces the
released reference labels exactly (0 differing labels), and Y recomputed by
the CE head is within ~25 labels of the released JSON on the Y-only submit —
the graph diffusion in AY absorbs those into the same AY labels.
In this mode the GCC weights stay in the checkpoint but are not used; nothing needs to be deleted or merged separately.
All defaults point at files in this folder, so no other flags are required.
The script:
- Loads the released checkpoints and the released
Ylogits. - Builds the adjacency
A = sigmoid(eta * a~)witha~ = 2*((u+1)/2)^3 - 1from the L2-normalized embeddingsu, then appliesA' = max(0, A - 0.5)(diagonal kept),A_norm = row-normalize (A')^2, andY* = A_norm^5 · Y(k = 2, h = 5, λ = 0.5). At λ = 0.5 this shift is exactly a cosine threshold:A > 0.5 ⇔ u > 2^(2/3) - 1 = 0.587401, which the script re-checks against the releasedetaon every run. - Applies Top-K/r rejection (
r = 65%, logit score) and writes three CSVs:
| Output | Description | Expected Private |
|---|---|---|
best_ay_k2_h5_a05_r65_submit.csv |
DeepEllipse + AY (main result) | 67.9% |
deepellipse_y_only_r65_submit.csv |
DeepEllipse Y-only | 54.1% |
resnet_rgb_k45_r65_submit.csv |
ResNet-18 RGB k45 baseline | 48.7% |
- Verifies
best_ay_k2_h5_a05_r65_submit.csvagainstreference_submission.csv(hard gate, ≥ 99.8% agreement; both routes match exactly in this release).
Submit to Kaggle
kaggle competitions submit \
-c icdar-2026-circleid-writer-identification \
-f outputs/best_ay_k2_h5_a05_r65_submit.csv \
-m "DeepEllipse+AY k=2 h=5 lambda=0.5 r=65 (67.9%)"
Package layout
The package is self-contained:
- The top-level artifacts: the three checkpoints, the released
Ylogits, the releasedf_ellipsefeatures, the class-name list, the test manifest, the reference and sample submissions,reproduce_best_ay.py,precompute_val_test.sh,requirements.txt, theLICENSEand this README. code/-- 23 Python modules plustest_color_sta.json; every module is a transitive dependency ofreproduce_best_ay.py(checked by import-graph reachability).outputs/-- the default--outtarget; its AY submit matchesreference_submission.csvexactly (0 / 5905 differing labels).
Citation
@article{deepellipse,
author = {Qin, Xunhui and others},
title = {DeepEllipse: Geometric--Time-Frequency Representation with Batch-Affinity
Reasoning for Open-Set Writer Identification of Hand-Drawn Circles},
journal = {IEEE Transactions on Information Forensics and Security},
year = {2026},
note = {under review}
}
License
This package is released under CC BY-NC 4.0 for research use.