pageimprover commited on
Commit
012128a
Β·
verified Β·
1 Parent(s): aeb621e

ibteda.pt: the deployed geometry model, with its card

Browse files
Files changed (2) hide show
  1. README.md +178 -0
  2. ibteda.pt +3 -0
README.md ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ library_name: pageimprover
4
+ tags:
5
+ - page-geometry
6
+ - document-layout
7
+ - book-digitisation
8
+ - torchscript
9
+ - human-in-the-loop
10
+ model-index:
11
+ - name: pageimprover
12
+ results:
13
+ - task:
14
+ type: page-geometry-regression
15
+ name: Page geometry regression (two page crops per photographed spread)
16
+ dataset:
17
+ type: ibteda-digital-library
18
+ name: Ibteda Digital Library held-out cohorts (in-archive; each metric names its cohort)
19
+ metrics:
20
+ - type: pass@80
21
+ value: 0.6770
22
+ name: "raw pass@80 - sealed sensitivity test, 54 books, 1,626 routed sides (calibration pages excluded) - uncalibrated, unrouted [claim geo_raw_sealed]"
23
+ - type: pass@80
24
+ value: 0.7107
25
+ name: "held-out pass@80, uncalibrated - calibration confirmation, 249 books, 5,022 held-out sides per repeat, 20 repeats - uncalibrated [claim cal_baseline]"
26
+ - type: pass@80
27
+ value: 0.8271
28
+ name: "held-out pass@80, one pooled 10-crop book offset - calibration confirmation, 249 books - calibrated (pooled, 10 crops) [claim cal_pooled]"
29
+ - type: pass@80
30
+ value: 0.8334
31
+ name: "calibrated pass@80, before review - routing confirmation, 192 books, 5,636 held-out sides - calibrated, unrouted [claim route_conf_baseline]"
32
+ - type: pass@80
33
+ value: 0.9248
34
+ name: "pass@80 at the deployed review rule - routing confirmation, 192 books, 5,636 sides - calibrated + routed (28.5% review) [claim route_conf_routed]"
35
+ - type: pass@80
36
+ value: 0.8278
37
+ name: "calibrated pass@80, before review - sealed sensitivity, 54 books, 1,626 sides - calibrated, unrouted [claim route_sealed_baseline]"
38
+ - type: pass@80
39
+ value: 0.9151
40
+ name: "pass@80 the deployed review rule delivers - sealed sensitivity, 54 books, 1,626 sides - calibrated + routed (deployed rule) [claim route_sealed_routed]"
41
+ ---
42
+
43
+ <!-- Generated by tools/hub_card.py from MODEL_CARD.md and docs/claims.md. Do not edit on the hub: the release
44
+ audit regenerates this card and fails on any difference. -->
45
+
46
+ **Artifact:** `ibteda.pt`, SHA-256 `359ae48b6a846e01d70a21c2c49426125f3b8950ae7b4736ba8cf954af60babe`. Obtain it with `pageimprover fetch model`, which verifies these bytes and refuses any others. The code, its tests and the claim ledger every figure below is rendered from are at <https://github.com/ibteda-org/pageimprover>.
47
+
48
+ # Model card β€” pageimprover geometry model
49
+
50
+ This card describes the deployed page-geometry model: what it predicts, how it was measured, and the places it
51
+ is known to fail. Every performance number here is a row in [`docs/claims.md`](https://github.com/ibteda-org/pageimprover/blob/main/docs/claims.md), which names the
52
+ cohort, the calibration state and the evidence behind it; the figures are rendered from that ledger and a build
53
+ gate refuses any that drift from it. Read that file alongside this one.
54
+
55
+ The short version: **the model locates a text block well inside its own archive and does not, on its own, produce
56
+ a finished crop.** A per-book calibration of ten operator crops and a review queue are the other two thirds of
57
+ the system, and the numbers below only mean anything as a trio.
58
+
59
+ ## What it does
60
+
61
+ Given one photographed spread, the model predicts two rectangles β€” the left and right page crops β€” as a single
62
+ fixed-length vector. It is geometric regression, not detection: no anchors, no proposals, no class labels
63
+ (ADR 0003). The trunk is a ResNet-34 and the input is a 704<!--claim:model_input--> px tile. That input size was
64
+ chosen to fit a T4's memory, **not** for accuracy, and has never been tuned against the acceptance bar
65
+ (ADR 0007) β€” a larger input is an untested lever, not a rejected one.
66
+
67
+ A prediction is scored by its **worst corner**. A page side passes when the worst of its four corners lands
68
+ within 80<!--claim:pass_bar--> px of the operator's crop, measured in the fixed 2048Γ—2897 finishing frame. This
69
+ is `metrics.PASS_PX`, a geometry rule and nothing more: not an OCR score, not an aesthetic judgement, and not
70
+ "accuracy" in any sense a reader should generalise (ADRs 0005-0010).
71
+
72
+ ## Evaluation
73
+
74
+ Two held-out cohorts, both inside the source archive. "Confirmation" is a 192-book unexposed cohort; "sealed" is
75
+ a 54-book sensitivity test held back from every design decision. All figures are `pass@80`.
76
+
77
+ ### Raw geometry, before anything
78
+
79
+ On the sealed cohort the deployed model reaches a raw pass@80 of 0.6770<!--claim:geo_raw_sealed--> uncalibrated
80
+ and unrouted. That is the honest floor of the model alone. It is not a corpus-wide figure and it is not what the
81
+ system delivers; it is what the network predicts before the two human-in-the-loop stages that follow.
82
+
83
+ ### Per-book calibration
84
+
85
+ The dominant residual is a per-book **size** constant β€” the crop a given book was finished at leaves no trace in
86
+ a single image (ADR 0001), so no model recovers it at any capacity (ADR 0007). Ten operator crops do. Five
87
+ spreads, both sides, 10<!--claim:cal_crops--> crops per book, pooled into one offset (`calibrate/pooled_median.py`).
88
+
89
+ On the confirmation cohort, held-out pass@80 rises from 0.7107<!--claim:cal_baseline--> uncalibrated to
90
+ 0.8271<!--claim:cal_pooled--> with that single pooled offset β€” a gain bought with five spreads of operator work
91
+ per book. The offset is applied only when its magnitude reaches a gate of 40<!--claim:cal_gate--> canonical px
92
+ (`refusals.CALIBRATION_GATE_PX`); below that, an offset is indistinguishable from an operator's own
93
+ self-consistency and can only add noise (ADR 0005).
94
+
95
+ Two design choices are recorded as costs, not victories:
96
+
97
+ - **Pooled, not per-side.** Splitting the same ten crops by page side harmed 8<!--claim:cal_harm_perside-->
98
+ books on held-out data; pooling them harmed only 2<!--claim:cal_harm_pooled--> β€” same crops, estimator the only
99
+ difference β€” which is why the pooled estimator is the default (ADR 0010).
100
+ - **k=5, not k=7.** Seven spreads beat five by +0.0104<!--claim:k7_delta--> pass@80, decisively
101
+ (p<0.0001) β€” and was declined, because at corpus scale that point costs thousands of extra operator pages. Five
102
+ spreads is the default (k=5<!--claim:k_default-->) as a cost decision, not a significance one (ADR 0006).
103
+
104
+ ### Review routing
105
+
106
+ A flip-consistency router sends the least trustworthy sides to a person. It flags a side when its direct and
107
+ flipped passes disagree by more than 87<!--claim:route_threshold--> canonical px (`review.absolute`), the
108
+ deployed absolute policy.
109
+
110
+ At that operating point, calibrated confirmation quality rises from 0.8334<!--claim:route_conf_baseline--> before
111
+ review to 0.9248<!--claim:route_conf_routed-->, sending 28.5%<!--claim:route_conf_share--> of page sides to a
112
+ reviewer. On the sealed cohort the same fixed rule lifts 0.8278<!--claim:route_sealed_baseline--> to
113
+ 0.9151<!--claim:route_sealed_routed-->. **The review share is an in-archive operating point, not a portable
114
+ promise**; a different archive's distribution moves it.
115
+
116
+ Reaching a higher 0.930 target under a coverage *sweep* β€” explicitly not the deployed rule β€” needs
117
+ 34.5%<!--claim:route_sweep_930_sealed--> review on sealed and 30.5%<!--claim:route_sweep_930_conf--> on
118
+ confirmation. The preregistration warns against quoting a sweep point as the deployed one; they are different
119
+ questions and the two were once mixed to produce a claim that had to be withdrawn (ADR 0009).
120
+
121
+ ## Training data and attribution
122
+
123
+ The model was trained on completed page crops from the **Ibteda corpus** β€” books finished by hand by the
124
+ archive's operators, whose crops are the target the model regresses toward. That labour is the ground truth here;
125
+ the model reproduces a finishing convention, it does not invent one. Any use of this model should credit the
126
+ Ibteda corpus and its operators as the source of the training crops.
127
+
128
+ That convention is narrow and measured as such: 98.7%<!--claim:canvas_share--> of finished pages used a single
129
+ 2048Γ—2897 Photoshop template (ADR 0002), and the export round-trip reconstructs that historical output to a
130
+ median residual of 3.0<!--claim:canvas_residual--> px. The high share is a fact about one archive's finishing
131
+ habit, not a universal page ratio, and the residual describes the convention's reproducibility, not the model's
132
+ quality.
133
+
134
+ ## Known failure modes β€” read before deploying off-corpus
135
+
136
+ **The disagreement score's level does not transfer.** Off-distribution, the flip-consistency gap is large,
137
+ signed and material-dependent: on foreign captures it has overstated a small error by more than an order of
138
+ magnitude on one book and tracked a large median on another. `review.score.disagreement_px` is a routing signal,
139
+ not a page error, and off-corpus it must not be read as one in either direction. Its *ordering* was thought to
140
+ survive even where its level did not β€” until a fourth book gave essentially zero rank correlation and routed its
141
+ two most nearly perfect sides last. Ranking isolates a single-page outlier; it cannot see a systematic per-side
142
+ bias. Do not size a foreign operator budget from this score; ADR 0011 records the figures and the reasoning.
143
+
144
+ **A documented manuscript blind spot.** The deployed model reads printed material well at correct framing and
145
+ reads handwritten manuscript pages badly: 0.0727<!--claim:manuscript_blindspot--> calibrated pass@80 on the
146
+ manuscript sides evaluated, with the routing signal actively anti-ranked rather than merely uninformative. A
147
+ composition-swap model built to fix this was measured and refused β€” it learned its manuscripts almost perfectly
148
+ and still failed both foreign reads β€” so the bridge model ships with the blind spot named rather than papered
149
+ over. Anything quoting this model as adequate for manuscript work should quote that number instead (ADR 0012).
150
+
151
+ **Framing is the input the model never sees corrected.** For a capture from outside the archive, the paper block
152
+ must be located and centred at the corpus area fraction before the model has a fair chance; the release measures
153
+ and reports this but applies no such transform on the ordinary path, and whether letterboxing or centring is
154
+ better for a frame with no surround is unmeasured (ADR 0011).
155
+
156
+ ## Intended use, and what would be misuse
157
+
158
+ Intended: locating and cropping page geometry for photographed spreads **within the archive it was trained on**,
159
+ as the first stage of a three-stage loop whose other two stages are a human's calibration crops and a human's
160
+ review of the routed sides.
161
+
162
+ Misuse: quoting any single number here as "accuracy"; deploying on manuscript pages or foreign captures without
163
+ re-measuring against a local operator's crops; citing a review share as portable; or reading the disagreement
164
+ score as a per-page error. The model does not finish a page on its own, and this card exists so that no figure in
165
+ it is read as a claim that it does.
166
+
167
+ ## Licence and authorization
168
+
169
+ The code is Apache-2.0. The model artifact `ibteda.pt` is published under **CC BY 4.0**, with attribution to the
170
+ Ibteda Digital Library. The required credit line is:
171
+
172
+ > Trained on the Ibteda Digital Library corpus; the page crops are the work of its operators.
173
+
174
+ A written authorization from the rights holder, dated 2026-09-04, covers the code, the weights and the licence
175
+ they are published under, the benchmark metadata, this attribution, and the measurements derived from the
176
+ training data that appear in this card and in [`docs/claims.md`](https://github.com/ibteda-org/pageimprover/blob/main/docs/claims.md). The authorization is
177
+ correspondence and is retained with the project's private records; this repository states only that it exists
178
+ and what it covers.
ibteda.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:359ae48b6a846e01d70a21c2c49426125f3b8950ae7b4736ba8cf954af60babe
3
+ size 85673526