CoolFace
Modelpublic

storytracer/cuttlefisher

sourceHugging Facemitupdated 16d agoView on Hugging Face
0likes62downloads
Model Card

cuttlefisher — newspaper block and title detector (YOLO26)

Task: object detection of the layout blocks of a historical newspaper page, with the block classes needed to cut a page into articles — above all ARTICLE-TITLE.

The model is meant for the bottom-up article-segmentation pipeline of Mocaër et al. (ICDAR-HIP 2026): detect blocks and classes, order them, and start a new article at every title in reading order. It was trained for SquiddleOCR, which already has regions and reading order from eynollah and only lacks a reliable title class. Code, notes and full metrics: <https://github.com/storytracer/cuttlefisher>.

Files

filewhat
best.ptphase 1: yolo26m, imgsz 1280, trained on Teklia/Newspapers-finlam only (623 pages, 149 newspapers)
args.yamlthe ultralytics training arguments of best.pt
classes.txtclass names in id order
results_test.md / .jsonper-class P/R/AP50/AP50-95 on the FINLAM test split
article_rule_test.mdarticle-cut metric (see below)
phase2/best.ptphase 2: same architecture, trained on FINLAM (oversampled ×4) + the 7 957 La Liberté pages
phase2/args.yaml, phase2/results_test.*, phase2/article_rule_test.mdthe same for the phase-2 model

Which one? best.pt (phase 1) for the article cut: it has the best subtitle AP, the best article-rule score and the fewest spurious titles on the diverse test split. phase2/best.pt if you want the better generic layout classes (text, illustration, table: +0.02–0.07 AP50) and can live with weaker subtitles; its title detection is on par. Numbers for both are in the results section.

Usage

python
from huggingface_hub import hf_hub_download
from ultralytics import YOLO

model = YOLO(hf_hub_download("storytracer/cuttlefisher", "best.pt"))
results = model.predict("page.jpg", imgsz=1280, conf=0.35, max_det=600)

for box in results[0].boxes:
    print(model.names[int(box.cls)], box.conf.item(), box.xyxy[0].tolist())
  • —imgsz=1280: the model was trained at 1280; pages are ~2000 px high in the training data and title boxes are one line each (median 14 px tall at 2000 px), so do not go smaller.
  • —conf=0.35 balances title precision and recall (P 0.88 / R 0.77 on val). Use 0.15–0.25 if a missed headline line costs more than a spurious title.
  • —max_det=600: dense pages carry up to 500 blocks; the ultralytics default of 300 caps recall.
  • —iou has no effect: YOLO26 is end-to-end (NMS-free).
  • —Plain .pt, no exotic export; runs on any ultralytics ≥ 8.4 with a CUDA or CPU torch.

Classes (13, id order)

0  HEADER-TITLE            8  ARTICLE-INSIDEHEADING
1  HEADER-TEXT             9  CAPTION
2  ARTICLE-ILLUSTRATION   10  AUTHOR
3  ADVERTISEMENT          11  ARTICLE-TABLE
4  ANNOUNCEMENT           12  SECTION-TITLE
5  ARTICLE-TITLE
6  ARTICLE-TEXT
7  ARTICLE-SUBTITLE

Annotation granularity of the training data: text is one box per paragraph block; titles, subtitles and inside-headings are one box per line. SECTION-TITLE has no instances in the phase-1 training data (it only occurs in La Liberté), so the phase-1 model never predicts it. ADVERTISEMENT has 35 training instances and is unreliable.

Training data

Both datasets are from the Teklia / LITIS FINLAM project, MIT licence:

  • —Teklia/Newspapers-finlam — 721 pages (623 / 50 / 48) from 149 French and English newspapers, 19th–20th century, images 2000 px high, 13 classes. Phase 1 trains on this only.
  • —Teklia/Newspapers-finlam-La-Liberte — 8,836 pages of La Liberté (1925–1928), 16 classes mapped onto the 13 above. Phase 2.

Training recipe (phase 1, best.pt)

  • —yolo26m.pt (COCO pretrained), ultralytics 8.4.146, torch 2.14 + cu126
  • —imgsz 1280, batch 32 on 4 × RTX A6000 (8 per GPU, ~20 steps per epoch), epochs 150 with coslr, patience 30 (best at epoch 78, stopped at 108), cache=ram, maxdet 600, default augmentation. 24 minutes.
  • —Also tried: yolo26s (−0.04 title mAP50), imgsz 1024 (tie on titles, worse overall), the full 150-epoch cosine schedule without early stopping and yolo26l (both slightly better mAP50-95, worse on the title classes). Exact numbers in the repository's NOTES.md.

Results on the diverse FINLAM test split (48 pages, 11 035 boxes)

conf 0.001, max_det 600, single GPU

classinstancesPRAP50AP50-95
ARTICLE-TITLE10650.7470.7980.7950.675
ARTICLE-SUBTITLE3500.6200.7260.6580.517
ARTICLE-INSIDEHEADING2050.4690.7170.5570.454
SECTION-TITLE0––––
HEADER-TITLE100.9070.9820.9770.570
HEADER-TEXT1110.5550.5400.4610.318
ARTICLE-ILLUSTRATION1480.7840.8590.8540.709
ADVERTISEMENT11.0000.0000.0000.000
ANNOUNCEMENT560.5310.3570.3450.246
ARTICLE-TEXT85040.8140.7760.8110.654
CAPTION700.7600.6350.6640.460
AUTHOR490.7360.4680.5190.405
ARTICLE-TABLE4660.5100.2550.3030.144
all (12 classes)110350.7030.5930.5790.429
title classes (3)0.670

Article rule. Taking the ground-truth zones in ground-truth reading order, giving each zone the class of its best-overlapping prediction (IoU ≥ 0.5) and starting a new article at every run of title zones, pairwise same-article F1 is 0.584 with predicted classes against 0.633 with ground-truth classes — the detector costs 0.05 F1; the ceiling is low because many FINLAM articles have no title or several. Zone-level title F1 is 0.805 (P 0.85, R 0.76).

The paper reports 72.3 mAP50 on La Liberté (one newspaper, 8k training pages); the numbers above are on a 149-newspaper test set and are not comparable.

Phase 2 (phase2/best.pt) on the same test split

Trained on FINLAM (listed 4×) + La Liberté train (7 957 pages), 40 epochs, patience 10, otherwise the phase-1 recipe. La Liberté's released annotations populate only 9 of its 16 classes (no SECTION-TITLE, ADVERTISEMENT, ANNOUNCEMENT, CAPTION, AUTHOR) and label advertisements as text.

phase 1 `best.pt`phase 2 `phase2/best.pt`
mAP50 / mAP50-95 (12 classes)0.579 / 0.4290.585 / 0.456
title classes mAP500.6700.642
ARTICLE-TITLE AP500.7950.783
ARTICLE-SUBTITLE AP500.6580.553
ARTICLE-INSIDEHEADING AP500.5570.589
ARTICLE-TEXT / ILLUSTRATION / TABLE AP500.811 / 0.854 / 0.3030.835 / 0.876 / 0.372
CAPTION / ANNOUNCEMENT / AUTHOR AP500.664 / 0.345 / 0.5190.699 / 0.382 / 0.525
article rule pairwise F1 (ceiling 0.633)0.5840.527
zone-level title P / R0.851 / 0.7630.833 / 0.782

The extra 8 000 single-newspaper pages improve the generic layout classes but not the title classes on the diverse test set, and the article cut gets worse because of more spurious titles. Full details, including the plain-concatenation variant, in the repository's deliver/metrics.md.

Citation

bibtex
@inproceedings{mocaer2026hierarchical,
  title     = {Towards Hierarchical Structure Understanding of Newspaper Images},
  author    = {Moca{\"e}r, William and Tarride, Sol{\`e}ne and Constum, Thomas and Agbeti-Messan, Merveilles and Simon, Tom and Chatelain, Cl{\'e}ment and Nicolas, St{\'e}phane and Tranouez, Pierrick and Cretin, S{\'e}bastien},
  booktitle = {ICDAR Workshop on Historical Document Imaging and Processing (HIP)},
  year      = {2026},
  note      = {arXiv:2607.15082}
}

Datasets: Teklia / LITIS, FINLAM project, <https://finlam.projets.litislab.fr/>, MIT licence.