AviadCoh commited on
Commit
4dc03ab
·
verified ·
1 Parent(s): 51d2897

Add five-seed surface response and held-out calibration evidence

Browse files
surface-contrast-grid/five-seed-addendum/README.md ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Five-seed calibration addendum
2
+
3
+ This addendum tests whether the original 4×4 contrast × pitch response surface
4
+ was a seed-specific artifact and separates fixed-threshold recall from ranking
5
+ quality. It does **not** change the production checkpoint or tune the model.
6
+
7
+ ![Five-seed response and held-out calibration](five_seed_response_addendum.png)
8
+
9
+ ## Design
10
+
11
+ - Five independently generated phantom instances per cell: seeds 0–4.
12
+ - Four papyrus levels × four winding pitches × five seeds = **80 inferences**.
13
+ - Same pinned `surface_recto_059_redo` checkpoint, 192³ sliding windows, 50%
14
+ step, Gaussian blending, no TTA.
15
+ - Seed 0 exactly reproduces all original recall, false-positive-rate, and AUC
16
+ values. It is also the **only** seed used to select global thresholds.
17
+ - Global thresholds are frozen, then evaluated on held-out seeds 1–4.
18
+ - Raw class-score histograms use 4,096 bins. Per-cell best-Youden results are
19
+ retained as descriptive same-cell upper bounds, not headline evidence.
20
+
21
+ ## What survived replication
22
+
23
+ The AUC geometry response is highly stable. Mean ± sample SD across the five
24
+ seeds is:
25
+
26
+ | Pitch (µm) | Near-sheet AUC | Recall @ 0.5 | Recall @ 5% FPR |
27
+ |---:|---:|---:|---:|
28
+ | 260 | 0.7881 ± 0.0012 | 0.3427 ± 0.0025 | 0.1881 ± 0.0018 |
29
+ | 200 | 0.8566 ± 0.0027 | 0.3106 ± 0.0027 | 0.3086 ± 0.0047 |
30
+ | 150 | **0.9279 ± 0.0027** | **0.3836 ± 0.0028** | **0.6679 ± 0.0060** |
31
+ | 110 | 0.9099 ± 0.0014 | 0.3410 ± 0.0008 | 0.4872 ± 0.0074 |
32
+
33
+ Pitch 150 has higher mean AUC than pitch 110 in **all five seeds**. At both 1%
34
+ and 5% controlled near-background FPR, the ordering is
35
+ **150 > 110 > 200 > 260 in every seed**. The original intermediate-pitch peak
36
+ is therefore not explained by the seed-0 instance.
37
+
38
+ Contrast response also survives. Mean AUC rises monotonically across papyrus
39
+ levels 35, 50, 65, and 90: **0.7984, 0.8735, 0.9015, 0.9092**.
40
+
41
+ ## What threshold calibration changes
42
+
43
+ Recall at the fixed 0.5 threshold is not directly comparable across pitches:
44
+ mean near-background FPR varies from **10.84% at pitch 260** to **1.74% at
45
+ pitch 150**. The pitch-200 recall@0.5 dip is reproducible—it is the lowest in
46
+ all five seeds—but fixed-threshold recall mixes detection with score
47
+ calibration.
48
+
49
+ The controlled-FPR readout agrees with AUC and gives the clearer geometry
50
+ result. At 5% FPR, recall is **0.188, 0.309, 0.668, 0.487** for pitches 260,
51
+ 200, 150, and 110 µm.
52
+
53
+ One pooled threshold selected on seed 0 transfers almost exactly:
54
+
55
+ | Seed-0 target | Frozen threshold | Seed-0 recall / FPR | Held-out seeds 1–4 recall / FPR |
56
+ |---:|---:|---:|---:|
57
+ | 1% FPR | 0.8440 | 10.99% / 1.00% | 10.93% / 0.99% |
58
+ | 5% FPR | 0.5725 | 30.39% / 5.00% | 30.38% / 4.86% |
59
+
60
+ This shows stable calibration transfer within the generator. It does not imply
61
+ that these thresholds transfer to real CT.
62
+
63
+ ## Interpretation
64
+
65
+ The replicated result supports three narrow claims:
66
+
67
+ 1. Both controlled axes affect this checkpoint's response.
68
+ 2. The intermediate-pitch AUC peak is stable across five analytic instances.
69
+ 3. Recall@0.5 partly measures threshold placement; controlled-FPR recall is a
70
+ better companion to AUC on this instrument.
71
+
72
+ It does **not** establish response independence, a universal pitch optimum, or
73
+ real-scroll accuracy. Five seeds quantify variation inside this analytic
74
+ phantom generator. They do not sample tearing, plastic deformation, papyrus
75
+ texture, reconstruction artifacts, or annotation uncertainty.
76
+
77
+ ## Files and provenance
78
+
79
+ - `seed-runs/seed_0.json` … `seed_4.json` — raw per-cell results and score
80
+ histograms.
81
+ - `replicate_results_validated.json` — aggregate summaries and held-out
82
+ calibration.
83
+ - `validate_replicates.py` — independent raw-to-summary validator; **1,930 / 1,930 checks pass**.
84
+ - `aggregate_replicates.py` — deterministic post-processing from the raw seed
85
+ files.
86
+ - `runtime/vesuvius-surface-contrast-grid.py` — exact completed Kaggle v8
87
+ source; SHA-256
88
+ `368e5d375e7e62221a49f9be8d91a6a7d66c1f9dcb7f6043ba985a6501cebc69`.
89
+ - `five_seed_response_addendum.png` and `render_replicate_figure.py` — figure
90
+ and deterministic renderer.
91
+
92
+ Validated aggregate SHA-256:
93
+ `b265d6ecf7e8bfb8a03a616cceaf12f65d2535175778df149294ad39828fe553`.
94
+
95
+ Checkpoint SHA-256:
96
+ `f1990a02ac91889c1f989522ae0e45421a91cb666320448aaf579d42b081636f`.
surface-contrast-grid/five-seed-addendum/aggregate_replicates.py ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Aggregate seeded surface-grid runs and perform held-out calibration."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import argparse
7
+ import hashlib
8
+ import json
9
+ import math
10
+ from collections import defaultdict
11
+ from pathlib import Path
12
+
13
+ import numpy as np
14
+
15
+
16
+ METRICS = (
17
+ "surface_recall_at_0_5",
18
+ "near_sheet_auc",
19
+ "recall_at_fpr_1pct",
20
+ "recall_at_fpr_5pct",
21
+ "best_youden_recall",
22
+ "best_youden_threshold",
23
+ )
24
+
25
+
26
+ def sha256_file(path: Path) -> str:
27
+ digest = hashlib.sha256()
28
+ with path.open("rb") as handle:
29
+ for chunk in iter(lambda: handle.read(8 << 20), b""):
30
+ digest.update(chunk)
31
+ return digest.hexdigest()
32
+
33
+
34
+ def sample_summary(values: list[float]) -> dict:
35
+ array = np.asarray(values, dtype=np.float64)
36
+ return {
37
+ "n": int(array.size),
38
+ "mean": float(array.mean()),
39
+ "sample_sd": float(array.std(ddof=1)) if array.size > 1 else 0.0,
40
+ "min": float(array.min()),
41
+ "max": float(array.max()),
42
+ "values_by_seed": [float(value) for value in array],
43
+ }
44
+
45
+
46
+ def rates_at_bin(positive: np.ndarray, negative: np.ndarray, index: int) -> tuple[float, float]:
47
+ return (
48
+ float(positive[index:].sum() / positive.sum()),
49
+ float(negative[index:].sum() / negative.sum()),
50
+ )
51
+
52
+
53
+ def best_youden_index(positive: np.ndarray, negative: np.ndarray) -> int:
54
+ true_positive = np.cumsum(positive[::-1])[::-1] / positive.sum()
55
+ false_positive = np.cumsum(negative[::-1])[::-1] / negative.sum()
56
+ score = true_positive - false_positive
57
+ candidates = np.flatnonzero(
58
+ np.isclose(score, score.max(), rtol=0.0, atol=1e-15)
59
+ )
60
+ return int(candidates[-1])
61
+
62
+
63
+ def main() -> int:
64
+ parser = argparse.ArgumentParser()
65
+ parser.add_argument("--runs", type=Path, required=True)
66
+ parser.add_argument("--output", type=Path, required=True)
67
+ args = parser.parse_args()
68
+
69
+ paths = sorted(args.runs.glob("seed_*.json"), key=lambda path: int(path.stem.split("_")[-1]))
70
+ if len(paths) < 3:
71
+ raise RuntimeError(f"expected at least three seed runs, found {len(paths)}")
72
+
73
+ runs = []
74
+ for path in paths:
75
+ seed = int(path.stem.split("_")[-1])
76
+ result = json.loads(path.read_text(encoding="utf-8"))
77
+ if not result.get("canonical") or len(result.get("cells", [])) != 16:
78
+ raise RuntimeError(f"non-canonical run: {path}")
79
+ runs.append((seed, path, result))
80
+
81
+ bins = int(runs[0][2]["cells"][0]["metrics"]["histogram_bins"])
82
+ for _, path, result in runs:
83
+ for cell in result["cells"]:
84
+ if int(cell["metrics"]["histogram_bins"]) != bins:
85
+ raise RuntimeError(f"histogram bin mismatch in {path}")
86
+
87
+ # Seed 0 is calibration-only for a single global operating threshold.
88
+ calibration = runs[0][2]
89
+ calibration_positive = np.zeros(bins, dtype=np.int64)
90
+ calibration_negative = np.zeros(bins, dtype=np.int64)
91
+ for cell in calibration["cells"]:
92
+ calibration_positive += np.asarray(
93
+ cell["metrics"]["positive_score_histogram"], dtype=np.int64
94
+ )
95
+ calibration_negative += np.asarray(
96
+ cell["metrics"]["negative_score_histogram"], dtype=np.int64
97
+ )
98
+ threshold_index = best_youden_index(calibration_positive, calibration_negative)
99
+ threshold = threshold_index / bins
100
+ calibration_recall, calibration_fpr = rates_at_bin(
101
+ calibration_positive, calibration_negative, threshold_index
102
+ )
103
+
104
+ heldout_by_seed = []
105
+ heldout_positive = np.zeros(bins, dtype=np.int64)
106
+ heldout_negative = np.zeros(bins, dtype=np.int64)
107
+ for seed, _, result in runs[1:]:
108
+ positive = np.zeros(bins, dtype=np.int64)
109
+ negative = np.zeros(bins, dtype=np.int64)
110
+ for cell in result["cells"]:
111
+ positive += np.asarray(
112
+ cell["metrics"]["positive_score_histogram"], dtype=np.int64
113
+ )
114
+ negative += np.asarray(
115
+ cell["metrics"]["negative_score_histogram"], dtype=np.int64
116
+ )
117
+ recall, fpr = rates_at_bin(positive, negative, threshold_index)
118
+ heldout_by_seed.append({"seed": seed, "recall": recall, "fpr": fpr})
119
+ heldout_positive += positive
120
+ heldout_negative += negative
121
+ heldout_recall, heldout_fpr = rates_at_bin(
122
+ heldout_positive, heldout_negative, threshold_index
123
+ )
124
+
125
+ target_fpr_operating_points = {}
126
+ calibration_fpr_curve = (
127
+ np.cumsum(calibration_negative[::-1])[::-1]
128
+ / calibration_negative.sum()
129
+ )
130
+ for target in (0.01, 0.05):
131
+ candidates = np.flatnonzero(calibration_fpr_curve <= target)
132
+ index = int(candidates[0]) if candidates.size else bins - 1
133
+ calibration_target_recall, calibration_target_fpr = rates_at_bin(
134
+ calibration_positive, calibration_negative, index
135
+ )
136
+ target_heldout_by_seed = []
137
+ for seed, _, result in runs[1:]:
138
+ positive = np.zeros(bins, dtype=np.int64)
139
+ negative = np.zeros(bins, dtype=np.int64)
140
+ for cell in result["cells"]:
141
+ positive += np.asarray(
142
+ cell["metrics"]["positive_score_histogram"], dtype=np.int64
143
+ )
144
+ negative += np.asarray(
145
+ cell["metrics"]["negative_score_histogram"], dtype=np.int64
146
+ )
147
+ recall, fpr = rates_at_bin(positive, negative, index)
148
+ target_heldout_by_seed.append(
149
+ {"seed": seed, "recall": recall, "fpr": fpr}
150
+ )
151
+ target_heldout_recall, target_heldout_fpr = rates_at_bin(
152
+ heldout_positive, heldout_negative, index
153
+ )
154
+ target_fpr_operating_points[f"{int(target * 100)}pct"] = {
155
+ "target_fpr": target,
156
+ "threshold_selected_on_seed_0": index / bins,
157
+ "calibration_recall": calibration_target_recall,
158
+ "calibration_fpr": calibration_target_fpr,
159
+ "heldout_pooled_recall": target_heldout_recall,
160
+ "heldout_pooled_fpr": target_heldout_fpr,
161
+ "heldout_by_seed": target_heldout_by_seed,
162
+ }
163
+
164
+ grouped_cells: dict[tuple[int, float], dict[str, list[float]]] = defaultdict(
165
+ lambda: defaultdict(list)
166
+ )
167
+ pitch_seed_means: dict[str, dict[float, list[float]]] = {
168
+ metric: defaultdict(list) for metric in METRICS
169
+ }
170
+ papyrus_seed_means: dict[str, dict[int, list[float]]] = {
171
+ metric: defaultdict(list) for metric in METRICS
172
+ }
173
+ for _, _, result in runs:
174
+ per_pitch: dict[str, dict[float, list[float]]] = {
175
+ metric: defaultdict(list) for metric in METRICS
176
+ }
177
+ per_papyrus: dict[str, dict[int, list[float]]] = {
178
+ metric: defaultdict(list) for metric in METRICS
179
+ }
180
+ for cell in result["cells"]:
181
+ key = (int(cell["papyrus"]), float(cell["pitch_um"]))
182
+ for metric in METRICS:
183
+ value = float(cell["metrics"][metric])
184
+ grouped_cells[key][metric].append(value)
185
+ per_pitch[metric][key[1]].append(value)
186
+ per_papyrus[metric][key[0]].append(value)
187
+ for metric in METRICS:
188
+ for pitch, values in per_pitch[metric].items():
189
+ pitch_seed_means[metric][pitch].append(float(np.mean(values)))
190
+ for papyrus, values in per_papyrus[metric].items():
191
+ papyrus_seed_means[metric][papyrus].append(float(np.mean(values)))
192
+
193
+ output = {
194
+ "schema_version": "2.0",
195
+ "replicate_design": {
196
+ "seeds": [seed for seed, _, _ in runs],
197
+ "replicates_per_cell": len(runs),
198
+ "cells_per_seed": 16,
199
+ "total_inferences": 16 * len(runs),
200
+ "seed_0_role": "included in replicate summaries; calibration-only for the global threshold",
201
+ "heldout_threshold_seeds": [seed for seed, _, _ in runs[1:]],
202
+ },
203
+ "source_runs": [
204
+ {"seed": seed, "file": path.name, "sha256": sha256_file(path)}
205
+ for seed, path, _ in runs
206
+ ],
207
+ "global_threshold_calibration": {
208
+ "histogram_bins": bins,
209
+ "selected_on_seed": runs[0][0],
210
+ "threshold": threshold,
211
+ "selection_rule": "pooled maximum Youden J; highest threshold on ties",
212
+ "calibration_recall": calibration_recall,
213
+ "calibration_fpr": calibration_fpr,
214
+ "heldout_pooled_recall": heldout_recall,
215
+ "heldout_pooled_fpr": heldout_fpr,
216
+ "heldout_by_seed": heldout_by_seed,
217
+ "target_fpr_operating_points": target_fpr_operating_points,
218
+ },
219
+ "cell_replicate_summaries": [
220
+ {
221
+ "papyrus": papyrus,
222
+ "pitch_um": pitch,
223
+ "metrics": {
224
+ metric: sample_summary(values)
225
+ for metric, values in sorted(grouped_cells[(papyrus, pitch)].items())
226
+ },
227
+ }
228
+ for papyrus, pitch in sorted(grouped_cells)
229
+ ],
230
+ "pitch_summaries": {
231
+ metric: {
232
+ str(int(pitch) if float(pitch).is_integer() else pitch): sample_summary(values)
233
+ for pitch, values in sorted(mapping.items(), reverse=True)
234
+ }
235
+ for metric, mapping in pitch_seed_means.items()
236
+ },
237
+ "papyrus_summaries": {
238
+ metric: {
239
+ str(papyrus): sample_summary(values)
240
+ for papyrus, values in sorted(mapping.items())
241
+ }
242
+ for metric, mapping in papyrus_seed_means.items()
243
+ },
244
+ "limitations": [
245
+ "Five seeds estimate variation across this analytic phantom generator, not across real scrolls.",
246
+ "Per-cell best-Youden metrics are descriptive upper bounds chosen and measured on the same cell.",
247
+ "The global threshold is selected on seed 0 and evaluated on seeds 1-4 to avoid calibration leakage.",
248
+ "Histogram-derived thresholds have resolution 1/4096.",
249
+ "No confidence interval here supports claims of real-scroll accuracy.",
250
+ ],
251
+ }
252
+ args.output.write_text(json.dumps(output, indent=2) + "\n", encoding="utf-8")
253
+ print(f"wrote {args.output}")
254
+ return 0
255
+
256
+
257
+ if __name__ == "__main__":
258
+ raise SystemExit(main())
surface-contrast-grid/five-seed-addendum/five_seed_response_addendum.png ADDED

Git LFS Details

  • SHA256: 9edf7f2637dc8c3e098d34e3790a420b405e673b41ecde04dfb654c04746a881
  • Pointer size: 130 Bytes
  • Size of remote file: 99.9 kB
surface-contrast-grid/five-seed-addendum/render_replicate_figure.py ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Render the five-seed calibration addendum as a deterministic PNG."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import json
7
+ from pathlib import Path
8
+
9
+ from PIL import Image, ImageDraw, ImageFont
10
+
11
+
12
+ HERE = Path(__file__).resolve().parent
13
+ DATA = HERE / "replicate_results_validated.json"
14
+ OUTPUT = HERE / "five_seed_response_addendum.png"
15
+ FONT = "/System/Library/Fonts/Avenir Next.ttc"
16
+
17
+ WIDTH, HEIGHT = 1900, 1180
18
+ BG = "#F4F0E7"
19
+ PANEL = "#FFFCF6"
20
+ INK = "#172725"
21
+ MUTED = "#65716D"
22
+ GRID = "#DDD8CD"
23
+ TEAL = "#087F7A"
24
+ RED = "#B44C3D"
25
+ GOLD = "#C38B2D"
26
+ BLUE = "#3D6FA5"
27
+
28
+
29
+ def font(size: int, bold: bool = False) -> ImageFont.FreeTypeFont:
30
+ index = 1 if bold else 0
31
+ return ImageFont.truetype(FONT, size=size, index=index)
32
+
33
+
34
+ def panel(draw: ImageDraw.ImageDraw, box: tuple[int, int, int, int]) -> None:
35
+ draw.rounded_rectangle(box, radius=24, fill=PANEL, outline="#E2DDD2", width=2)
36
+
37
+
38
+ def line_chart(
39
+ draw: ImageDraw.ImageDraw,
40
+ box: tuple[int, int, int, int],
41
+ title: str,
42
+ subtitle: str,
43
+ series: list[dict],
44
+ y_min: float,
45
+ y_max: float,
46
+ y_ticks: list[float],
47
+ ) -> None:
48
+ x0, y0, x1, y1 = box
49
+ draw.text((x0 + 34, y0 + 26), title, fill=INK, font=font(29, True))
50
+ draw.text((x0 + 34, y0 + 66), subtitle, fill=MUTED, font=font(18))
51
+ plot = (x0 + 90, y0 + 125, x1 - 36, y1 - 72)
52
+ px0, py0, px1, py1 = plot
53
+ pitches = [260, 200, 150, 110]
54
+
55
+ def x_at(index: int) -> float:
56
+ return px0 + index * (px1 - px0) / 3
57
+
58
+ def y_at(value: float) -> float:
59
+ return py1 - (value - y_min) * (py1 - py0) / (y_max - y_min)
60
+
61
+ for tick in y_ticks:
62
+ y = y_at(tick)
63
+ draw.line((px0, y, px1, y), fill=GRID, width=2)
64
+ draw.text((px0 - 14, y), f"{tick:.2f}", anchor="rm", fill=MUTED, font=font(16))
65
+ for index, pitch in enumerate(pitches):
66
+ x = x_at(index)
67
+ draw.line((x, py1, x, py1 + 8), fill=MUTED, width=2)
68
+ draw.text((x, py1 + 19), str(pitch), anchor="ma", fill=INK, font=font(17))
69
+ draw.text(((px0 + px1) / 2, y1 - 18), "winding pitch (µm)", anchor="mm", fill=MUTED, font=font(17))
70
+
71
+ for item in series:
72
+ values = item["values"]
73
+ points = [(x_at(index), y_at(value)) for index, value in enumerate(values)]
74
+ draw.line(points, fill=item["color"], width=item.get("width", 5), joint="curve")
75
+ for x, y in points:
76
+ radius = item.get("radius", 6)
77
+ draw.ellipse((x - radius, y - radius, x + radius, y + radius), fill=item["color"])
78
+ label_x = item.get("label_x", px0 + 8)
79
+ label_y = item.get("label_y")
80
+ if label_y is not None:
81
+ draw.text((label_x, label_y), item["label"], fill=item["color"], font=font(17, True))
82
+
83
+
84
+ def main() -> int:
85
+ data = json.loads(DATA.read_text(encoding="utf-8"))
86
+ image = Image.new("RGB", (WIDTH, HEIGHT), BG)
87
+ draw = ImageDraw.Draw(image)
88
+
89
+ draw.text((80, 58), "One grid became five", fill=INK, font=font(55, True))
90
+ draw.text(
91
+ (82, 126),
92
+ "80 production-model inferences separate stable geometry response from threshold placement.",
93
+ fill=MUTED,
94
+ font=font(24),
95
+ )
96
+
97
+ left = (70, 190, 930, 760)
98
+ right = (970, 190, 1830, 760)
99
+ bottom = (70, 800, 1830, 1100)
100
+ panel(draw, left)
101
+ panel(draw, right)
102
+ panel(draw, bottom)
103
+
104
+ pitches = ["260", "200", "150", "110"]
105
+ auc = data["pitch_summaries"]["near_sheet_auc"]
106
+ for seed in range(5):
107
+ values = [auc[pitch]["values_by_seed"][seed] for pitch in pitches]
108
+ points = []
109
+ px0, py0, px1, py1 = left[0] + 90, left[1] + 125, left[2] - 36, left[3] - 72
110
+ for index, value in enumerate(values):
111
+ x = px0 + index * (px1 - px0) / 3
112
+ y = py1 - (value - 0.76) * (py1 - py0) / (0.95 - 0.76)
113
+ points.append((x, y))
114
+ draw.line(points, fill="#B8D2CF", width=2)
115
+ for x, y in points:
116
+ draw.ellipse((x - 3, y - 3, x + 3, y + 3), fill="#8FBAB6")
117
+ line_chart(
118
+ draw,
119
+ left,
120
+ "AUC peak survives every seed",
121
+ "Thin traces: five instances · thick trace: mean",
122
+ [{"label": "mean AUC", "values": [auc[p]["mean"] for p in pitches], "color": TEAL}],
123
+ 0.76,
124
+ 0.95,
125
+ [0.78, 0.82, 0.86, 0.90, 0.94],
126
+ )
127
+
128
+ fixed = data["pitch_summaries"]["surface_recall_at_0_5"]
129
+ controlled = data["pitch_summaries"]["recall_at_fpr_5pct"]
130
+ line_chart(
131
+ draw,
132
+ right,
133
+ "Threshold choice changes the story",
134
+ "Mean across seeds; controlled rate aligns with AUC",
135
+ [
136
+ {"label": "recall @ 0.5", "values": [fixed[p]["mean"] for p in pitches], "color": RED},
137
+ {"label": "recall @ 5% FPR", "values": [controlled[p]["mean"] for p in pitches], "color": BLUE},
138
+ ],
139
+ 0.15,
140
+ 0.72,
141
+ [0.20, 0.30, 0.40, 0.50, 0.60, 0.70],
142
+ )
143
+ draw.line((right[0] + 565, right[1] + 37, right[0] + 605, right[1] + 37), fill=RED, width=5)
144
+ draw.text((right[0] + 618, right[1] + 37), "fixed 0.5", anchor="lm", fill=RED, font=font(16, True))
145
+ draw.line((right[0] + 565, right[1] + 68, right[0] + 605, right[1] + 68), fill=BLUE, width=5)
146
+ draw.text((right[0] + 618, right[1] + 68), "5% FPR", anchor="lm", fill=BLUE, font=font(16, True))
147
+
148
+ draw.text((bottom[0] + 34, bottom[1] + 25), "Seed-0 calibration transfers to four unseen instances", fill=INK, font=font(29, True))
149
+ draw.text((bottom[0] + 34, bottom[1] + 66), "One pooled threshold is chosen on seed 0, then frozen.", fill=MUTED, font=font(18))
150
+ operating = data["global_threshold_calibration"]["target_fpr_operating_points"]
151
+ headers = ["target", "threshold", "seed 0 recall / FPR", "held-out recall / FPR", "shift"]
152
+ xs = [bottom[0] + 45, bottom[0] + 280, bottom[0] + 580, bottom[0] + 1030, bottom[0] + 1490]
153
+ for x, header in zip(xs, headers):
154
+ draw.text((x, bottom[1] + 120), header.upper(), fill=MUTED, font=font(15, True))
155
+ for row, key in enumerate(("1pct", "5pct")):
156
+ record = operating[key]
157
+ y = bottom[1] + 169 + row * 58
158
+ shift = record["heldout_pooled_recall"] - record["calibration_recall"]
159
+ values = [
160
+ f"{record['target_fpr']:.0%} FPR",
161
+ f"{record['threshold_selected_on_seed_0']:.4f}",
162
+ f"{record['calibration_recall']:.1%} / {record['calibration_fpr']:.2%}",
163
+ f"{record['heldout_pooled_recall']:.1%} / {record['heldout_pooled_fpr']:.2%}",
164
+ f"{shift:+.2%} recall",
165
+ ]
166
+ for x, value in zip(xs, values):
167
+ draw.text((x, y), value, fill=INK if x != xs[-1] else TEAL, font=font(21, x == xs[0]))
168
+
169
+ draw.text(
170
+ (84, 1144),
171
+ "Five analytic seeds measure generator variation—not real-scroll accuracy. Error bars omitted because all seed traces are shown.",
172
+ fill=MUTED,
173
+ font=font(17),
174
+ )
175
+ image.save(OUTPUT, optimize=True)
176
+ print(OUTPUT)
177
+ return 0
178
+
179
+
180
+ if __name__ == "__main__":
181
+ raise SystemExit(main())
surface-contrast-grid/five-seed-addendum/replicate_results_validated.json ADDED
@@ -0,0 +1,2292 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema_version": "2.0",
3
+ "replicate_design": {
4
+ "seeds": [
5
+ 0,
6
+ 1,
7
+ 2,
8
+ 3,
9
+ 4
10
+ ],
11
+ "replicates_per_cell": 5,
12
+ "cells_per_seed": 16,
13
+ "total_inferences": 80,
14
+ "seed_0_role": "included in replicate summaries; calibration-only for the global threshold",
15
+ "heldout_threshold_seeds": [
16
+ 1,
17
+ 2,
18
+ 3,
19
+ 4
20
+ ]
21
+ },
22
+ "source_runs": [
23
+ {
24
+ "seed": 0,
25
+ "file": "seed_0.json",
26
+ "sha256": "c5a8abe3a54aafa5ae03c5faf48f98e97febb115c26104652e83275128046098"
27
+ },
28
+ {
29
+ "seed": 1,
30
+ "file": "seed_1.json",
31
+ "sha256": "1ad5597abc766c5e4c9541376264ab3c3e8de417c09231ca03e9df668a041ad9"
32
+ },
33
+ {
34
+ "seed": 2,
35
+ "file": "seed_2.json",
36
+ "sha256": "ab847533eab312ef754bd8e9a18adb40fd0f35c32bbd8162c51ecd353eff113a"
37
+ },
38
+ {
39
+ "seed": 3,
40
+ "file": "seed_3.json",
41
+ "sha256": "27708eb34343bd3a6c5467c87ff79c581a1515cfdb45f4553a93f1a860b2b821"
42
+ },
43
+ {
44
+ "seed": 4,
45
+ "file": "seed_4.json",
46
+ "sha256": "1c5468d277c697eff65ba907fc26c4cb74ecd6ae74d7c5a49a10d11579f50428"
47
+ }
48
+ ],
49
+ "global_threshold_calibration": {
50
+ "histogram_bins": 4096,
51
+ "selected_on_seed": 0,
52
+ "threshold": 0.02490234375,
53
+ "selection_rule": "pooled maximum Youden J; highest threshold on ties",
54
+ "calibration_recall": 0.8887617416205217,
55
+ "calibration_fpr": 0.31372956965062226,
56
+ "heldout_pooled_recall": 0.8916385828263844,
57
+ "heldout_pooled_fpr": 0.31075934084835016,
58
+ "heldout_by_seed": [
59
+ {
60
+ "seed": 1,
61
+ "recall": 0.8927469122890728,
62
+ "fpr": 0.31066218735207385
63
+ },
64
+ {
65
+ "seed": 2,
66
+ "recall": 0.8914329199492446,
67
+ "fpr": 0.3092296372740129
68
+ },
69
+ {
70
+ "seed": 3,
71
+ "recall": 0.8908086962695508,
72
+ "fpr": 0.3108871821333122
73
+ },
74
+ {
75
+ "seed": 4,
76
+ "recall": 0.8915658027976695,
77
+ "fpr": 0.31225835663400164
78
+ }
79
+ ],
80
+ "target_fpr_operating_points": {
81
+ "1pct": {
82
+ "target_fpr": 0.01,
83
+ "threshold_selected_on_seed_0": 0.843994140625,
84
+ "calibration_recall": 0.10985399978867832,
85
+ "calibration_fpr": 0.009999404620147654,
86
+ "heldout_pooled_recall": 0.10933108172555146,
87
+ "heldout_pooled_fpr": 0.009888946956800414,
88
+ "heldout_by_seed": [
89
+ {
90
+ "seed": 1,
91
+ "recall": 0.10874532295402844,
92
+ "fpr": 0.009700648890535372
93
+ },
94
+ {
95
+ "seed": 2,
96
+ "recall": 0.10983708688285225,
97
+ "fpr": 0.010281291253943474
98
+ },
99
+ {
100
+ "seed": 3,
101
+ "recall": 0.10932804128709245,
102
+ "fpr": 0.00952361526406934
103
+ },
104
+ {
105
+ "seed": 4,
106
+ "recall": 0.10941387577823272,
107
+ "fpr": 0.01005023241865347
108
+ }
109
+ ]
110
+ },
111
+ "5pct": {
112
+ "target_fpr": 0.05,
113
+ "threshold_selected_on_seed_0": 0.572509765625,
114
+ "calibration_recall": 0.3038878497445494,
115
+ "calibration_fpr": 0.04996582078625422,
116
+ "heldout_pooled_recall": 0.30380968731802194,
117
+ "heldout_pooled_fpr": 0.04862683171184203,
118
+ "heldout_by_seed": [
119
+ {
120
+ "seed": 1,
121
+ "recall": 0.3031352254352892,
122
+ "fpr": 0.04915698623128964
123
+ },
124
+ {
125
+ "seed": 2,
126
+ "recall": 0.30405089792589207,
127
+ "fpr": 0.049297892796344805
128
+ },
129
+ {
130
+ "seed": 3,
131
+ "recall": 0.30364713965111845,
132
+ "fpr": 0.04801837739144241
133
+ },
134
+ {
135
+ "seed": 4,
136
+ "recall": 0.30440548625978797,
137
+ "fpr": 0.048034070428291276
138
+ }
139
+ ]
140
+ }
141
+ }
142
+ },
143
+ "cell_replicate_summaries": [
144
+ {
145
+ "papyrus": 35,
146
+ "pitch_um": 110.0,
147
+ "metrics": {
148
+ "best_youden_recall": {
149
+ "n": 5,
150
+ "mean": 0.7834497074103327,
151
+ "sample_sd": 0.007692383125101641,
152
+ "min": 0.7703761194144649,
153
+ "max": 0.7898880261049689,
154
+ "values_by_seed": [
155
+ 0.7866374036939415,
156
+ 0.7831466621030402,
157
+ 0.7898880261049689,
158
+ 0.7872003257352478,
159
+ 0.7703761194144649
160
+ ]
161
+ },
162
+ "best_youden_threshold": {
163
+ "n": 5,
164
+ "mean": 0.051708984375,
165
+ "sample_sd": 0.003322465983633594,
166
+ "min": 0.047607421875,
167
+ "max": 0.055908203125,
168
+ "values_by_seed": [
169
+ 0.053955078125,
170
+ 0.047607421875,
171
+ 0.049560546875,
172
+ 0.055908203125,
173
+ 0.051513671875
174
+ ]
175
+ },
176
+ "near_sheet_auc": {
177
+ "n": 5,
178
+ "mean": 0.880294330651757,
179
+ "sample_sd": 0.00572925176417904,
180
+ "min": 0.870837233685434,
181
+ "max": 0.8839901121813247,
182
+ "values_by_seed": [
183
+ 0.8839901121813247,
184
+ 0.8788349430708892,
185
+ 0.8839416336092427,
186
+ 0.8838677307118943,
187
+ 0.870837233685434
188
+ ]
189
+ },
190
+ "recall_at_fpr_1pct": {
191
+ "n": 5,
192
+ "mean": 0.2991776819437587,
193
+ "sample_sd": 0.018644405275267877,
194
+ "min": 0.28347691611019427,
195
+ "max": 0.3277845532461277,
196
+ "values_by_seed": [
197
+ 0.28362521794601236,
198
+ 0.3068336139931555,
199
+ 0.29416810842330393,
200
+ 0.3277845532461277,
201
+ 0.28347691611019427
202
+ ]
203
+ },
204
+ "recall_at_fpr_5pct": {
205
+ "n": 5,
206
+ "mean": 0.5350977806642288,
207
+ "sample_sd": 0.01835502137962596,
208
+ "min": 0.5026196786200671,
209
+ "max": 0.5460144302253083,
210
+ "values_by_seed": [
211
+ 0.5402498873915558,
212
+ 0.5408075215229949,
213
+ 0.5460144302253083,
214
+ 0.5457973855612179,
215
+ 0.5026196786200671
216
+ ]
217
+ },
218
+ "surface_recall_at_0_5": {
219
+ "n": 5,
220
+ "mean": 0.3462258024042684,
221
+ "sample_sd": 0.006916537082698021,
222
+ "min": 0.3379635393807473,
223
+ "max": 0.3565966915951557,
224
+ "values_by_seed": [
225
+ 0.34763680904444105,
226
+ 0.3379635393807473,
227
+ 0.34638285332732116,
228
+ 0.3565966915951557,
229
+ 0.3425491186736768
230
+ ]
231
+ }
232
+ }
233
+ },
234
+ {
235
+ "papyrus": 35,
236
+ "pitch_um": 150.0,
237
+ "metrics": {
238
+ "best_youden_recall": {
239
+ "n": 5,
240
+ "mean": 0.7603861898121363,
241
+ "sample_sd": 0.019592644827094288,
242
+ "min": 0.730358939221849,
243
+ "max": 0.779483683999293,
244
+ "values_by_seed": [
245
+ 0.730358939221849,
246
+ 0.7711033338024358,
247
+ 0.779483683999293,
248
+ 0.7517102102763772,
249
+ 0.7692747817607265
250
+ ]
251
+ },
252
+ "best_youden_threshold": {
253
+ "n": 5,
254
+ "mean": 0.062353515625,
255
+ "sample_sd": 0.006824156282135741,
256
+ "min": 0.05615234375,
257
+ "max": 0.0703125,
258
+ "values_by_seed": [
259
+ 0.0703125,
260
+ 0.05615234375,
261
+ 0.059326171875,
262
+ 0.069091796875,
263
+ 0.056884765625
264
+ ]
265
+ },
266
+ "near_sheet_auc": {
267
+ "n": 5,
268
+ "mean": 0.8280318453575737,
269
+ "sample_sd": 0.009231196943603448,
270
+ "min": 0.8143528001832432,
271
+ "max": 0.8367763833352335,
272
+ "values_by_seed": [
273
+ 0.8143528001832432,
274
+ 0.8254740480532107,
275
+ 0.8367763833352335,
276
+ 0.8363968246401384,
277
+ 0.8271591705760423
278
+ ]
279
+ },
280
+ "recall_at_fpr_1pct": {
281
+ "n": 5,
282
+ "mean": 0.13569557238322547,
283
+ "sample_sd": 0.02017623042354421,
284
+ "min": 0.10134888289638094,
285
+ "max": 0.15192334391420068,
286
+ "values_by_seed": [
287
+ 0.14209540976102783,
288
+ 0.14770568604344267,
289
+ 0.10134888289638094,
290
+ 0.15192334391420068,
291
+ 0.13540453930107518
292
+ ]
293
+ },
294
+ "recall_at_fpr_5pct": {
295
+ "n": 5,
296
+ "mean": 0.30925894599777387,
297
+ "sample_sd": 0.026434405475942405,
298
+ "min": 0.27634472494246387,
299
+ "max": 0.3486817509179483,
300
+ "values_by_seed": [
301
+ 0.2977748905072135,
302
+ 0.3143299439493597,
303
+ 0.27634472494246387,
304
+ 0.3486817509179483,
305
+ 0.30916341967188415
306
+ ]
307
+ },
308
+ "surface_recall_at_0_5": {
309
+ "n": 5,
310
+ "mean": 0.3177514543361891,
311
+ "sample_sd": 0.005706823328737219,
312
+ "min": 0.31028950257603605,
313
+ "max": 0.32510247994113,
314
+ "values_by_seed": [
315
+ 0.3157559681446238,
316
+ 0.31028950257603605,
317
+ 0.32148352005034087,
318
+ 0.32510247994113,
319
+ 0.3161258009688151
320
+ ]
321
+ }
322
+ }
323
+ },
324
+ {
325
+ "papyrus": 35,
326
+ "pitch_um": 200.0,
327
+ "metrics": {
328
+ "best_youden_recall": {
329
+ "n": 5,
330
+ "mean": 0.7182435656173964,
331
+ "sample_sd": 0.008950684387106365,
332
+ "min": 0.7072436701642336,
333
+ "max": 0.7306229565845499,
334
+ "values_by_seed": [
335
+ 0.7228392069647201,
336
+ 0.7133532447536496,
337
+ 0.7171587496198297,
338
+ 0.7306229565845499,
339
+ 0.7072436701642336
340
+ ]
341
+ },
342
+ "best_youden_threshold": {
343
+ "n": 5,
344
+ "mean": 0.053515625,
345
+ "sample_sd": 0.002356937184794369,
346
+ "min": 0.051513671875,
347
+ "max": 0.05712890625,
348
+ "values_by_seed": [
349
+ 0.051513671875,
350
+ 0.051513671875,
351
+ 0.054443359375,
352
+ 0.052978515625,
353
+ 0.05712890625
354
+ ]
355
+ },
356
+ "near_sheet_auc": {
357
+ "n": 5,
358
+ "mean": 0.7731977187919482,
359
+ "sample_sd": 0.008156678972861422,
360
+ "min": 0.7620244674318167,
361
+ "max": 0.784017572036195,
362
+ "values_by_seed": [
363
+ 0.7620244674318167,
364
+ 0.773087650690336,
365
+ 0.7699584749613332,
366
+ 0.784017572036195,
367
+ 0.7769004288400603
368
+ ]
369
+ },
370
+ "recall_at_fpr_1pct": {
371
+ "n": 5,
372
+ "mean": 0.16580339492092458,
373
+ "sample_sd": 0.015338520817859391,
374
+ "min": 0.14329118194951337,
375
+ "max": 0.18033426475060826,
376
+ "values_by_seed": [
377
+ 0.14329118194951337,
378
+ 0.17607041704683699,
379
+ 0.15707401916058394,
380
+ 0.18033426475060826,
381
+ 0.1722470916970803
382
+ ]
383
+ },
384
+ "recall_at_fpr_5pct": {
385
+ "n": 5,
386
+ "mean": 0.2974688735553528,
387
+ "sample_sd": 0.020508968715963048,
388
+ "min": 0.27224115153588807,
389
+ "max": 0.3197477094738443,
390
+ "values_by_seed": [
391
+ 0.27224115153588807,
392
+ 0.2972530318582725,
393
+ 0.28254923205596105,
394
+ 0.3197477094738443,
395
+ 0.31555324285279807
396
+ ]
397
+ },
398
+ "surface_recall_at_0_5": {
399
+ "n": 5,
400
+ "mean": 0.2733109983272506,
401
+ "sample_sd": 0.009910030067169747,
402
+ "min": 0.26341264636557177,
403
+ "max": 0.2898556303223844,
404
+ "values_by_seed": [
405
+ 0.2729658512013382,
406
+ 0.27092243575121655,
407
+ 0.26341264636557177,
408
+ 0.2898556303223844,
409
+ 0.2693984279957421
410
+ ]
411
+ }
412
+ }
413
+ },
414
+ {
415
+ "papyrus": 35,
416
+ "pitch_um": 260.0,
417
+ "metrics": {
418
+ "best_youden_recall": {
419
+ "n": 5,
420
+ "mean": 0.7777409649896063,
421
+ "sample_sd": 0.008839939285266937,
422
+ "min": 0.7628285030428079,
423
+ "max": 0.7864929358388987,
424
+ "values_by_seed": [
425
+ 0.7864929358388987,
426
+ 0.7805683190743453,
427
+ 0.7795668428080536,
428
+ 0.7628285030428079,
429
+ 0.779248224183926
430
+ ]
431
+ },
432
+ "best_youden_threshold": {
433
+ "n": 5,
434
+ "mean": 0.04443359375,
435
+ "sample_sd": 0.0037306413061367494,
436
+ "min": 0.037841796875,
437
+ "max": 0.046875,
438
+ "values_by_seed": [
439
+ 0.04541015625,
440
+ 0.04638671875,
441
+ 0.037841796875,
442
+ 0.046875,
443
+ 0.045654296875
444
+ ]
445
+ },
446
+ "near_sheet_auc": {
447
+ "n": 5,
448
+ "mean": 0.7120678635262703,
449
+ "sample_sd": 0.005890269238238613,
450
+ "min": 0.7031513659292832,
451
+ "max": 0.7189490737203206,
452
+ "values_by_seed": [
453
+ 0.7189490737203206,
454
+ 0.713108974961786,
455
+ 0.7031513659292832,
456
+ 0.7102903089319346,
457
+ 0.714839594088027
458
+ ]
459
+ },
460
+ "recall_at_fpr_1pct": {
461
+ "n": 5,
462
+ "mean": 0.05609913287458688,
463
+ "sample_sd": 0.002314543175016506,
464
+ "min": 0.052245730269058946,
465
+ "max": 0.05793645199817325,
466
+ "values_by_seed": [
467
+ 0.05637256558474724,
468
+ 0.052245730269058946,
469
+ 0.05793645199817325,
470
+ 0.05607301580251824,
471
+ 0.05786790071843672
472
+ ]
473
+ },
474
+ "recall_at_fpr_5pct": {
475
+ "n": 5,
476
+ "mean": 0.1452640720811879,
477
+ "sample_sd": 0.0044699232898128115,
478
+ "min": 0.14096894820130132,
479
+ "max": 0.1522053236344537,
480
+ "values_by_seed": [
481
+ 0.1470745982750181,
482
+ 0.14323934727595558,
483
+ 0.14283214301921077,
484
+ 0.14096894820130132,
485
+ 0.1522053236344537
486
+ ]
487
+ },
488
+ "surface_recall_at_0_5": {
489
+ "n": 5,
490
+ "mean": 0.25920759548179484,
491
+ "sample_sd": 0.008548302252103852,
492
+ "min": 0.24736270675210795,
493
+ "max": 0.26778133300377227,
494
+ "values_by_seed": [
495
+ 0.26778133300377227,
496
+ 0.2646991805708294,
497
+ 0.24736270675210795,
498
+ 0.2533088061360154,
499
+ 0.26288595094624906
500
+ ]
501
+ }
502
+ }
503
+ },
504
+ {
505
+ "papyrus": 50,
506
+ "pitch_um": 110.0,
507
+ "metrics": {
508
+ "best_youden_recall": {
509
+ "n": 5,
510
+ "mean": 0.9182471828660184,
511
+ "sample_sd": 0.010328300779795402,
512
+ "min": 0.9065890721977563,
513
+ "max": 0.9277342219585745,
514
+ "values_by_seed": [
515
+ 0.9065890721977563,
516
+ 0.9277342219585745,
517
+ 0.9227650288407412,
518
+ 0.9264975721282924,
519
+ 0.9076500192047272
520
+ ]
521
+ },
522
+ "best_youden_threshold": {
523
+ "n": 5,
524
+ "mean": 0.01689453125,
525
+ "sample_sd": 0.0022269051271467536,
526
+ "min": 0.0146484375,
527
+ "max": 0.020263671875,
528
+ "values_by_seed": [
529
+ 0.015380859375,
530
+ 0.017822265625,
531
+ 0.016357421875,
532
+ 0.0146484375,
533
+ 0.020263671875
534
+ ]
535
+ },
536
+ "near_sheet_auc": {
537
+ "n": 5,
538
+ "mean": 0.9329754938547316,
539
+ "sample_sd": 0.0051521235412859715,
540
+ "min": 0.9243245995564835,
541
+ "max": 0.9371863837117801,
542
+ "values_by_seed": [
543
+ 0.9243245995564835,
544
+ 0.9364270024540349,
545
+ 0.9326930601274963,
546
+ 0.9371863837117801,
547
+ 0.934246423423863
548
+ ]
549
+ },
550
+ "recall_at_fpr_1pct": {
551
+ "n": 5,
552
+ "mean": 0.27440541058937606,
553
+ "sample_sd": 0.02653198106408333,
554
+ "min": 0.23108718946148407,
555
+ "max": 0.298888289058305,
556
+ "values_by_seed": [
557
+ 0.23108718946148407,
558
+ 0.2864484810959626,
559
+ 0.2685332828257821,
560
+ 0.2870698105053463,
561
+ 0.298888289058305
562
+ ]
563
+ },
564
+ "recall_at_fpr_5pct": {
565
+ "n": 5,
566
+ "mean": 0.5593033803684904,
567
+ "sample_sd": 0.03066653944501061,
568
+ "min": 0.5159298284746254,
569
+ "max": 0.5862174475066784,
570
+ "values_by_seed": [
571
+ 0.5159298284746254,
572
+ 0.5739610338729084,
573
+ 0.5385289130893556,
574
+ 0.5862174475066784,
575
+ 0.5818796788988841
576
+ ]
577
+ },
578
+ "surface_recall_at_0_5": {
579
+ "n": 5,
580
+ "mean": 0.3208570548168773,
581
+ "sample_sd": 0.014282211180310554,
582
+ "min": 0.29766509936223,
583
+ "max": 0.33282609458532453,
584
+ "values_by_seed": [
585
+ 0.32557276476444524,
586
+ 0.3308705293726568,
587
+ 0.29766509936223,
588
+ 0.3173507859997298,
589
+ 0.33282609458532453
590
+ ]
591
+ }
592
+ }
593
+ },
594
+ {
595
+ "papyrus": 50,
596
+ "pitch_um": 150.0,
597
+ "metrics": {
598
+ "best_youden_recall": {
599
+ "n": 5,
600
+ "mean": 0.8663341725055712,
601
+ "sample_sd": 0.011435777039670803,
602
+ "min": 0.8544306256642658,
603
+ "max": 0.8797631079793387,
604
+ "values_by_seed": [
605
+ 0.8544680590955419,
606
+ 0.8544306256642658,
607
+ 0.8696596353415185,
608
+ 0.8797631079793387,
609
+ 0.8733494344471912
610
+ ]
611
+ },
612
+ "best_youden_threshold": {
613
+ "n": 5,
614
+ "mean": 0.021484375,
615
+ "sample_sd": 0.0018911051495153403,
616
+ "min": 0.018798828125,
617
+ "max": 0.02392578125,
618
+ "values_by_seed": [
619
+ 0.022216796875,
620
+ 0.02392578125,
621
+ 0.020751953125,
622
+ 0.018798828125,
623
+ 0.021728515625
624
+ ]
625
+ },
626
+ "near_sheet_auc": {
627
+ "n": 5,
628
+ "mean": 0.923686059310732,
629
+ "sample_sd": 0.002586496027595273,
630
+ "min": 0.920181410083895,
631
+ "max": 0.9272754595628556,
632
+ "values_by_seed": [
633
+ 0.920181410083895,
634
+ 0.9229620735113581,
635
+ 0.9272754595628556,
636
+ 0.9233480216042601,
637
+ 0.9246633317912911
638
+ ]
639
+ },
640
+ "recall_at_fpr_1pct": {
641
+ "n": 5,
642
+ "mean": 0.35759332415029665,
643
+ "sample_sd": 0.016982047705787654,
644
+ "min": 0.33006833259651075,
645
+ "max": 0.3738116662473175,
646
+ "values_by_seed": [
647
+ 0.3546921858422972,
648
+ 0.36126554375849657,
649
+ 0.36812889230686124,
650
+ 0.33006833259651075,
651
+ 0.3738116662473175
652
+ ]
653
+ },
654
+ "recall_at_fpr_5pct": {
655
+ "n": 5,
656
+ "mean": 0.614111882366153,
657
+ "sample_sd": 0.012553599162070397,
658
+ "min": 0.5942171034769024,
659
+ "max": 0.6282732337224989,
660
+ "values_by_seed": [
661
+ 0.6140452129512091,
662
+ 0.6199445321839848,
663
+ 0.6282732337224989,
664
+ 0.5942171034769024,
665
+ 0.6140793294961697
666
+ ]
667
+ },
668
+ "surface_recall_at_0_5": {
669
+ "n": 5,
670
+ "mean": 0.35666326922739766,
671
+ "sample_sd": 0.012744410850476215,
672
+ "min": 0.3361590835537878,
673
+ "max": 0.3687010551963052,
674
+ "values_by_seed": [
675
+ 0.3537468732423464,
676
+ 0.3600029946745021,
677
+ 0.3647063394700469,
678
+ 0.3361590835537878,
679
+ 0.3687010551963052
680
+ ]
681
+ }
682
+ }
683
+ },
684
+ {
685
+ "papyrus": 50,
686
+ "pitch_um": 200.0,
687
+ "metrics": {
688
+ "best_youden_recall": {
689
+ "n": 5,
690
+ "mean": 0.8533053432937956,
691
+ "sample_sd": 0.004915032477850661,
692
+ "min": 0.8479112017183699,
693
+ "max": 0.8590893970498783,
694
+ "values_by_seed": [
695
+ 0.8550624429744526,
696
+ 0.8590893970498783,
697
+ 0.8560190465328467,
698
+ 0.8484446281934307,
699
+ 0.8479112017183699
700
+ ]
701
+ },
702
+ "best_youden_threshold": {
703
+ "n": 5,
704
+ "mean": 0.013671875,
705
+ "sample_sd": 0.0010500885335745394,
706
+ "min": 0.0126953125,
707
+ "max": 0.015380859375,
708
+ "values_by_seed": [
709
+ 0.01318359375,
710
+ 0.01318359375,
711
+ 0.015380859375,
712
+ 0.0126953125,
713
+ 0.013916015625
714
+ ]
715
+ },
716
+ "near_sheet_auc": {
717
+ "n": 5,
718
+ "mean": 0.8515864816761971,
719
+ "sample_sd": 0.0065692013176396336,
720
+ "min": 0.8416606483848806,
721
+ "max": 0.857794173671184,
722
+ "values_by_seed": [
723
+ 0.8517382158570956,
724
+ 0.8571891985705125,
725
+ 0.857794173671184,
726
+ 0.8495501718973122,
727
+ 0.8416606483848806
728
+ ]
729
+ },
730
+ "recall_at_fpr_1pct": {
731
+ "n": 5,
732
+ "mean": 0.13919475174878346,
733
+ "sample_sd": 0.006831348052252065,
734
+ "min": 0.131709293263382,
735
+ "max": 0.14636842305352799,
736
+ "values_by_seed": [
737
+ 0.14636842305352799,
738
+ 0.1442656059914842,
739
+ 0.14140529957420925,
740
+ 0.131709293263382,
741
+ 0.13222513686131387
742
+ ]
743
+ },
744
+ "recall_at_fpr_5pct": {
745
+ "n": 5,
746
+ "mean": 0.32092352874087593,
747
+ "sample_sd": 0.011612871353801686,
748
+ "min": 0.30162308964416057,
749
+ "max": 0.3305471601277372,
750
+ "values_by_seed": [
751
+ 0.3276992092457421,
752
+ 0.3258522943278589,
753
+ 0.3305471601277372,
754
+ 0.3188958903588808,
755
+ 0.30162308964416057
756
+ ]
757
+ },
758
+ "surface_recall_at_0_5": {
759
+ "n": 5,
760
+ "mean": 0.2942360002281022,
761
+ "sample_sd": 0.006507609123985453,
762
+ "min": 0.2875004752128954,
763
+ "max": 0.30457843864051093,
764
+ "values_by_seed": [
765
+ 0.2904686549574209,
766
+ 0.29551137659671534,
767
+ 0.30457843864051093,
768
+ 0.2875004752128954,
769
+ 0.29312105573296837
770
+ ]
771
+ }
772
+ }
773
+ },
774
+ {
775
+ "papyrus": 50,
776
+ "pitch_um": 260.0,
777
+ "metrics": {
778
+ "best_youden_recall": {
779
+ "n": 5,
780
+ "mean": 0.9027666717195075,
781
+ "sample_sd": 0.005880731873285525,
782
+ "min": 0.8947448202749582,
783
+ "max": 0.9106822686804651,
784
+ "values_by_seed": [
785
+ 0.9033518679258217,
786
+ 0.8947448202749582,
787
+ 0.9048583064358066,
788
+ 0.9106822686804651,
789
+ 0.9001960952804857
790
+ ]
791
+ },
792
+ "best_youden_threshold": {
793
+ "n": 5,
794
+ "mean": 0.035009765625,
795
+ "sample_sd": 0.0016157609480248337,
796
+ "min": 0.03271484375,
797
+ "max": 0.03662109375,
798
+ "values_by_seed": [
799
+ 0.0341796875,
800
+ 0.036376953125,
801
+ 0.03662109375,
802
+ 0.03271484375,
803
+ 0.03515625
804
+ ]
805
+ },
806
+ "near_sheet_auc": {
807
+ "n": 5,
808
+ "mean": 0.785642882037195,
809
+ "sample_sd": 0.004378811661534529,
810
+ "min": 0.779891566409677,
811
+ "max": 0.789344207150282,
812
+ "values_by_seed": [
813
+ 0.779891566409677,
814
+ 0.789344207150282,
815
+ 0.7893058314602889,
816
+ 0.782079546535479,
817
+ 0.787593258630248
818
+ ]
819
+ },
820
+ "recall_at_fpr_1pct": {
821
+ "n": 5,
822
+ "mean": 0.04674806246083646,
823
+ "sample_sd": 0.004345535416891844,
824
+ "min": 0.042419000869925394,
825
+ "max": 0.05279269224047789,
826
+ "values_by_seed": [
827
+ 0.042419000869925394,
828
+ 0.05279269224047789,
829
+ 0.04866151212536967,
830
+ 0.047170763168845664,
831
+ 0.042696343899563685
832
+ ]
833
+ },
834
+ "recall_at_fpr_5pct": {
835
+ "n": 5,
836
+ "mean": 0.188971354254669,
837
+ "sample_sd": 0.003683411745320408,
838
+ "min": 0.18461921695128322,
839
+ "max": 0.19365277907853562,
840
+ "values_by_seed": [
841
+ 0.1859410014859214,
842
+ 0.18461921695128322,
843
+ 0.19086148682898194,
844
+ 0.18978228692862267,
845
+ 0.19365277907853562
846
+ ]
847
+ },
848
+ "surface_recall_at_0_5": {
849
+ "n": 5,
850
+ "mean": 0.3172652191082347,
851
+ "sample_sd": 0.004056291401508754,
852
+ "min": 0.3128226617013655,
853
+ "max": 0.32202639513923154,
854
+ "values_by_seed": [
855
+ 0.3209947466547458,
856
+ 0.3144331340196829,
857
+ 0.32202639513923154,
858
+ 0.3128226617013655,
859
+ 0.31604915802614797
860
+ ]
861
+ }
862
+ }
863
+ },
864
+ {
865
+ "papyrus": 65,
866
+ "pitch_um": 110.0,
867
+ "metrics": {
868
+ "best_youden_recall": {
869
+ "n": 5,
870
+ "mean": 0.9442509122846318,
871
+ "sample_sd": 0.00572126996161444,
872
+ "min": 0.9364309108136315,
873
+ "max": 0.9519480419590841,
874
+ "values_by_seed": [
875
+ 0.9519480419590841,
876
+ 0.9419264913227803,
877
+ 0.9465079845035398,
878
+ 0.9364309108136315,
879
+ 0.9444411328241237
880
+ ]
881
+ },
882
+ "best_youden_threshold": {
883
+ "n": 5,
884
+ "mean": 0.012939453125,
885
+ "sample_sd": 0.0009134905729428568,
886
+ "min": 0.01171875,
887
+ "max": 0.013671875,
888
+ "values_by_seed": [
889
+ 0.01171875,
890
+ 0.013671875,
891
+ 0.01220703125,
892
+ 0.013427734375,
893
+ 0.013671875
894
+ ]
895
+ },
896
+ "near_sheet_auc": {
897
+ "n": 5,
898
+ "mean": 0.925949308046342,
899
+ "sample_sd": 0.0023056506510992494,
900
+ "min": 0.9223103339969563,
901
+ "max": 0.9282440681804124,
902
+ "values_by_seed": [
903
+ 0.9273111483624373,
904
+ 0.9282440681804124,
905
+ 0.9223103339969563,
906
+ 0.925269197928377,
907
+ 0.9266117917635269
908
+ ]
909
+ },
910
+ "recall_at_fpr_1pct": {
911
+ "n": 5,
912
+ "mean": 0.19443509979968435,
913
+ "sample_sd": 0.017017348253264248,
914
+ "min": 0.17211353430916101,
915
+ "max": 0.21340489958499523,
916
+ "values_by_seed": [
917
+ 0.21340489958499523,
918
+ 0.17211353430916101,
919
+ 0.20097037953251992,
920
+ 0.2040789494557539,
921
+ 0.18160773611599174
922
+ ]
923
+ },
924
+ "recall_at_fpr_5pct": {
925
+ "n": 5,
926
+ "mean": 0.4762754078060126,
927
+ "sample_sd": 0.004872150946319605,
928
+ "min": 0.46772355960940615,
929
+ "max": 0.4792187545818537,
930
+ "values_by_seed": [
931
+ 0.47681732242357405,
932
+ 0.4792187545818537,
933
+ 0.46772355960940615,
934
+ 0.4789209491125205,
935
+ 0.4786964533027083
936
+ ]
937
+ },
938
+ "surface_recall_at_0_5": {
939
+ "n": 5,
940
+ "mean": 0.3348013212083162,
941
+ "sample_sd": 0.0066956774844904735,
942
+ "min": 0.32532303120299466,
943
+ "max": 0.343106752805116,
944
+ "values_by_seed": [
945
+ 0.32532303120299466,
946
+ 0.33300588352080573,
947
+ 0.33882330545322914,
948
+ 0.3337476330594356,
949
+ 0.343106752805116
950
+ ]
951
+ }
952
+ }
953
+ },
954
+ {
955
+ "papyrus": 65,
956
+ "pitch_um": 150.0,
957
+ "metrics": {
958
+ "best_youden_recall": {
959
+ "n": 5,
960
+ "mean": 0.9676016495349489,
961
+ "sample_sd": 0.0024379365061452957,
962
+ "min": 0.964896681360473,
963
+ "max": 0.9708246679678337,
964
+ "values_by_seed": [
965
+ 0.9708246679678337,
966
+ 0.964896681360473,
967
+ 0.9684398267069052,
968
+ 0.9654323585004452,
969
+ 0.968414713139087
970
+ ]
971
+ },
972
+ "best_youden_threshold": {
973
+ "n": 5,
974
+ "mean": 0.008154296875,
975
+ "sample_sd": 0.0007033623188910124,
976
+ "min": 0.007568359375,
977
+ "max": 0.009033203125,
978
+ "values_by_seed": [
979
+ 0.007568359375,
980
+ 0.009033203125,
981
+ 0.0078125,
982
+ 0.0087890625,
983
+ 0.007568359375
984
+ ]
985
+ },
986
+ "near_sheet_auc": {
987
+ "n": 5,
988
+ "mean": 0.9798949634267238,
989
+ "sample_sd": 0.0013473365683890396,
990
+ "min": 0.9787235280235818,
991
+ "max": 0.9814689740301623,
992
+ "values_by_seed": [
993
+ 0.981241648424781,
994
+ 0.9792046929297363,
995
+ 0.9788359737253582,
996
+ 0.9787235280235818,
997
+ 0.9814689740301623
998
+ ]
999
+ },
1000
+ "recall_at_fpr_1pct": {
1001
+ "n": 5,
1002
+ "mean": 0.5215664422082312,
1003
+ "sample_sd": 0.009032990872568643,
1004
+ "min": 0.5129386996763193,
1005
+ "max": 0.5331868691104538,
1006
+ "values_by_seed": [
1007
+ 0.5283150738741659,
1008
+ 0.5201538750945905,
1009
+ 0.5132376932856271,
1010
+ 0.5129386996763193,
1011
+ 0.5331868691104538
1012
+ ]
1013
+ },
1014
+ "recall_at_fpr_5pct": {
1015
+ "n": 5,
1016
+ "mean": 0.8812906288958606,
1017
+ "sample_sd": 0.014892334985102118,
1018
+ "min": 0.8674209739989281,
1019
+ "max": 0.9003299354202234,
1020
+ "values_by_seed": [
1021
+ 0.894033300590927,
1022
+ 0.8745096338963038,
1023
+ 0.8674209739989281,
1024
+ 0.870159300572921,
1025
+ 0.9003299354202234
1026
+ ]
1027
+ },
1028
+ "surface_recall_at_0_5": {
1029
+ "n": 5,
1030
+ "mean": 0.412491772937335,
1031
+ "sample_sd": 0.0034803416095392082,
1032
+ "min": 0.40682487266710354,
1033
+ "max": 0.41517466012576687,
1034
+ "values_by_seed": [
1035
+ 0.40682487266710354,
1036
+ 0.4141265240500319,
1037
+ 0.4114995500880633,
1038
+ 0.41517466012576687,
1039
+ 0.41483325775570945
1040
+ ]
1041
+ }
1042
+ }
1043
+ },
1044
+ {
1045
+ "papyrus": 65,
1046
+ "pitch_um": 200.0,
1047
+ "metrics": {
1048
+ "best_youden_recall": {
1049
+ "n": 5,
1050
+ "mean": 0.9534663454227494,
1051
+ "sample_sd": 0.002098682965952258,
1052
+ "min": 0.9513576832420925,
1053
+ "max": 0.9565035260796837,
1054
+ "values_by_seed": [
1055
+ 0.9517896517639902,
1056
+ 0.9531863024635037,
1057
+ 0.9513576832420925,
1058
+ 0.9565035260796837,
1059
+ 0.9544945635644769
1060
+ ]
1061
+ },
1062
+ "best_youden_threshold": {
1063
+ "n": 5,
1064
+ "mean": 0.012646484375,
1065
+ "sample_sd": 0.0004011639825477291,
1066
+ "min": 0.01220703125,
1067
+ "max": 0.012939453125,
1068
+ "values_by_seed": [
1069
+ 0.012939453125,
1070
+ 0.012939453125,
1071
+ 0.012939453125,
1072
+ 0.01220703125,
1073
+ 0.01220703125
1074
+ ]
1075
+ },
1076
+ "near_sheet_auc": {
1077
+ "n": 5,
1078
+ "mean": 0.8922975958186949,
1079
+ "sample_sd": 0.0025878785758021903,
1080
+ "min": 0.8880090956020595,
1081
+ "max": 0.8949404114736833,
1082
+ "values_by_seed": [
1083
+ 0.8933130298214454,
1084
+ 0.8949404114736833,
1085
+ 0.8929152432466,
1086
+ 0.8923101989496864,
1087
+ 0.8880090956020595
1088
+ ]
1089
+ },
1090
+ "recall_at_fpr_1pct": {
1091
+ "n": 5,
1092
+ "mean": 0.08816544061739659,
1093
+ "sample_sd": 0.005585739408540686,
1094
+ "min": 0.07999329949817519,
1095
+ "max": 0.09336103824513382,
1096
+ "values_by_seed": [
1097
+ 0.09336103824513382,
1098
+ 0.09035175258515815,
1099
+ 0.07999329949817519,
1100
+ 0.08495974946776155,
1101
+ 0.09216136329075426
1102
+ ]
1103
+ },
1104
+ "recall_at_fpr_5pct": {
1105
+ "n": 5,
1106
+ "mean": 0.2839723996350365,
1107
+ "sample_sd": 0.011399589006420092,
1108
+ "min": 0.2732027448296837,
1109
+ "max": 0.30213085462287104,
1110
+ "values_by_seed": [
1111
+ 0.28680119943734794,
1112
+ 0.30213085462287104,
1113
+ 0.27622866294099757,
1114
+ 0.28149853634428224,
1115
+ 0.2732027448296837
1116
+ ]
1117
+ },
1118
+ "surface_recall_at_0_5": {
1119
+ "n": 5,
1120
+ "mean": 0.3171210652372262,
1121
+ "sample_sd": 0.005614390108867826,
1122
+ "min": 0.31271931075121656,
1123
+ "max": 0.32494440009124087,
1124
+ "values_by_seed": [
1125
+ 0.31377071928223843,
1126
+ 0.32494440009124087,
1127
+ 0.31294551208941607,
1128
+ 0.32122538397201944,
1129
+ 0.31271931075121656
1130
+ ]
1131
+ }
1132
+ }
1133
+ },
1134
+ {
1135
+ "papyrus": 65,
1136
+ "pitch_um": 260.0,
1137
+ "metrics": {
1138
+ "best_youden_recall": {
1139
+ "n": 5,
1140
+ "mean": 0.9313663139011374,
1141
+ "sample_sd": 0.0037643988266445913,
1142
+ "min": 0.9271777824336863,
1143
+ "max": 0.9373769576942053,
1144
+ "values_by_seed": [
1145
+ 0.9373769576942053,
1146
+ 0.9303929340044278,
1147
+ 0.9271777824336863,
1148
+ 0.9318648554967989,
1149
+ 0.9300190398765691
1150
+ ]
1151
+ },
1152
+ "best_youden_threshold": {
1153
+ "n": 5,
1154
+ "mean": 0.036669921875,
1155
+ "sample_sd": 0.0017723331457892124,
1156
+ "min": 0.03466796875,
1157
+ "max": 0.039306640625,
1158
+ "values_by_seed": [
1159
+ 0.03466796875,
1160
+ 0.03564453125,
1161
+ 0.039306640625,
1162
+ 0.037353515625,
1163
+ 0.036376953125
1164
+ ]
1165
+ },
1166
+ "near_sheet_auc": {
1167
+ "n": 5,
1168
+ "mean": 0.8079613747540144,
1169
+ "sample_sd": 0.0038761165886561366,
1170
+ "min": 0.8014965624532725,
1171
+ "max": 0.8108617375611977,
1172
+ "values_by_seed": [
1173
+ 0.8072368910198662,
1174
+ 0.8014965624532725,
1175
+ 0.8098152678475685,
1176
+ 0.8103964148881666,
1177
+ 0.8108617375611977
1178
+ ]
1179
+ },
1180
+ "recall_at_fpr_1pct": {
1181
+ "n": 5,
1182
+ "mean": 0.033527513683704394,
1183
+ "sample_sd": 0.0014273141208396374,
1184
+ "min": 0.03132359004017491,
1185
+ "max": 0.034661844261147545,
1186
+ "values_by_seed": [
1187
+ 0.034661844261147545,
1188
+ 0.034177157748080805,
1189
+ 0.03287299378886785,
1190
+ 0.03460198258025086,
1191
+ 0.03132359004017491
1192
+ ]
1193
+ },
1194
+ "recall_at_fpr_5pct": {
1195
+ "n": 5,
1196
+ "mean": 0.18338794907122669,
1197
+ "sample_sd": 0.00368246093505422,
1198
+ "min": 0.1781782931889959,
1199
+ "max": 0.18815274576840674,
1200
+ "values_by_seed": [
1201
+ 0.18815274576840674,
1202
+ 0.1781782931889959,
1203
+ 0.18186220034159778,
1204
+ 0.18462694103914085,
1205
+ 0.1841195650179923
1206
+ ]
1207
+ },
1208
+ "surface_recall_at_0_5": {
1209
+ "n": 5,
1210
+ "mean": 0.34417082399603754,
1211
+ "sample_sd": 0.005320906510067709,
1212
+ "min": 0.3357726163706249,
1213
+ "max": 0.34985676644578995,
1214
+ "values_by_seed": [
1215
+ 0.34733774829321795,
1216
+ 0.3357726163706249,
1217
+ 0.34985676644578995,
1218
+ 0.34430097487643874,
1219
+ 0.3435860139941162
1220
+ ]
1221
+ }
1222
+ }
1223
+ },
1224
+ {
1225
+ "papyrus": 90,
1226
+ "pitch_um": 110.0,
1227
+ "metrics": {
1228
+ "best_youden_recall": {
1229
+ "n": 5,
1230
+ "mean": 0.92586009055786,
1231
+ "sample_sd": 0.003008403884052391,
1232
+ "min": 0.9207171655649387,
1233
+ "max": 0.9285002478106852,
1234
+ "values_by_seed": [
1235
+ 0.9273732019303755,
1236
+ 0.9285002478106852,
1237
+ 0.9207171655649387,
1238
+ 0.9263185042714294,
1239
+ 0.9263913332118716
1240
+ ]
1241
+ },
1242
+ "best_youden_threshold": {
1243
+ "n": 5,
1244
+ "mean": 0.025732421875,
1245
+ "sample_sd": 0.0007445288418934036,
1246
+ "min": 0.025146484375,
1247
+ "max": 0.02685546875,
1248
+ "values_by_seed": [
1249
+ 0.025390625,
1250
+ 0.026123046875,
1251
+ 0.02685546875,
1252
+ 0.025146484375,
1253
+ 0.025146484375
1254
+ ]
1255
+ },
1256
+ "near_sheet_auc": {
1257
+ "n": 5,
1258
+ "mean": 0.9005692332641138,
1259
+ "sample_sd": 0.00273338662463309,
1260
+ "min": 0.8977563566707059,
1261
+ "max": 0.9036636467066524,
1262
+ "values_by_seed": [
1263
+ 0.8978931208673863,
1264
+ 0.8977563566707059,
1265
+ 0.9028549526823652,
1266
+ 0.9006780893934592,
1267
+ 0.9036636467066524
1268
+ ]
1269
+ },
1270
+ "recall_at_fpr_1pct": {
1271
+ "n": 5,
1272
+ "mean": 0.06964581098991116,
1273
+ "sample_sd": 0.009862125895304875,
1274
+ "min": 0.05547618349431814,
1275
+ "max": 0.08244187986157213,
1276
+ "values_by_seed": [
1277
+ 0.0671766455134248,
1278
+ 0.05547618349431814,
1279
+ 0.08244187986157213,
1280
+ 0.07391752879627463,
1281
+ 0.06921681728396605
1282
+ ]
1283
+ },
1284
+ "recall_at_fpr_5pct": {
1285
+ "n": 5,
1286
+ "mean": 0.3780779601358897,
1287
+ "sample_sd": 0.015886184421319137,
1288
+ "min": 0.3554612331309666,
1289
+ "max": 0.39863509431948685,
1290
+ "values_by_seed": [
1291
+ 0.37272962388058556,
1292
+ 0.3554612331309666,
1293
+ 0.39863509431948685,
1294
+ 0.378673234571201,
1295
+ 0.3848906147772083
1296
+ ]
1297
+ },
1298
+ "surface_recall_at_0_5": {
1299
+ "n": 5,
1300
+ "mean": 0.3621248167859411,
1301
+ "sample_sd": 0.009995691398473555,
1302
+ "min": 0.3491525162999822,
1303
+ "max": 0.3769171677762464,
1304
+ "values_by_seed": [
1305
+ 0.36316860212179786,
1306
+ 0.3626126505071346,
1307
+ 0.3769171677762464,
1308
+ 0.35877314722454434,
1309
+ 0.3491525162999822
1310
+ ]
1311
+ }
1312
+ }
1313
+ },
1314
+ {
1315
+ "papyrus": 90,
1316
+ "pitch_um": 150.0,
1317
+ "metrics": {
1318
+ "best_youden_recall": {
1319
+ "n": 5,
1320
+ "mean": 0.9677863527186383,
1321
+ "sample_sd": 0.0022024557786521643,
1322
+ "min": 0.964162227962015,
1323
+ "max": 0.969668259245939,
1324
+ "values_by_seed": [
1325
+ 0.964162227962015,
1326
+ 0.9675103877771791,
1327
+ 0.9682410504484193,
1328
+ 0.9693498381596398,
1329
+ 0.969668259245939
1330
+ ]
1331
+ },
1332
+ "best_youden_threshold": {
1333
+ "n": 5,
1334
+ "mean": 0.01455078125,
1335
+ "sample_sd": 0.0004085254035810916,
1336
+ "min": 0.01416015625,
1337
+ "max": 0.01513671875,
1338
+ "values_by_seed": [
1339
+ 0.0146484375,
1340
+ 0.01416015625,
1341
+ 0.01513671875,
1342
+ 0.01416015625,
1343
+ 0.0146484375
1344
+ ]
1345
+ },
1346
+ "near_sheet_auc": {
1347
+ "n": 5,
1348
+ "mean": 0.9800285884040416,
1349
+ "sample_sd": 0.0006520135967188564,
1350
+ "min": 0.979308049128558,
1351
+ "max": 0.9809261311721641,
1352
+ "values_by_seed": [
1353
+ 0.979308049128558,
1354
+ 0.9796954790067287,
1355
+ 0.9797512678516079,
1356
+ 0.9804620148611497,
1357
+ 0.9809261311721641
1358
+ ]
1359
+ },
1360
+ "recall_at_fpr_1pct": {
1361
+ "n": 5,
1362
+ "mean": 0.5688362893898019,
1363
+ "sample_sd": 0.010426322719884189,
1364
+ "min": 0.5593841110720982,
1365
+ "max": 0.5809270507715788,
1366
+ "values_by_seed": [
1367
+ 0.5791340367975368,
1368
+ 0.5593841110720982,
1369
+ 0.5601789791855907,
1370
+ 0.5645572691222049,
1371
+ 0.5809270507715788
1372
+ ]
1373
+ },
1374
+ "recall_at_fpr_5pct": {
1375
+ "n": 5,
1376
+ "mean": 0.8670746910675777,
1377
+ "sample_sd": 0.007177386285870165,
1378
+ "min": 0.8580192597373121,
1379
+ "max": 0.8749351430265071,
1380
+ "values_by_seed": [
1381
+ 0.8580192597373121,
1382
+ 0.8647774156053815,
1383
+ 0.8637761897789674,
1384
+ 0.8738654471897207,
1385
+ 0.8749351430265071
1386
+ ]
1387
+ },
1388
+ "surface_recall_at_0_5": {
1389
+ "n": 5,
1390
+ "mean": 0.4475626334750592,
1391
+ "sample_sd": 0.005884033560130355,
1392
+ "min": 0.44061067667797726,
1393
+ "max": 0.454524777851539,
1394
+ "values_by_seed": [
1395
+ 0.454524777851539,
1396
+ 0.44061067667797726,
1397
+ 0.4426372942168192,
1398
+ 0.44838498436088103,
1399
+ 0.4516554342680793
1400
+ ]
1401
+ }
1402
+ }
1403
+ },
1404
+ {
1405
+ "papyrus": 90,
1406
+ "pitch_um": 200.0,
1407
+ "metrics": {
1408
+ "best_youden_recall": {
1409
+ "n": 5,
1410
+ "mean": 0.9758580919251825,
1411
+ "sample_sd": 0.0009063152556215596,
1412
+ "min": 0.9744017069647202,
1413
+ "max": 0.976681540830292,
1414
+ "values_by_seed": [
1415
+ 0.9744017069647202,
1416
+ 0.975650804060219,
1417
+ 0.9764909804592458,
1418
+ 0.9760654273114355,
1419
+ 0.976681540830292
1420
+ ]
1421
+ },
1422
+ "best_youden_threshold": {
1423
+ "n": 5,
1424
+ "mean": 0.015673828125,
1425
+ "sample_sd": 0.0005828777532379552,
1426
+ "min": 0.014892578125,
1427
+ "max": 0.016357421875,
1428
+ "values_by_seed": [
1429
+ 0.016357421875,
1430
+ 0.015625,
1431
+ 0.014892578125,
1432
+ 0.01611328125,
1433
+ 0.015380859375
1434
+ ]
1435
+ },
1436
+ "near_sheet_auc": {
1437
+ "n": 5,
1438
+ "mean": 0.9093025183613597,
1439
+ "sample_sd": 0.0017662508083241544,
1440
+ "min": 0.9064512890766016,
1441
+ "max": 0.9111407880002165,
1442
+ "values_by_seed": [
1443
+ 0.9091175695149515,
1444
+ 0.9095712260946959,
1445
+ 0.9111407880002165,
1446
+ 0.9102317191203324,
1447
+ 0.9064512890766016
1448
+ ]
1449
+ },
1450
+ "recall_at_fpr_1pct": {
1451
+ "n": 5,
1452
+ "mean": 0.08319362074209244,
1453
+ "sample_sd": 0.0015858291324871814,
1454
+ "min": 0.08109579341545012,
1455
+ "max": 0.08508995780109489,
1456
+ "values_by_seed": [
1457
+ 0.08508995780109489,
1458
+ 0.08109579341545012,
1459
+ 0.0841485610553528,
1460
+ 0.08215860705596106,
1461
+ 0.0834751843826034
1462
+ ]
1463
+ },
1464
+ "recall_at_fpr_5pct": {
1465
+ "n": 5,
1466
+ "mean": 0.3321389332420925,
1467
+ "sample_sd": 0.0052442761214303545,
1468
+ "min": 0.3268704379562044,
1469
+ "max": 0.3409101277372263,
1470
+ "values_by_seed": [
1471
+ 0.3303397296989051,
1472
+ 0.3307256025699513,
1473
+ 0.3409101277372263,
1474
+ 0.33184876824817516,
1475
+ 0.3268704379562044
1476
+ ]
1477
+ },
1478
+ "surface_recall_at_0_5": {
1479
+ "n": 5,
1480
+ "mean": 0.3576241731295621,
1481
+ "sample_sd": 0.001962464937252688,
1482
+ "min": 0.3542132375304136,
1483
+ "max": 0.35890857854318736,
1484
+ "values_by_seed": [
1485
+ 0.3585371996654501,
1486
+ 0.3587557975973236,
1487
+ 0.35890857854318736,
1488
+ 0.35770605231143554,
1489
+ 0.3542132375304136
1490
+ ]
1491
+ }
1492
+ }
1493
+ },
1494
+ {
1495
+ "papyrus": 90,
1496
+ "pitch_um": 260.0,
1497
+ "metrics": {
1498
+ "best_youden_recall": {
1499
+ "n": 5,
1500
+ "mean": 0.9458832059985266,
1501
+ "sample_sd": 0.002911722003875682,
1502
+ "min": 0.9435277454063401,
1503
+ "max": 0.950525527627614,
1504
+ "values_by_seed": [
1505
+ 0.94695893005935,
1506
+ 0.950525527627614,
1507
+ 0.9435277454063401,
1508
+ 0.944237154600515,
1509
+ 0.944166672298814
1510
+ ]
1511
+ },
1512
+ "best_youden_threshold": {
1513
+ "n": 5,
1514
+ "mean": 0.04814453125,
1515
+ "sample_sd": 0.0027642929403746412,
1516
+ "min": 0.043701171875,
1517
+ "max": 0.051025390625,
1518
+ "values_by_seed": [
1519
+ 0.047607421875,
1520
+ 0.043701171875,
1521
+ 0.04931640625,
1522
+ 0.049072265625,
1523
+ 0.051025390625
1524
+ ]
1525
+ },
1526
+ "near_sheet_auc": {
1527
+ "n": 5,
1528
+ "mean": 0.8467167568400467,
1529
+ "sample_sd": 0.0011567145653170493,
1530
+ "min": 0.8450371870144071,
1531
+ "max": 0.8479436972595346,
1532
+ "values_by_seed": [
1533
+ 0.8450371870144071,
1534
+ 0.8479436972595346,
1535
+ 0.8466357117094525,
1536
+ 0.8463215351301117,
1537
+ 0.8476456530867273
1538
+ ]
1539
+ },
1540
+ "recall_at_fpr_1pct": {
1541
+ "n": 5,
1542
+ "mean": 0.030588739631618938,
1543
+ "sample_sd": 0.000713486007457848,
1544
+ "min": 0.029436016069964786,
1545
+ "max": 0.031330831372541446,
1546
+ "values_by_seed": [
1547
+ 0.03087993774385187,
1548
+ 0.031330831372541446,
1549
+ 0.03046838868768713,
1550
+ 0.030828524284049467,
1551
+ 0.029436016069964786
1552
+ ]
1553
+ },
1554
+ "recall_at_fpr_5pct": {
1555
+ "n": 5,
1556
+ "mean": 0.2346922095815379,
1557
+ "sample_sd": 0.0037242811766484475,
1558
+ "min": 0.22944571945533596,
1559
+ "max": 0.23964827400429267,
1560
+ "values_by_seed": [
1561
+ 0.22944571945533596,
1562
+ 0.23964827400429267,
1563
+ 0.23383251860298285,
1564
+ 0.23626536490039307,
1565
+ 0.2342691709446849
1566
+ ]
1567
+ },
1568
+ "surface_recall_at_0_5": {
1569
+ "n": 5,
1570
+ "mean": 0.4499706001905919,
1571
+ "sample_sd": 0.0036286706339048076,
1572
+ "min": 0.4458119030124908,
1573
+ "max": 0.45415126274353806,
1574
+ "values_by_seed": [
1575
+ 0.4469058269553287,
1576
+ 0.4458119030124908,
1577
+ 0.4528837882016489,
1578
+ 0.45010022003995287,
1579
+ 0.45415126274353806
1580
+ ]
1581
+ }
1582
+ }
1583
+ }
1584
+ ],
1585
+ "pitch_summaries": {
1586
+ "surface_recall_at_0_5": {
1587
+ "260": {
1588
+ "n": 5,
1589
+ "mean": 0.3426535596941648,
1590
+ "sample_sd": 0.0024764162033103316,
1591
+ "min": 0.34013316568844315,
1592
+ "max": 0.3457549137267662,
1593
+ "values_by_seed": [
1594
+ 0.3457549137267662,
1595
+ 0.340179208493407,
1596
+ 0.34303241413469454,
1597
+ 0.34013316568844315,
1598
+ 0.34416809642751284
1599
+ ]
1600
+ },
1601
+ "200": {
1602
+ "n": 5,
1603
+ "mean": 0.31057305923053524,
1604
+ "sample_sd": 0.002713165156488845,
1605
+ "min": 0.30736300800258515,
1606
+ "max": 0.3140718854546837,
1607
+ "values_by_seed": [
1608
+ 0.30893560627661193,
1609
+ 0.3125335025091241,
1610
+ 0.30996129390967153,
1611
+ 0.3140718854546837,
1612
+ 0.30736300800258515
1613
+ ]
1614
+ },
1615
+ "150": {
1616
+ "n": 5,
1617
+ "mean": 0.3836172824939953,
1618
+ "sample_sd": 0.0028322316846142006,
1619
+ "min": 0.3812053019953915,
1620
+ "max": 0.3878288870472273,
1621
+ "values_by_seed": [
1622
+ 0.38271312297640314,
1623
+ 0.38125742449463684,
1624
+ 0.3850816759563176,
1625
+ 0.3812053019953915,
1626
+ 0.3878288870472273
1627
+ ]
1628
+ },
1629
+ "110": {
1630
+ "n": 5,
1631
+ "mean": 0.34100224880385077,
1632
+ "sample_sd": 0.0008151687766335423,
1633
+ "min": 0.3399471064797567,
1634
+ "max": 0.3419086205910249,
1635
+ "values_by_seed": [
1636
+ 0.34042530178341973,
1637
+ 0.3411131506953361,
1638
+ 0.3399471064797567,
1639
+ 0.34161706446971635,
1640
+ 0.3419086205910249
1641
+ ]
1642
+ }
1643
+ },
1644
+ "near_sheet_auc": {
1645
+ "260": {
1646
+ "n": 5,
1647
+ "mean": 0.7880972192893816,
1648
+ "sample_sd": 0.0012374820041921167,
1649
+ "min": 0.7872270442366482,
1650
+ "max": 0.7902350608415499,
1651
+ "values_by_seed": [
1652
+ 0.7877786795410677,
1653
+ 0.7879733604562188,
1654
+ 0.7872270442366482,
1655
+ 0.7872719513714228,
1656
+ 0.7902350608415499
1657
+ ]
1658
+ },
1659
+ "200": {
1660
+ "n": 5,
1661
+ "mean": 0.8565960786620499,
1662
+ "sample_sd": 0.0027302106047320304,
1663
+ "min": 0.8532553654759004,
1664
+ "max": 0.8590274155008815,
1665
+ "values_by_seed": [
1666
+ 0.8540483206563273,
1667
+ 0.8586971217073069,
1668
+ 0.8579521699698334,
1669
+ 0.8590274155008815,
1670
+ 0.8532553654759004
1671
+ ]
1672
+ },
1673
+ "150": {
1674
+ "n": 5,
1675
+ "mean": 0.9279103641247678,
1676
+ "sample_sd": 0.002719718968150337,
1677
+ "min": 0.9237709769551192,
1678
+ "max": 0.9306597711187639,
1679
+ "values_by_seed": [
1680
+ 0.9237709769551192,
1681
+ 0.9268340733752585,
1682
+ 0.9306597711187639,
1683
+ 0.9297325972822825,
1684
+ 0.9285544018924149
1685
+ ]
1686
+ },
1687
+ "110": {
1688
+ "n": 5,
1689
+ "mean": 0.909947091454236,
1690
+ "sample_sd": 0.001353068222063455,
1691
+ "min": 0.9083797452419079,
1692
+ "max": 0.9117503504363775,
1693
+ "values_by_seed": [
1694
+ 0.9083797452419079,
1695
+ 0.9103155925940105,
1696
+ 0.9104499951040151,
1697
+ 0.9117503504363775,
1698
+ 0.9088397738948691
1699
+ ]
1700
+ }
1701
+ },
1702
+ "recall_at_fpr_1pct": {
1703
+ "260": {
1704
+ "n": 5,
1705
+ "mean": 0.041740862162686666,
1706
+ "sample_sd": 0.0009948543229872336,
1707
+ "min": 0.040330962682035024,
1708
+ "max": 0.042636602907539775,
1709
+ "values_by_seed": [
1710
+ 0.04108333711491801,
1711
+ 0.042636602907539775,
1712
+ 0.04248483665002448,
1713
+ 0.04216857145891606,
1714
+ 0.040330962682035024
1715
+ ]
1716
+ },
1717
+ "200": {
1718
+ "n": 5,
1719
+ "mean": 0.11908930200729928,
1720
+ "sample_sd": 0.0028410997783414427,
1721
+ "min": 0.11565529482208028,
1722
+ "max": 0.12294589225973238,
1723
+ "values_by_seed": [
1724
+ 0.11702765026231751,
1725
+ 0.12294589225973238,
1726
+ 0.11565529482208028,
1727
+ 0.11979047863442822,
1728
+ 0.12002719405793796
1729
+ ]
1730
+ },
1731
+ "150": {
1732
+ "n": 5,
1733
+ "mean": 0.39592290703288885,
1734
+ "sample_sd": 0.00816505757626073,
1735
+ "min": 0.385723611918615,
1736
+ "max": 0.40583253135760633,
1737
+ "values_by_seed": [
1738
+ 0.40105917656875695,
1739
+ 0.397127303992157,
1740
+ 0.385723611918615,
1741
+ 0.3898719113273089,
1742
+ 0.40583253135760633
1743
+ ]
1744
+ },
1745
+ "110": {
1746
+ "n": 5,
1747
+ "mean": 0.2094160008306826,
1748
+ "sample_sd": 0.009026178450761911,
1749
+ "min": 0.19882348812647913,
1750
+ "max": 0.22321271050087566,
1751
+ "values_by_seed": [
1752
+ 0.19882348812647913,
1753
+ 0.2052179532231493,
1754
+ 0.21152841266079453,
1755
+ 0.22321271050087566,
1756
+ 0.20829743964211428
1757
+ ]
1758
+ }
1759
+ },
1760
+ "recall_at_fpr_5pct": {
1761
+ "260": {
1762
+ "n": 5,
1763
+ "mean": 0.18807889624715537,
1764
+ "sample_sd": 0.0017599416457063125,
1765
+ "min": 0.18642128285513185,
1766
+ "max": 0.19106170966891664,
1767
+ "values_by_seed": [
1768
+ 0.18765351624617058,
1769
+ 0.18642128285513185,
1770
+ 0.18734708719819332,
1771
+ 0.18791088526736446,
1772
+ 0.19106170966891664
1773
+ ]
1774
+ },
1775
+ "200": {
1776
+ "n": 5,
1777
+ "mean": 0.3086259337933394,
1778
+ "sample_sd": 0.0046531561244446355,
1779
+ "min": 0.30427032247947083,
1780
+ "max": 0.31399044584473845,
1781
+ "values_by_seed": [
1782
+ 0.30427032247947083,
1783
+ 0.31399044584473845,
1784
+ 0.3075587957154805,
1785
+ 0.3129977261062956,
1786
+ 0.30431237882071166
1787
+ ]
1788
+ },
1789
+ "150": {
1790
+ "n": 5,
1791
+ "mean": 0.6679340370818413,
1792
+ "sample_sd": 0.005998525935781186,
1793
+ "min": 0.6589537806107145,
1794
+ "max": 0.6746269569036961,
1795
+ "values_by_seed": [
1796
+ 0.6659681659466654,
1797
+ 0.6683903814087574,
1798
+ 0.6589537806107145,
1799
+ 0.6717309005393731,
1800
+ 0.6746269569036961
1801
+ ]
1802
+ },
1803
+ "110": {
1804
+ "n": 5,
1805
+ "mean": 0.4871886322436553,
1806
+ "sample_sd": 0.0074225439234899175,
1807
+ "min": 0.4764316655425852,
1808
+ "max": 0.49740225418790446,
1809
+ "values_by_seed": [
1810
+ 0.4764316655425852,
1811
+ 0.4873621357771809,
1812
+ 0.48772549931088927,
1813
+ 0.49740225418790446,
1814
+ 0.4870216063997169
1815
+ ]
1816
+ }
1817
+ },
1818
+ "best_youden_recall": {
1819
+ "260": {
1820
+ "n": 5,
1821
+ "mean": 0.8894392891521944,
1822
+ "sample_sd": 0.002379345415467133,
1823
+ "min": 0.8874031954551467,
1824
+ "max": 0.8935451728795689,
1825
+ "values_by_seed": [
1826
+ 0.8935451728795689,
1827
+ 0.8890579002453363,
1828
+ 0.8887826692709716,
1829
+ 0.8874031954551467,
1830
+ 0.8884075079099487
1831
+ ]
1832
+ },
1833
+ "200": {
1834
+ "n": 5,
1835
+ "mean": 0.875218336564781,
1836
+ "sample_sd": 0.00229769469121162,
1837
+ "min": 0.8715827440693431,
1838
+ "max": 0.8779091345422749,
1839
+ "values_by_seed": [
1840
+ 0.8760232521669709,
1841
+ 0.8753199370818125,
1842
+ 0.8752566149635037,
1843
+ 0.8779091345422749,
1844
+ 0.8715827440693431
1845
+ ]
1846
+ },
1847
+ "150": {
1848
+ "n": 5,
1849
+ "mean": 0.8905270911428238,
1850
+ "sample_sd": 0.0065332618957594174,
1851
+ "min": 0.87995347356181,
1852
+ "max": 0.8964560491240341,
1853
+ "values_by_seed": [
1854
+ 0.87995347356181,
1855
+ 0.8894852571510884,
1856
+ 0.8964560491240341,
1857
+ 0.8915638787289502,
1858
+ 0.8951767971482358
1859
+ ]
1860
+ },
1861
+ "110": {
1862
+ "n": 5,
1863
+ "mean": 0.8929519732797108,
1864
+ "sample_sd": 0.003316898510008606,
1865
+ "min": 0.8872146511637968,
1866
+ "max": 0.8953269057987701,
1867
+ "values_by_seed": [
1868
+ 0.8931369299452894,
1869
+ 0.8953269057987701,
1870
+ 0.8949695512535472,
1871
+ 0.8941118282371503,
1872
+ 0.8872146511637968
1873
+ ]
1874
+ }
1875
+ },
1876
+ "best_youden_threshold": {
1877
+ "260": {
1878
+ "n": 5,
1879
+ "mean": 0.041064453125,
1880
+ "sample_sd": 0.0006897242718025708,
1881
+ "min": 0.04046630859375,
1882
+ "max": 0.04205322265625,
1883
+ "values_by_seed": [
1884
+ 0.04046630859375,
1885
+ 0.04052734375,
1886
+ 0.040771484375,
1887
+ 0.04150390625,
1888
+ 0.04205322265625
1889
+ ]
1890
+ },
1891
+ "200": {
1892
+ "n": 5,
1893
+ "mean": 0.023876953125,
1894
+ "sample_sd": 0.000612484067592876,
1895
+ "min": 0.0233154296875,
1896
+ "max": 0.024658203125,
1897
+ "values_by_seed": [
1898
+ 0.02349853515625,
1899
+ 0.0233154296875,
1900
+ 0.0244140625,
1901
+ 0.02349853515625,
1902
+ 0.024658203125
1903
+ ]
1904
+ },
1905
+ "150": {
1906
+ "n": 5,
1907
+ "mean": 0.0266357421875,
1908
+ "sample_sd": 0.0014866790958634798,
1909
+ "min": 0.02520751953125,
1910
+ "max": 0.0286865234375,
1911
+ "values_by_seed": [
1912
+ 0.0286865234375,
1913
+ 0.02581787109375,
1914
+ 0.0257568359375,
1915
+ 0.0277099609375,
1916
+ 0.02520751953125
1917
+ ]
1918
+ },
1919
+ "110": {
1920
+ "n": 5,
1921
+ "mean": 0.02681884765625,
1922
+ "sample_sd": 0.0006203406224253863,
1923
+ "min": 0.0262451171875,
1924
+ "max": 0.02764892578125,
1925
+ "values_by_seed": [
1926
+ 0.026611328125,
1927
+ 0.02630615234375,
1928
+ 0.0262451171875,
1929
+ 0.02728271484375,
1930
+ 0.02764892578125
1931
+ ]
1932
+ }
1933
+ }
1934
+ },
1935
+ "papyrus_summaries": {
1936
+ "surface_recall_at_0_5": {
1937
+ "35": {
1938
+ "n": 5,
1939
+ "mean": 0.29912396263737573,
1940
+ "sample_sd": 0.004629861871607253,
1941
+ "min": 0.29466043162383543,
1942
+ "max": 0.3062159019986714,
1943
+ "values_by_seed": [
1944
+ 0.30103499034854386,
1945
+ 0.29596866456970733,
1946
+ 0.29466043162383543,
1947
+ 0.3062159019986714,
1948
+ 0.29773982464612075
1949
+ ]
1950
+ },
1951
+ "50": {
1952
+ "n": 5,
1953
+ "mean": 0.322255385845153,
1954
+ "sample_sd": 0.005376942141434111,
1955
+ "min": 0.3134582516169446,
1956
+ "max": 0.32767434088518654,
1957
+ "values_by_seed": [
1958
+ 0.3226957599047396,
1959
+ 0.3252045086658893,
1960
+ 0.3222440681530048,
1961
+ 0.3134582516169446,
1962
+ 0.32767434088518654
1963
+ ]
1964
+ },
1965
+ "65": {
1966
+ "n": 5,
1967
+ "mean": 0.35214624584472876,
1968
+ "sample_sd": 0.0022449337189025774,
1969
+ "min": 0.3483140928613887,
1970
+ "max": 0.35361216300841514,
1971
+ "values_by_seed": [
1972
+ 0.3483140928613887,
1973
+ 0.3519623560081759,
1974
+ 0.3532812835191246,
1975
+ 0.35361216300841514,
1976
+ 0.35356133382653954
1977
+ ]
1978
+ },
1979
+ "90": {
1980
+ "n": 5,
1981
+ "mean": 0.40432055589528854,
1982
+ "sample_sd": 0.0024789995342160195,
1983
+ "min": 0.4019477569487316,
1984
+ "max": 0.4078367071844754,
1985
+ "values_by_seed": [
1986
+ 0.4057841016485289,
1987
+ 0.4019477569487316,
1988
+ 0.4078367071844754,
1989
+ 0.40374110098420346,
1990
+ 0.4022931127105033
1991
+ ]
1992
+ }
1993
+ },
1994
+ "near_sheet_auc": {
1995
+ "35": {
1996
+ "n": 5,
1997
+ "mean": 0.7983979395818872,
1998
+ "sample_sd": 0.0032317196643874215,
1999
+ "min": 0.7948291133791763,
2000
+ "max": 0.8036431090800407,
2001
+ "values_by_seed": [
2002
+ 0.7948291133791763,
2003
+ 0.7976264041940555,
2004
+ 0.7984569644587731,
2005
+ 0.8036431090800407,
2006
+ 0.7974341067973909
2007
+ ]
2008
+ },
2009
+ "50": {
2010
+ "n": 5,
2011
+ "mean": 0.8734727292197139,
2012
+ "sample_sd": 0.0032341817596765357,
2013
+ "min": 0.8690339479767878,
2014
+ "max": 0.8767671312054561,
2015
+ "values_by_seed": [
2016
+ 0.8690339479767878,
2017
+ 0.8764806204215468,
2018
+ 0.8767671312054561,
2019
+ 0.8730410309372079,
2020
+ 0.8720409155575707
2021
+ ]
2022
+ },
2023
+ "65": {
2024
+ "n": 5,
2025
+ "mean": 0.9015258105114438,
2026
+ "sample_sd": 0.0005582645188180607,
2027
+ "min": 0.9009692047041208,
2028
+ "max": 0.9022756794071325,
2029
+ "values_by_seed": [
2030
+ 0.9022756794071325,
2031
+ 0.9009714337592761,
2032
+ 0.9009692047041208,
2033
+ 0.9016748349474528,
2034
+ 0.9017378997392367
2035
+ ]
2036
+ },
2037
+ "90": {
2038
+ "n": 5,
2039
+ "mean": 0.9091542742173905,
2040
+ "sample_sd": 0.0008841055415507703,
2041
+ "min": 0.9078389816313257,
2042
+ "max": 0.9100956800609106,
2043
+ "values_by_seed": [
2044
+ 0.9078389816313257,
2045
+ 0.9087416897579162,
2046
+ 0.9100956800609106,
2047
+ 0.9094233396262632,
2048
+ 0.9096716800105363
2049
+ ]
2050
+ }
2051
+ },
2052
+ "recall_at_fpr_1pct": {
2053
+ "35": {
2054
+ "n": 5,
2055
+ "mean": 0.1641939455306239,
2056
+ "sample_sd": 0.010742845253915527,
2057
+ "min": 0.1526318656196105,
2058
+ "max": 0.17902879442836372,
2059
+ "values_by_seed": [
2060
+ 0.15634609381032522,
2061
+ 0.17071386183812354,
2062
+ 0.1526318656196105,
2063
+ 0.17902879442836372,
2064
+ 0.1622491119566966
2065
+ ]
2066
+ },
2067
+ "50": {
2068
+ "n": 5,
2069
+ "mean": 0.20448538723732318,
2070
+ "sample_sd": 0.007945131535713587,
2071
+ "min": 0.19364169980680868,
2072
+ "max": 0.21190535901662502,
2073
+ "values_by_seed": [
2074
+ 0.19364169980680868,
2075
+ 0.2111930807716053,
2076
+ 0.20668224670805554,
2077
+ 0.19900454988352118,
2078
+ 0.21190535901662502
2079
+ ]
2080
+ },
2081
+ "65": {
2082
+ "n": 5,
2083
+ "mean": 0.20942362407725418,
2084
+ "sample_sd": 0.004965827105444433,
2085
+ "min": 0.20419907993424763,
2086
+ "max": 0.21743571399136064,
2087
+ "values_by_seed": [
2088
+ 0.21743571399136064,
2089
+ 0.20419907993424763,
2090
+ 0.2067685915262975,
2091
+ 0.2091448452950214,
2092
+ 0.2095698896393437
2093
+ ]
2094
+ },
2095
+ "90": {
2096
+ "n": 5,
2097
+ "mean": 0.18806611518835611,
2098
+ "sample_sd": 0.0036785179576858144,
2099
+ "min": 0.18182172983860198,
2100
+ "max": 0.19076376712702825,
2101
+ "values_by_seed": [
2102
+ 0.1905701444639771,
2103
+ 0.18182172983860198,
2104
+ 0.1893094521975507,
2105
+ 0.18786548231462255,
2106
+ 0.19076376712702825
2107
+ ]
2108
+ }
2109
+ },
2110
+ "recall_at_fpr_5pct": {
2111
+ "35": {
2112
+ "n": 5,
2113
+ "mean": 0.3217724180746358,
2114
+ "sample_sd": 0.010607866611533017,
2115
+ "min": 0.31193513256073596,
2116
+ "max": 0.33879894853857795,
2117
+ "values_by_seed": [
2118
+ 0.31433513192741885,
2119
+ 0.3239074611516457,
2120
+ 0.31193513256073596,
2121
+ 0.33879894853857795,
2122
+ 0.3198854161948007
2123
+ ]
2124
+ },
2125
+ "50": {
2126
+ "n": 5,
2127
+ "mean": 0.42082753643254706,
2128
+ "sample_sd": 0.005782500359297558,
2129
+ "min": 0.4109038130393745,
2130
+ "max": 0.42609426933400885,
2131
+ "values_by_seed": [
2132
+ 0.4109038130393745,
2133
+ 0.42609426933400885,
2134
+ 0.4220526984421434,
2135
+ 0.42227818206777107,
2136
+ 0.4228087192794375
2137
+ ]
2138
+ },
2139
+ "65": {
2140
+ "n": 5,
2141
+ "mean": 0.4562315963520341,
2142
+ "sample_sd": 0.005226421423965909,
2143
+ "min": 0.4483088492227324,
2144
+ "max": 0.4614511420550639,
2145
+ "values_by_seed": [
2146
+ 0.4614511420550639,
2147
+ 0.45850938407250613,
2148
+ 0.4483088492227324,
2149
+ 0.45380143176721616,
2150
+ 0.4590871746426519
2151
+ ]
2152
+ },
2153
+ "90": {
2154
+ "n": 5,
2155
+ "mean": 0.4529959485067745,
2156
+ "sample_sd": 0.005163221578624922,
2157
+ "min": 0.4476335831930347,
2158
+ "max": 0.4592884826096658,
2159
+ "values_by_seed": [
2160
+ 0.4476335831930347,
2161
+ 0.447653131327648,
2162
+ 0.4592884826096658,
2163
+ 0.4551632037273725,
2164
+ 0.4552413416761512
2165
+ ]
2166
+ }
2167
+ },
2168
+ "best_youden_recall": {
2169
+ "35": {
2170
+ "n": 5,
2171
+ "mean": 0.7599551069573679,
2172
+ "sample_sd": 0.0043028948946480065,
2173
+ "min": 0.7565356988808377,
2174
+ "max": 0.7665243256330363,
2175
+ "values_by_seed": [
2176
+ 0.7565821214298524,
2177
+ 0.7620428899333677,
2178
+ 0.7665243256330363,
2179
+ 0.7580904989097457,
2180
+ 0.7565356988808377
2181
+ ]
2182
+ },
2183
+ "50": {
2184
+ "n": 5,
2185
+ "mean": 0.8851633425962231,
2186
+ "sample_sd": 0.0046358492838186145,
2187
+ "min": 0.879867860548393,
2188
+ "max": 0.8913468942453817,
2189
+ "values_by_seed": [
2190
+ 0.879867860548393,
2191
+ 0.8839997662369192,
2192
+ 0.8883255042877282,
2193
+ 0.8913468942453817,
2194
+ 0.8822766876626935
2195
+ ]
2196
+ },
2197
+ "65": {
2198
+ "n": 5,
2199
+ "mean": 0.9491713052858669,
2200
+ "sample_sd": 0.0022518409969842427,
2201
+ "min": 0.9475579127226398,
2202
+ "max": 0.9529848298462783,
2203
+ "values_by_seed": [
2204
+ 0.9529848298462783,
2205
+ 0.9476006022877962,
2206
+ 0.9483708192215559,
2207
+ 0.9475579127226398,
2208
+ 0.9493423623510642
2209
+ ]
2210
+ },
2211
+ "90": {
2212
+ "n": 5,
2213
+ "mean": 0.9538469353000518,
2214
+ "sample_sd": 0.0012259369007595912,
2215
+ "min": 0.952244235469736,
2216
+ "max": 0.9555467418189243,
2217
+ "values_by_seed": [
2218
+ 0.9532240167291152,
2219
+ 0.9555467418189243,
2220
+ 0.952244235469736,
2221
+ 0.953992731085755,
2222
+ 0.9542269513967292
2223
+ ]
2224
+ }
2225
+ },
2226
+ "best_youden_threshold": {
2227
+ "35": {
2228
+ "n": 5,
2229
+ "mean": 0.0530029296875,
2230
+ "sample_sd": 0.002722947902738638,
2231
+ "min": 0.05029296875,
2232
+ "max": 0.05621337890625,
2233
+ "values_by_seed": [
2234
+ 0.0552978515625,
2235
+ 0.0504150390625,
2236
+ 0.05029296875,
2237
+ 0.05621337890625,
2238
+ 0.05279541015625
2239
+ ]
2240
+ },
2241
+ "50": {
2242
+ "n": 5,
2243
+ "mean": 0.02176513671875,
2244
+ "sample_sd": 0.0013109067147133243,
2245
+ "min": 0.01971435546875,
2246
+ "max": 0.0228271484375,
2247
+ "values_by_seed": [
2248
+ 0.021240234375,
2249
+ 0.0228271484375,
2250
+ 0.02227783203125,
2251
+ 0.01971435546875,
2252
+ 0.02276611328125
2253
+ ]
2254
+ },
2255
+ "65": {
2256
+ "n": 5,
2257
+ "mean": 0.0176025390625,
2258
+ "sample_sd": 0.0005418052007122105,
2259
+ "min": 0.0167236328125,
2260
+ "max": 0.01806640625,
2261
+ "values_by_seed": [
2262
+ 0.0167236328125,
2263
+ 0.017822265625,
2264
+ 0.01806640625,
2265
+ 0.0179443359375,
2266
+ 0.0174560546875
2267
+ ]
2268
+ },
2269
+ "90": {
2270
+ "n": 5,
2271
+ "mean": 0.026025390625,
2272
+ "sample_sd": 0.0006749837061010377,
2273
+ "min": 0.02490234375,
2274
+ "max": 0.02655029296875,
2275
+ "values_by_seed": [
2276
+ 0.0260009765625,
2277
+ 0.02490234375,
2278
+ 0.02655029296875,
2279
+ 0.026123046875,
2280
+ 0.02655029296875
2281
+ ]
2282
+ }
2283
+ }
2284
+ },
2285
+ "limitations": [
2286
+ "Five seeds estimate variation across this analytic phantom generator, not across real scrolls.",
2287
+ "Per-cell best-Youden metrics are descriptive upper bounds chosen and measured on the same cell.",
2288
+ "The global threshold is selected on seed 0 and evaluated on seeds 1-4 to avoid calibration leakage.",
2289
+ "Histogram-derived thresholds have resolution 1/4096.",
2290
+ "No confidence interval here supports claims of real-scroll accuracy."
2291
+ ]
2292
+ }
surface-contrast-grid/five-seed-addendum/runtime/kernel-metadata.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": "aviadcohen1/vesuvius-surface-contrast-grid",
3
+ "id_no": 129501090,
4
+ "title": "Vesuvius Surface Contrast Grid",
5
+ "code_file": "vesuvius-surface-contrast-grid.py",
6
+ "language": "python",
7
+ "kernel_type": "script",
8
+ "is_private": true,
9
+ "enable_gpu": true,
10
+ "enable_tpu": false,
11
+ "enable_internet": true,
12
+ "keywords": [
13
+ "gpu"
14
+ ],
15
+ "dataset_sources": [
16
+ "aviadcohen1/vesuvius-surface-contrast-harness"
17
+ ],
18
+ "kernel_sources": [],
19
+ "competition_sources": [],
20
+ "model_sources": [],
21
+ "docker_image": "gcr.io/kaggle-private-byod/python@sha256:37c64f7dd9c54116ecd1bcc88817c5469b88387388fade02bfa8bf3fc647d461",
22
+ "machine_shape": "Gpu"
23
+ }
surface-contrast-grid/five-seed-addendum/runtime/vesuvius-surface-contrast-grid.py ADDED
@@ -0,0 +1,397 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Run five seeded Vesuvius contrast/geometry grids on a Kaggle GPU."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import os
7
+ import json
8
+ import shutil
9
+ import subprocess
10
+ import sys
11
+ from pathlib import Path
12
+
13
+
14
+ GRID_COMMIT = "130d83f"
15
+ VILLA_COMMIT = "4d5c9e60"
16
+ HARNESS_SHA256 = "54cbc7521ee34f559724427f34ca723b6ecec004954c389b57b6a82cbe1be881"
17
+
18
+
19
+ def run(command: list[str], **kwargs) -> None:
20
+ print("+", " ".join(map(str, command)), flush=True)
21
+ subprocess.run(command, check=True, **kwargs)
22
+
23
+
24
+ def sha256(path: Path) -> str:
25
+ import hashlib
26
+
27
+ digest = hashlib.sha256()
28
+ with path.open("rb") as handle:
29
+ for chunk in iter(lambda: handle.read(8 << 20), b""):
30
+ digest.update(chunk)
31
+ return digest.hexdigest()
32
+
33
+
34
+ def aggregate_replicates(runs_dir: Path, output: Path) -> None:
35
+ """Aggregate five seeds and calibrate one threshold on seed 0 only."""
36
+ import numpy as np
37
+
38
+ paths = sorted(
39
+ runs_dir.glob("seed_*.json"),
40
+ key=lambda path: int(path.stem.split("_")[-1]),
41
+ )
42
+ if len(paths) != 5:
43
+ raise RuntimeError(f"expected five seed runs, found {len(paths)}")
44
+ runs = []
45
+ for path in paths:
46
+ seed = int(path.stem.split("_")[-1])
47
+ result = json.loads(path.read_text(encoding="utf-8"))
48
+ if not result.get("canonical") or len(result.get("cells", [])) != 16:
49
+ raise RuntimeError(f"non-canonical seed run: {path}")
50
+ runs.append((seed, path, result))
51
+
52
+ bins = int(runs[0][2]["cells"][0]["metrics"]["histogram_bins"])
53
+
54
+ def pooled_histogram(result: dict) -> tuple[np.ndarray, np.ndarray]:
55
+ positive = np.zeros(bins, dtype=np.int64)
56
+ negative = np.zeros(bins, dtype=np.int64)
57
+ for cell in result["cells"]:
58
+ metrics = cell["metrics"]
59
+ if int(metrics["histogram_bins"]) != bins:
60
+ raise RuntimeError("histogram bin mismatch")
61
+ positive += np.asarray(metrics["positive_score_histogram"], dtype=np.int64)
62
+ negative += np.asarray(metrics["negative_score_histogram"], dtype=np.int64)
63
+ return positive, negative
64
+
65
+ def rates(positive: np.ndarray, negative: np.ndarray, index: int) -> tuple[float, float]:
66
+ return (
67
+ float(positive[index:].sum() / positive.sum()),
68
+ float(negative[index:].sum() / negative.sum()),
69
+ )
70
+
71
+ calibration_positive, calibration_negative = pooled_histogram(runs[0][2])
72
+ calibration_tpr = np.cumsum(calibration_positive[::-1])[::-1] / calibration_positive.sum()
73
+ calibration_fpr_curve = np.cumsum(calibration_negative[::-1])[::-1] / calibration_negative.sum()
74
+ youden = calibration_tpr - calibration_fpr_curve
75
+ candidates = np.flatnonzero(np.isclose(youden, youden.max(), rtol=0.0, atol=1e-15))
76
+ threshold_index = int(candidates[-1])
77
+ threshold = threshold_index / bins
78
+ calibration_recall, calibration_fpr = rates(
79
+ calibration_positive, calibration_negative, threshold_index
80
+ )
81
+
82
+ heldout_positive = np.zeros(bins, dtype=np.int64)
83
+ heldout_negative = np.zeros(bins, dtype=np.int64)
84
+ heldout_by_seed = []
85
+ for seed, _, result in runs[1:]:
86
+ positive, negative = pooled_histogram(result)
87
+ recall, fpr = rates(positive, negative, threshold_index)
88
+ heldout_by_seed.append({"seed": seed, "recall": recall, "fpr": fpr})
89
+ heldout_positive += positive
90
+ heldout_negative += negative
91
+ heldout_recall, heldout_fpr = rates(
92
+ heldout_positive, heldout_negative, threshold_index
93
+ )
94
+
95
+ def summary(values: list[float]) -> dict:
96
+ array = np.asarray(values, dtype=np.float64)
97
+ return {
98
+ "n": int(array.size),
99
+ "mean": float(array.mean()),
100
+ "sample_sd": float(array.std(ddof=1)) if array.size > 1 else 0.0,
101
+ "min": float(array.min()),
102
+ "max": float(array.max()),
103
+ "values_by_seed": [float(value) for value in array],
104
+ }
105
+
106
+ metric_names = (
107
+ "surface_recall_at_0_5",
108
+ "near_sheet_auc",
109
+ "best_youden_recall",
110
+ "best_youden_threshold",
111
+ )
112
+ cells = {}
113
+ pitch_seed_means = {metric: {} for metric in metric_names}
114
+ papyrus_seed_means = {metric: {} for metric in metric_names}
115
+ for seed_index, (_, _, result) in enumerate(runs):
116
+ per_pitch = {metric: {} for metric in metric_names}
117
+ per_papyrus = {metric: {} for metric in metric_names}
118
+ for cell in result["cells"]:
119
+ papyrus = int(cell["papyrus"])
120
+ pitch = float(cell["pitch_um"])
121
+ key = (papyrus, pitch)
122
+ cells.setdefault(key, {metric: [] for metric in metric_names})
123
+ for metric in metric_names:
124
+ value = float(cell["metrics"][metric])
125
+ cells[key][metric].append(value)
126
+ per_pitch[metric].setdefault(pitch, []).append(value)
127
+ per_papyrus[metric].setdefault(papyrus, []).append(value)
128
+ for metric in metric_names:
129
+ for pitch, values in per_pitch[metric].items():
130
+ pitch_seed_means[metric].setdefault(pitch, []).append(float(np.mean(values)))
131
+ for papyrus, values in per_papyrus[metric].items():
132
+ papyrus_seed_means[metric].setdefault(papyrus, []).append(float(np.mean(values)))
133
+
134
+ aggregate = {
135
+ "schema_version": "2.0",
136
+ "replicate_design": {
137
+ "seeds": [seed for seed, _, _ in runs],
138
+ "replicates_per_cell": 5,
139
+ "cells_per_seed": 16,
140
+ "total_inferences": 80,
141
+ "seed_0_role": "replicate summary and global-threshold calibration only",
142
+ "heldout_threshold_seeds": [1, 2, 3, 4],
143
+ },
144
+ "source_runs": [
145
+ {"seed": seed, "file": path.name, "sha256": sha256(path)}
146
+ for seed, path, _ in runs
147
+ ],
148
+ "global_threshold_calibration": {
149
+ "histogram_bins": bins,
150
+ "selected_on_seed": 0,
151
+ "threshold": threshold,
152
+ "selection_rule": "pooled maximum Youden J; highest threshold on ties",
153
+ "calibration_recall": calibration_recall,
154
+ "calibration_fpr": calibration_fpr,
155
+ "heldout_pooled_recall": heldout_recall,
156
+ "heldout_pooled_fpr": heldout_fpr,
157
+ "heldout_by_seed": heldout_by_seed,
158
+ },
159
+ "cell_replicate_summaries": [
160
+ {
161
+ "papyrus": papyrus,
162
+ "pitch_um": pitch,
163
+ "metrics": {metric: summary(values) for metric, values in metrics.items()},
164
+ }
165
+ for (papyrus, pitch), metrics in sorted(cells.items())
166
+ ],
167
+ "pitch_summaries": {
168
+ metric: {
169
+ str(int(pitch)): summary(values)
170
+ for pitch, values in sorted(mapping.items(), reverse=True)
171
+ }
172
+ for metric, mapping in pitch_seed_means.items()
173
+ },
174
+ "papyrus_summaries": {
175
+ metric: {
176
+ str(papyrus): summary(values)
177
+ for papyrus, values in sorted(mapping.items())
178
+ }
179
+ for metric, mapping in papyrus_seed_means.items()
180
+ },
181
+ "limitations": [
182
+ "Five seeds estimate variation across this analytic generator, not real scrolls.",
183
+ "Per-cell best-Youden metrics are same-cell descriptive upper bounds.",
184
+ "The global threshold is selected on seed 0 and evaluated on seeds 1-4.",
185
+ "Histogram-derived thresholds have resolution 1/4096.",
186
+ ],
187
+ }
188
+ output.write_text(json.dumps(aggregate, indent=2) + "\n", encoding="utf-8")
189
+
190
+
191
+ def main() -> int:
192
+ working = Path("/kaggle/working/vesuvius-contrast")
193
+ working.mkdir(parents=True, exist_ok=True)
194
+ harness_candidates = sorted(
195
+ Path("/kaggle/input").glob("**/run_surface_grid.py")
196
+ )
197
+ if len(harness_candidates) != 1:
198
+ raise RuntimeError(
199
+ "expected exactly one mounted run_surface_grid.py; "
200
+ f"found {len(harness_candidates)}: {harness_candidates}"
201
+ )
202
+ harness = harness_candidates[0]
203
+ print(f"HARNESS_PATH={harness}", flush=True)
204
+ actual_harness = sha256(harness)
205
+ if actual_harness != HARNESS_SHA256:
206
+ raise RuntimeError(
207
+ f"harness SHA-256 mismatch: {actual_harness}; expected {HARNESS_SHA256}"
208
+ )
209
+
210
+ run(
211
+ [
212
+ sys.executable,
213
+ "-m",
214
+ "pip",
215
+ "install",
216
+ "--quiet",
217
+ "--no-cache-dir",
218
+ "torch==2.5.1",
219
+ "--index-url",
220
+ "https://download.pytorch.org/whl/cu121",
221
+ ]
222
+ )
223
+ run(
224
+ [
225
+ sys.executable,
226
+ "-c",
227
+ (
228
+ "import torch; "
229
+ "print('TORCH_VERSION=' + torch.__version__); "
230
+ "print('CUDA_ARCH_LIST=' + ','.join(torch.cuda.get_arch_list())); "
231
+ "assert 'sm_60' in torch.cuda.get_arch_list()"
232
+ ),
233
+ ]
234
+ )
235
+ run(
236
+ [
237
+ sys.executable,
238
+ "-m",
239
+ "pip",
240
+ "install",
241
+ "--quiet",
242
+ "huggingface-hub==1.11.0",
243
+ "dynamic-network-architectures==0.3.1",
244
+ ]
245
+ )
246
+ run(
247
+ [
248
+ "git",
249
+ "clone",
250
+ "--filter=blob:none",
251
+ "https://github.com/Diego-dcv/vesuvius-topological-grid.git",
252
+ str(working / "topological-grid"),
253
+ ]
254
+ )
255
+ run(["git", "-C", str(working / "topological-grid"), "checkout", GRID_COMMIT])
256
+ run(
257
+ [
258
+ "git",
259
+ "clone",
260
+ "--filter=blob:none",
261
+ "https://github.com/ScrollPrize/villa.git",
262
+ str(working / "villa"),
263
+ ]
264
+ )
265
+ run(["git", "-C", str(working / "villa"), "checkout", VILLA_COMMIT])
266
+
267
+ from huggingface_hub import hf_hub_download
268
+
269
+ checkpoint = Path(
270
+ hf_hub_download(
271
+ "scrollprize/surface_recto_059_redo",
272
+ "Model_epoch499.pth",
273
+ cache_dir=working / "hf-cache",
274
+ )
275
+ )
276
+ run(
277
+ [
278
+ sys.executable,
279
+ str(working / "topological-grid/scripts/contrast_phantom.py"),
280
+ "test",
281
+ ],
282
+ cwd=working / "topological-grid",
283
+ )
284
+ environment = dict(os.environ)
285
+ environment["PYTHONPATH"] = (
286
+ str(working / "villa/segmentation/models/multi-task-3d-unet")
287
+ + os.pathsep
288
+ + environment.get("PYTHONPATH", "")
289
+ )
290
+ metric_compat = r'''
291
+ import importlib.util
292
+ import sys
293
+ from pathlib import Path
294
+ import numpy as np
295
+
296
+ harness_path = Path(sys.argv.pop(1))
297
+ spec = importlib.util.spec_from_file_location("frozen_surface_grid", harness_path)
298
+ if spec is None or spec.loader is None:
299
+ raise RuntimeError(f"unable to import frozen harness: {harness_path}")
300
+ module = importlib.util.module_from_spec(spec)
301
+ spec.loader.exec_module(module)
302
+
303
+ original_safe_globals = module._checkpoint_safe_globals
304
+ def torch25_safe_globals():
305
+ return [entry[0] if isinstance(entry, tuple) else entry
306
+ for entry in original_safe_globals()]
307
+ module._checkpoint_safe_globals = torch25_safe_globals
308
+
309
+ original_metrics = module.metrics
310
+ HISTOGRAM_BINS = 4096
311
+ def extended_metrics(probability, truth):
312
+ result = original_metrics(probability, truth)
313
+ surface = truth.astype(bool)
314
+ distance = module.ndimage.distance_transform_edt(~surface)
315
+ background = (~surface) & (distance >= 2.0) & (distance <= 10.0)
316
+ positive_hist, _ = np.histogram(
317
+ probability[surface], bins=HISTOGRAM_BINS, range=(0.0, 1.0))
318
+ negative_hist, _ = np.histogram(
319
+ probability[background], bins=HISTOGRAM_BINS, range=(0.0, 1.0))
320
+ positive_hist = positive_hist.astype(np.int64)
321
+ negative_hist = negative_hist.astype(np.int64)
322
+ tpr = np.cumsum(positive_hist[::-1])[::-1] / positive_hist.sum()
323
+ fpr = np.cumsum(negative_hist[::-1])[::-1] / negative_hist.sum()
324
+ thresholds = np.arange(HISTOGRAM_BINS, dtype=np.float64) / HISTOGRAM_BINS
325
+ youden = tpr - fpr
326
+ candidates = np.flatnonzero(
327
+ np.isclose(youden, youden.max(), rtol=0.0, atol=1e-15))
328
+ index = int(candidates[-1])
329
+ result.update({
330
+ "histogram_bins": HISTOGRAM_BINS,
331
+ "positive_score_histogram": positive_hist.tolist(),
332
+ "negative_score_histogram": negative_hist.tolist(),
333
+ "best_youden_threshold": float(thresholds[index]),
334
+ "best_youden_recall": float(tpr[index]),
335
+ "best_youden_fpr": float(fpr[index]),
336
+ "best_youden_j": float(youden[index]),
337
+ })
338
+ for target in (0.01, 0.05):
339
+ valid = np.flatnonzero(fpr <= target)
340
+ target_index = int(valid[0]) if valid.size else HISTOGRAM_BINS - 1
341
+ label = f"fpr_{int(target * 100)}pct"
342
+ result[f"threshold_at_{label}"] = float(thresholds[target_index])
343
+ result[f"recall_at_{label}"] = float(tpr[target_index])
344
+ result[f"actual_{label}"] = float(fpr[target_index])
345
+ return result
346
+
347
+ module.metrics = extended_metrics
348
+ print("TORCH_SAFE_GLOBALS_ADAPTER=tuple_to_callable", flush=True)
349
+ print("CALIBRATION_HISTOGRAM_BINS=4096", flush=True)
350
+ raise SystemExit(module.main())
351
+ '''
352
+ seed_runs = Path("/kaggle/working/seed-runs")
353
+ seed_runs.mkdir(parents=True, exist_ok=True)
354
+ for seed in range(5):
355
+ phantoms = working / f"phantoms-seed-{seed}"
356
+ run(
357
+ [
358
+ sys.executable,
359
+ str(working / "topological-grid/scripts/contrast_phantom.py"),
360
+ "grid",
361
+ "--out",
362
+ str(phantoms),
363
+ "--seed",
364
+ str(seed),
365
+ ],
366
+ cwd=working / "topological-grid",
367
+ )
368
+ result = seed_runs / f"seed_{seed}.json"
369
+ run(
370
+ [
371
+ sys.executable,
372
+ "-c",
373
+ metric_compat,
374
+ str(harness),
375
+ "--checkpoint",
376
+ str(checkpoint),
377
+ "--phantoms",
378
+ str(phantoms),
379
+ "--output",
380
+ str(result),
381
+ "--device",
382
+ "cuda",
383
+ ],
384
+ env=environment,
385
+ )
386
+ print(f"SEED_{seed}_RESULT_SHA256={sha256(result)}", flush=True)
387
+ shutil.rmtree(phantoms)
388
+
389
+ aggregate = Path("/kaggle/working/replicate_results.json")
390
+ aggregate_replicates(seed_runs, aggregate)
391
+ print(f"REPLICATE_RESULT_SHA256={sha256(aggregate)}", flush=True)
392
+ print("FIVE_SEED_RESULT_READY", flush=True)
393
+ return 0
394
+
395
+
396
+ if __name__ == "__main__":
397
+ raise SystemExit(main())
surface-contrast-grid/five-seed-addendum/seed-runs/seed_0.json ADDED
The diff for this file is too large to render. See raw diff
 
surface-contrast-grid/five-seed-addendum/seed-runs/seed_1.json ADDED
The diff for this file is too large to render. See raw diff
 
surface-contrast-grid/five-seed-addendum/seed-runs/seed_2.json ADDED
The diff for this file is too large to render. See raw diff
 
surface-contrast-grid/five-seed-addendum/seed-runs/seed_3.json ADDED
The diff for this file is too large to render. See raw diff
 
surface-contrast-grid/five-seed-addendum/seed-runs/seed_4.json ADDED
The diff for this file is too large to render. See raw diff
 
surface-contrast-grid/five-seed-addendum/validate_replicates.py ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Independent validation for the five-seed surface response experiment."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import argparse
7
+ import hashlib
8
+ import json
9
+ import math
10
+ from pathlib import Path
11
+
12
+ import numpy as np
13
+
14
+
15
+ EXPECTED_CHECKPOINT = "f1990a02ac91889c1f989522ae0e45421a91cb666320448aaf579d42b081636f"
16
+ EXPECTED_PARAMETERS = 102_349_770
17
+ EXPECTED_GRID = {(papyrus, pitch) for papyrus in (35, 50, 65, 90) for pitch in (260.0, 200.0, 150.0, 110.0)}
18
+ SUMMARY_METRICS = (
19
+ "surface_recall_at_0_5",
20
+ "near_sheet_auc",
21
+ "recall_at_fpr_1pct",
22
+ "recall_at_fpr_5pct",
23
+ "best_youden_recall",
24
+ "best_youden_threshold",
25
+ )
26
+
27
+
28
+ def sha256(path: Path) -> str:
29
+ digest = hashlib.sha256()
30
+ with path.open("rb") as handle:
31
+ for chunk in iter(lambda: handle.read(8 << 20), b""):
32
+ digest.update(chunk)
33
+ return digest.hexdigest()
34
+
35
+
36
+ class Checks:
37
+ def __init__(self) -> None:
38
+ self.count = 0
39
+
40
+ def require(self, condition: bool, label: str) -> None:
41
+ if not condition:
42
+ raise AssertionError(label)
43
+ self.count += 1
44
+ print(f"PASS {self.count:03d}: {label}")
45
+
46
+ def close(self, actual: float, expected: float, label: str, tolerance: float = 1e-12) -> None:
47
+ self.require(math.isclose(actual, expected, rel_tol=0.0, abs_tol=tolerance), label)
48
+
49
+
50
+ def histogram_rates(positive: np.ndarray, negative: np.ndarray) -> tuple[np.ndarray, np.ndarray]:
51
+ return (
52
+ np.cumsum(positive[::-1])[::-1] / positive.sum(),
53
+ np.cumsum(negative[::-1])[::-1] / negative.sum(),
54
+ )
55
+
56
+
57
+ def summary(values: list[float]) -> dict:
58
+ array = np.asarray(values, dtype=np.float64)
59
+ return {
60
+ "n": int(array.size),
61
+ "mean": float(array.mean()),
62
+ "sample_sd": float(array.std(ddof=1)),
63
+ "min": float(array.min()),
64
+ "max": float(array.max()),
65
+ "values_by_seed": [float(value) for value in array],
66
+ }
67
+
68
+
69
+ def compare_summary(checks: Checks, actual: dict, expected: dict, label: str) -> None:
70
+ checks.require(actual["n"] == expected["n"], f"{label}: n")
71
+ for key in ("mean", "sample_sd", "min", "max"):
72
+ checks.close(float(actual[key]), float(expected[key]), f"{label}: {key}")
73
+ checks.require(
74
+ np.allclose(actual["values_by_seed"], expected["values_by_seed"], rtol=0.0, atol=1e-12),
75
+ f"{label}: values by seed",
76
+ )
77
+
78
+
79
+ def main() -> int:
80
+ parser = argparse.ArgumentParser()
81
+ parser.add_argument("--runs", type=Path, required=True)
82
+ parser.add_argument("--aggregate", type=Path, required=True)
83
+ parser.add_argument("--seed0-baseline", type=Path, required=True)
84
+ args = parser.parse_args()
85
+ checks = Checks()
86
+
87
+ paths = sorted(args.runs.glob("seed_*.json"), key=lambda path: int(path.stem.split("_")[-1]))
88
+ checks.require(len(paths) == 5, "five raw seed files exist")
89
+ checks.require([int(path.stem.split("_")[-1]) for path in paths] == list(range(5)), "seeds are exactly 0 through 4")
90
+
91
+ runs = [json.loads(path.read_text(encoding="utf-8")) for path in paths]
92
+ aggregate = json.loads(args.aggregate.read_text(encoding="utf-8"))
93
+ baseline = json.loads(args.seed0_baseline.read_text(encoding="utf-8"))
94
+ bins = int(runs[0]["cells"][0]["metrics"]["histogram_bins"])
95
+ checks.require(bins == 4096, "histogram resolution is 4096 bins")
96
+
97
+ source_hashes = {int(item["seed"]): item["sha256"] for item in aggregate["source_runs"]}
98
+ for seed, (path, run) in enumerate(zip(paths, runs)):
99
+ checks.require(run["canonical"] is True, f"seed {seed}: canonical run")
100
+ checks.require(len(run["cells"]) == 16, f"seed {seed}: sixteen cells")
101
+ checks.require(run["checkpoint"]["sha256"] == EXPECTED_CHECKPOINT, f"seed {seed}: checkpoint hash")
102
+ checks.require(run["checkpoint"]["parameter_count"] == EXPECTED_PARAMETERS, f"seed {seed}: strict parameter count")
103
+ checks.require(run["inference"]["patch_size"] == 192, f"seed {seed}: 192-cube patches")
104
+ checks.close(float(run["inference"]["step_fraction"]), 0.5, f"seed {seed}: 50% step")
105
+ checks.require({(int(cell["papyrus"]), float(cell["pitch_um"])) for cell in run["cells"]} == EXPECTED_GRID, f"seed {seed}: complete factorial grid")
106
+ checks.require(source_hashes[seed] == sha256(path), f"seed {seed}: aggregate pins raw file hash")
107
+
108
+ for cell in run["cells"]:
109
+ metric = cell["metrics"]
110
+ positive = np.asarray(metric["positive_score_histogram"], dtype=np.int64)
111
+ negative = np.asarray(metric["negative_score_histogram"], dtype=np.int64)
112
+ tag = f"seed {seed} pap{cell['papyrus']} pitch{cell['pitch_um']:g}"
113
+ checks.require(positive.size == bins and negative.size == bins, f"{tag}: histogram lengths")
114
+ checks.require(int(positive.sum()) == int(metric["surface_voxels"]), f"{tag}: positive histogram count")
115
+ checks.require(int(negative.sum()) == int(metric["near_background_voxels"]), f"{tag}: negative histogram count")
116
+ tpr, fpr = histogram_rates(positive, negative)
117
+ youden = tpr - fpr
118
+ candidates = np.flatnonzero(np.isclose(youden, youden.max(), rtol=0.0, atol=1e-15))
119
+ index = int(candidates[-1])
120
+ checks.close(float(metric["best_youden_threshold"]), index / bins, f"{tag}: best threshold")
121
+ checks.close(float(metric["best_youden_recall"]), float(tpr[index]), f"{tag}: best recall")
122
+ checks.close(float(metric["best_youden_fpr"]), float(fpr[index]), f"{tag}: best FPR")
123
+ for target in (0.01, 0.05):
124
+ valid = np.flatnonzero(fpr <= target)
125
+ target_index = int(valid[0]) if valid.size else bins - 1
126
+ label = f"fpr_{int(target * 100)}pct"
127
+ checks.close(float(metric[f"threshold_at_{label}"]), target_index / bins, f"{tag}: {label} threshold")
128
+ checks.close(float(metric[f"recall_at_{label}"]), float(tpr[target_index]), f"{tag}: {label} recall")
129
+ checks.close(float(metric[f"actual_{label}"]), float(fpr[target_index]), f"{tag}: {label} actual FPR")
130
+
131
+ baseline_lookup = {(int(cell["papyrus"]), float(cell["pitch_um"])): cell for cell in baseline["cells"]}
132
+ seed0_lookup = {(int(cell["papyrus"]), float(cell["pitch_um"])): cell for cell in runs[0]["cells"]}
133
+ checks.require(set(baseline_lookup) == set(seed0_lookup), "seed 0 matches original grid keys")
134
+ for key in sorted(seed0_lookup):
135
+ for metric in ("surface_recall_at_0_5", "near_background_fpr_at_0_5", "near_sheet_auc"):
136
+ checks.close(float(seed0_lookup[key]["metrics"][metric]), float(baseline_lookup[key]["metrics"][metric]), f"seed 0 reproduces original {key} {metric}")
137
+
138
+ grouped = {key: {metric: [] for metric in SUMMARY_METRICS} for key in EXPECTED_GRID}
139
+ pitch_values = {metric: {pitch: [] for pitch in (260.0, 200.0, 150.0, 110.0)} for metric in SUMMARY_METRICS}
140
+ papyrus_values = {metric: {papyrus: [] for papyrus in (35, 50, 65, 90)} for metric in SUMMARY_METRICS}
141
+ for run in runs:
142
+ by_pitch = {metric: {pitch: [] for pitch in pitch_values[metric]} for metric in SUMMARY_METRICS}
143
+ by_papyrus = {metric: {papyrus: [] for papyrus in papyrus_values[metric]} for metric in SUMMARY_METRICS}
144
+ for cell in run["cells"]:
145
+ key = (int(cell["papyrus"]), float(cell["pitch_um"]))
146
+ for metric in SUMMARY_METRICS:
147
+ value = float(cell["metrics"][metric])
148
+ grouped[key][metric].append(value)
149
+ by_pitch[metric][key[1]].append(value)
150
+ by_papyrus[metric][key[0]].append(value)
151
+ for metric in SUMMARY_METRICS:
152
+ for pitch, values in by_pitch[metric].items():
153
+ pitch_values[metric][pitch].append(float(np.mean(values)))
154
+ for papyrus, values in by_papyrus[metric].items():
155
+ papyrus_values[metric][papyrus].append(float(np.mean(values)))
156
+
157
+ aggregate_cells = {(int(cell["papyrus"]), float(cell["pitch_um"])): cell for cell in aggregate["cell_replicate_summaries"]}
158
+ for key in sorted(EXPECTED_GRID):
159
+ for metric in SUMMARY_METRICS:
160
+ compare_summary(checks, aggregate_cells[key]["metrics"][metric], summary(grouped[key][metric]), f"cell {key} {metric}")
161
+ for metric in SUMMARY_METRICS:
162
+ for pitch, values in pitch_values[metric].items():
163
+ compare_summary(checks, aggregate["pitch_summaries"][metric][str(int(pitch))], summary(values), f"pitch {pitch:g} {metric}")
164
+ for papyrus, values in papyrus_values[metric].items():
165
+ compare_summary(checks, aggregate["papyrus_summaries"][metric][str(papyrus)], summary(values), f"papyrus {papyrus} {metric}")
166
+
167
+ def pool(run: dict) -> tuple[np.ndarray, np.ndarray]:
168
+ positive = np.zeros(bins, dtype=np.int64)
169
+ negative = np.zeros(bins, dtype=np.int64)
170
+ for cell in run["cells"]:
171
+ positive += np.asarray(cell["metrics"]["positive_score_histogram"], dtype=np.int64)
172
+ negative += np.asarray(cell["metrics"]["negative_score_histogram"], dtype=np.int64)
173
+ return positive, negative
174
+
175
+ calibration_positive, calibration_negative = pool(runs[0])
176
+ heldout_positive = np.zeros(bins, dtype=np.int64)
177
+ heldout_negative = np.zeros(bins, dtype=np.int64)
178
+ for run in runs[1:]:
179
+ positive, negative = pool(run)
180
+ heldout_positive += positive
181
+ heldout_negative += negative
182
+ _, calibration_fpr_curve = histogram_rates(calibration_positive, calibration_negative)
183
+ operating = aggregate["global_threshold_calibration"]["target_fpr_operating_points"]
184
+ for target in (0.01, 0.05):
185
+ index = int(np.flatnonzero(calibration_fpr_curve <= target)[0])
186
+ record = operating[f"{int(target * 100)}pct"]
187
+ checks.close(float(record["threshold_selected_on_seed_0"]), index / bins, f"global {target:g} threshold")
188
+ calibration_tpr, calibration_fpr = histogram_rates(calibration_positive, calibration_negative)
189
+ heldout_tpr, heldout_fpr = histogram_rates(heldout_positive, heldout_negative)
190
+ checks.close(float(record["calibration_recall"]), float(calibration_tpr[index]), f"global {target:g} calibration recall")
191
+ checks.close(float(record["calibration_fpr"]), float(calibration_fpr[index]), f"global {target:g} calibration FPR")
192
+ checks.close(float(record["heldout_pooled_recall"]), float(heldout_tpr[index]), f"global {target:g} heldout recall")
193
+ checks.close(float(record["heldout_pooled_fpr"]), float(heldout_fpr[index]), f"global {target:g} heldout FPR")
194
+
195
+ auc_pitch = aggregate["pitch_summaries"]["near_sheet_auc"]
196
+ checks.require(
197
+ all(a > b for a, b in zip(auc_pitch["150"]["values_by_seed"], auc_pitch["110"]["values_by_seed"])),
198
+ "pitch 150 AUC exceeds pitch 110 in all five seeds",
199
+ )
200
+ fixed_recall = aggregate["pitch_summaries"]["surface_recall_at_0_5"]
201
+ checks.require(
202
+ all(
203
+ fixed_recall["200"]["values_by_seed"][index]
204
+ < min(fixed_recall[pitch]["values_by_seed"][index] for pitch in ("260", "150", "110"))
205
+ for index in range(5)
206
+ ),
207
+ "pitch 200 recall@0.5 is lowest in all five seeds",
208
+ )
209
+ for metric in ("recall_at_fpr_1pct", "recall_at_fpr_5pct"):
210
+ controlled = aggregate["pitch_summaries"][metric]
211
+ checks.require(
212
+ all(
213
+ controlled["150"]["values_by_seed"][index]
214
+ > controlled["110"]["values_by_seed"][index]
215
+ > controlled["200"]["values_by_seed"][index]
216
+ > controlled["260"]["values_by_seed"][index]
217
+ for index in range(5)
218
+ ),
219
+ f"{metric} ordering 150 > 110 > 200 > 260 holds in all seeds",
220
+ )
221
+ print(f"ALL CHECKS PASSED: {checks.count}")
222
+ return 0
223
+
224
+
225
+ if __name__ == "__main__":
226
+ raise SystemExit(main())