Cadmon commited on
Commit
6461bd0
Β·
verified Β·
1 Parent(s): 9f9f1b6

add README.md

Browse files
Files changed (1) hide show
  1. README.md +120 -0
README.md ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: pytorch
4
+ pipeline_tag: object-detection
5
+ tags:
6
+ - document-ai
7
+ - pdf
8
+ - acroform
9
+ - form-field-detection
10
+ - object-detection
11
+ - research
12
+ ---
13
+
14
+ # AcroMELD
15
+
16
+ πŸͺ„ **Turns a flat PDF into a fillable form.** Give it a PDF that looks like a form but has
17
+ no form fields β€” it finds every field and writes a real, clickable AcroForm.
18
+
19
+ ```sh
20
+ pip install acromeld
21
+ acromeld input.pdf output.pdf
22
+ ```
23
+
24
+ That is all you need; the weights below are downloaded on first use.
25
+
26
+ ![A PDF with no form fields on the left, the same page with 54 generated form fields on the right](assets/hero.png)
27
+
28
+ *AcroMELD = **Acro**Form **M**ulti-source **E**vidence **L**inking **D**ecoder.*
29
+
30
+ ## What it detects
31
+
32
+ Three field types β€” **Text**, **Choice**, **Signature** β€” plus a learned link that merges
33
+ several visual candidates into one field instead of emitting duplicates. It reads two
34
+ channels at once: the rendered page, and the PDF's own drawing primitives (lines,
35
+ rectangles, glyph runs), which a purely visual detector ignores. Scanned pages have no
36
+ primitives; the model was trained with that channel dropped on 12 % of pages, so it degrades
37
+ rather than fails.
38
+
39
+ 39.4M parameters. Up to 896 fields per page, so dense forms are not silently truncated.
40
+
41
+ ![41 detected fields on a form page, coloured by class with confidence scores](assets/detections.png)
42
+
43
+ ## How well it works
44
+
45
+ Measured **once** on a sealed holdout of 1,996 PDFs / 6,843 pages the model never saw during
46
+ training, against a pass/fail threshold registered before training started.
47
+
48
+ | | containment micro-F1 |
49
+ |---|---|
50
+ | Registered baseline β€” the number to beat | 0.82903655889853 |
51
+ | **AcroMELD** | **0.8476748634830094** |
52
+ | Verdict | **passed** |
53
+
54
+ The model was frozen and hash-locked before the holdout was opened, so the score could not
55
+ be tuned after the fact.
56
+
57
+ **Read this before using it:**
58
+
59
+ - **Signature detection does not work.** At the calibrated threshold the model predicts
60
+ essentially no signature fields β€” per-class F1 `0.0677`. Text and Choice carry the entire
61
+ score. Treat any signature output as unusable.
62
+ - Under a stricter IoU/COCO adapter the same model reaches only `0.28996` mAP, below a
63
+ locally evaluated CommonForms-L reference. The two adapters use different ground-truth
64
+ counts and are **not comparable to each other**; the strict number is the less flattering
65
+ one and it is reported here for that reason.
66
+ - Measured on **German-language forms**. Other languages and layouts are untested.
67
+ - Rotated pages are rejected rather than silently misplaced.
68
+ - One sealed run, one seed. No stability claim, no component ablations.
69
+
70
+ This is a **research artifact**, not a product.
71
+
72
+ ## Files
73
+
74
+ | | | |
75
+ |---|---|---|
76
+ | `acromeld-inference.pt` | 158 MB | the model β€” EMA weights, what the `acromeld` package loads |
77
+ | `operating-point.json` | 199 B | the calibrated thresholds, frozen before the holdout was opened |
78
+
79
+ ```json
80
+ {
81
+ "class_thresholds": [0.769, 0.812, 0.99],
82
+ "link_probability": 0.95,
83
+ "nms_iou": 1.0
84
+ }
85
+ ```
86
+
87
+ Class order is `[Text, Choice, Signature]`. `nms_iou: 1.0` means suppression is effectively
88
+ disabled β€” the graph-set decoder produces exclusive queries, so duplicate suppression is not
89
+ needed.
90
+
91
+ ## Architecture
92
+
93
+ 384 ECDet-L visual queries + 384 structure-seeded queries + 128 free recovery queries β†’
94
+ 896 exclusive queries β†’ 4 sparse geometry-weighted graph layers β†’ boxes, 3 classes +
95
+ no-object, localization quality, same-field links.
96
+
97
+ The visual branch is vendored ECDet-L (EdgeCrafter, Apache-2.0). The label-free PDF-structure
98
+ encoder and the graph-set decoder are this project's contribution.
99
+
100
+ Trained on 35,388 PDFs / 119,418 pages, 2Γ— NVIDIA RTX A6000, effective batch 32, epoch 32 of
101
+ 33 selected on a development split by the same containment metric the gate uses. The external
102
+ holdout was excluded from the training index by document hash.
103
+
104
+ ## What is not here
105
+
106
+ - **The training corpus.** Third-party form documents with heterogeneous redistribution
107
+ rights and potentially sensitive content; releasing it would require a rights and
108
+ data-protection assessment that has not been done.
109
+ - **The training code.** The objective, the Hungarian matching, the calibration procedure and
110
+ the evaluation harness are not published.
111
+ - **The sealed run record** β€” the frozen candidate checkpoint, the full per-epoch history, the
112
+ one-shot holdout report and every provenance digest that binds them. Held privately and
113
+ available for hash audit on request.
114
+
115
+ ## Licence
116
+
117
+ Apache-2.0, inherited from the source project and from vendored ECDet-L.
118
+
119
+ The two example pages above are blank third-party form templates, rendered from the model's
120
+ own output and shown only to illustrate what it does. They carry their publishers' rights.