HaiwangYu Claude Opus 4.8 (1M context) commited on
Commit
6fc4876
·
1 Parent(s): cef84bb

Add PDHD/PDVD DNNROI and L1SP TorchScript models with READMEs (20260615)

Browse files

DNNROI (dnn-roi/<exp>/20260615/):
- pdhd: pipe_distill_transformer_6ch.ts
- pdvd: pipe_distill_transformer_6ch.ts (from WireCell/wire-cell-data)

L1SP (l1sp/<exp>/20260615/):
- pdhd: l1sp_dnn_pdhd_v1.ts
- pdvd: l1sp_dnn_pdvd_v1.ts

Each model accompanied by its upstream README.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

dnn-roi/pdhd/20260615/README.pipe_distill_transformer_6ch.md ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # `pipe_distill_transformer_6ch.ts` — PDHD DNN-ROI (FP32, KD-Transformer)
2
+
3
+ Single-file companion to the directory-level [`README.md`](README.md), which is
4
+ the authoritative source for the full PDHD DNN-ROI model set, input layout,
5
+ normalization, and tick-padding rules. This note documents only this one file.
6
+
7
+ | field | value |
8
+ |---|---|
9
+ | file | `dnnroi/pdhd/pipe_distill_transformer_6ch.ts` |
10
+ | size | 21,410,681 bytes (≈20.4 MB) |
11
+ | architecture | MobileNetV3-large UNet |
12
+ | precision | FP32 |
13
+ | input channels | 6 |
14
+ | output | per-pixel `sigmoid` probability in `[0, 1]` (no extra sigmoid in Wire-Cell) |
15
+ | TorchScript mode | `torch.jit.trace` |
16
+ | role | pipeline-reproduced FP32 distillation model |
17
+
18
+ ## What it is
19
+
20
+ The FP32 knowledge-distillation **Transformer-teacher** student for PDHD — the
21
+ "best distillation" leg of the end-to-end run documented in
22
+ `DNN_ROI_SP/docs/full_pipeline.md`. Trained 6-channel on the same corpus and
23
+ split as its sibling baseline (`pipe_base_mbv3_6ch.ts`) and its QAT INT8 model
24
+ (`pipe_qat_transformer_6ch_int8.ts`).
25
+
26
+ | metric (held-out test) | value |
27
+ |---|---|
28
+ | Dice / ROI-eff | 0.9107 / 0.7454 |
29
+ | run-id | `pipe_distill_transformer_6ch` |
30
+ | training | Transformer teacher + bottleneck-feature KD |
31
+
32
+ Passes the toolkit-vs-standalone replay validation (max abs diff < 1.4e-6) —
33
+ see `full_pipeline.md` §4.3.
34
+
35
+ ## Input / output
36
+
37
+ C++ tensor order `(batch=1, ntags=6, nchannels, nticks)`. `nchannels = 800`
38
+ per-plane (`pp` mode) or `1600` (U+V stacked, `mp` mode); the traced UNet is
39
+ fully convolutional and runs at both heights. `nticks = 1500` (PDHD raw 6000
40
+ after `tick_per_slice=4`). The 6 trace tags, in order:
41
+
42
+ ```
43
+ loose_lf, mp2_roi, mp3_roi, tight_lf, decon_charge, gauss
44
+ ```
45
+
46
+ All six tags come from the standard PDHD `OmnibusSigProc` chain (debug +
47
+ multi-plane-protection mode) — no SP-config change needed. Per-channel z-scale
48
+ normalization is **baked into the `.ts`**; run with `input_scale = 1.0`. Tick
49
+ padding for PDHD only requires `nticks % 4 == 0`. Full details in the directory
50
+ [`README.md`](README.md).
51
+
52
+ ## Run with
53
+
54
+ ```
55
+ run_nf_sp_dnnroi_evt.sh -n 6
56
+ ```
57
+
58
+ (then `-M dnnroi/pdhd/pipe_distill_transformer_6ch.ts` to select this `.ts`).
59
+ Wired by `cfg/pgrapher/experiment/pdhd/dnnroi_pp.jsonnet`; loaded by the toolkit
60
+ C++ node `DNNROIFinding`.
61
+
62
+ ## Limitations
63
+
64
+ Trained on **APA0 only** — inference on APAs 1–3 is out-of-domain. The W plane
65
+ is not processed (routed through a `PlaneSelector` passthrough).
dnn-roi/pdhd/20260615/pipe_distill_transformer_6ch.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c3e6cc7b48c633b818d7dab573f8d6c0e0d78796304ae63e41c78d3b3389572d
3
+ size 21410681
dnn-roi/pdvd/20260615/README.pipe_distill_transformer_6ch.md ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # `pipe_distill_transformer_6ch.ts` — PDVD DNN-ROI (FP32, KD-Transformer)
2
+
3
+ Single-file companion to the directory-level [`README.md`](README.md), which is
4
+ the authoritative source for the full PDVD DNN-ROI model set, input layout,
5
+ normalization, and tick-padding rules. This note documents only this one file.
6
+
7
+ | field | value |
8
+ |---|---|
9
+ | file | `dnnroi/pdvd/pipe_distill_transformer_6ch.ts` |
10
+ | size | 21,407,103 bytes (≈20.4 MB) |
11
+ | architecture | MobileNetV3-large UNet |
12
+ | precision | FP32 |
13
+ | input channels | 6 |
14
+ | output | per-pixel `sigmoid` probability in `[0, 1]` (no extra sigmoid in Wire-Cell) |
15
+ | TorchScript mode | `torch.jit.trace` (re-traced 2026-05-23 at per-plane shape) |
16
+ | role | **staged / diagnostic — not wired by default** |
17
+
18
+ ## What it is
19
+
20
+ The FP32 knowledge-distillation **Transformer-teacher** student for PDVD,
21
+ exported from DAGMan cluster 287 (SDCC, 2026-05-20/21). It is the
22
+ same-architecture FP32 reference used in the §11 / §12.4 INT8-vs-FP32
23
+ comparisons against the Transformer INT8 candidate
24
+ (`pipe_qat_transformer_6ch_ep3_int8.ts`). It is **not** the shipped FP32
25
+ deployable — that is `pipe_distill_nestedunet_6ch.ts` (NestedUNet teacher,
26
+ stronger on held-out test). See the directory README's *Staged / diagnostic*
27
+ and *Provenance* sections.
28
+
29
+ | metric (400-event held-out test) | value |
30
+ |---|---|
31
+ | Dice | 0.7680 |
32
+ | run-id | `pdvd_distill_transformer_6ch` |
33
+ | checkpoint | `CP99.pth` (best-val ep 99) |
34
+
35
+ ## Input / output
36
+
37
+ C++ tensor order `(batch=1, ntags=6, nchannels=476, nticks=1600)`, processed
38
+ per-plane (U then V) by `DNNROIFinding`. The 6 trace tags, in order:
39
+
40
+ ```
41
+ loose_lf, mp2_roi, mp3_roi, tight_lf, decon_charge, gauss
42
+ ```
43
+
44
+ Per-channel z-scale normalization is **baked into the `.ts`**; run with
45
+ `input_scale = 1.0`. Tick padding must use a multiple of
46
+ `tick_per_slice·32 = 128`. Full details (the 5-level stride-2 cascade, the
47
+ cross-anode-mean z-scales, the 2026-05-23 per-plane re-trace) are in the
48
+ directory [`README.md`](README.md).
49
+
50
+ ## Run with
51
+
52
+ ```
53
+ run_nf_sp_dnnroi_evt.sh -M dnnroi/pdvd/pipe_distill_transformer_6ch.ts
54
+ ```
55
+
56
+ Wired (when selected) by
57
+ `cfg/pgrapher/experiment/protodunevd/dnnroi_pp.jsonnet`. Loaded by the toolkit
58
+ C++ node `DNNROIFinding`.
dnn-roi/pdvd/20260615/pipe_distill_transformer_6ch.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:908491c5dfe8dc1525f3b1bebc5e3bcdef19282d18cc2b4ba4b8f8b6d1f7b3a3
3
+ size 21407103
l1sp/pdhd/20260615/README.md ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # `l1sp_dnn_pdhd_v1.ts` — PDHD L1SP DNN ROI tagger
2
+
3
+ TorchScript (`.ts`) model loaded by the wire-cell-toolkit L1SP deep-learning
4
+ ROI tagger for ProtoDUNE-HD. It is a **per-ROI binary classifier** (not a
5
+ per-pixel segmentation U-Net like the `dnnroi/` models): for each candidate ROI
6
+ it consumes a short waveform window plus 29 hand-engineered scalar features and
7
+ emits a single `sigmoid` score in `[0, 1]`, which is cut at a default threshold
8
+ to keep or drop the ROI.
9
+
10
+ Full machine-readable spec: [`l1sp_dnn_pdhd_v1.meta.json`](l1sp_dnn_pdhd_v1.meta.json).
11
+
12
+ | field | value |
13
+ |---|---|
14
+ | file | `l1sp/pdhd/l1sp_dnn_pdhd_v1.ts` |
15
+ | size | 917,502 bytes (≈896 KB) |
16
+ | task | per-ROI binary classification (keep / drop) |
17
+ | output | `score` = `sigmoid` in `[0, 1]`, cut at `default_threshold` |
18
+ | **default threshold** | **0.9945** |
19
+ | precision | FP32 |
20
+
21
+ ## Inputs
22
+
23
+ The model `forward` takes **two** tensors (C++ `Pytorch::from_itensor` 4-D
24
+ convention, batch `B`):
25
+
26
+ | input | shape | dtype | contents |
27
+ |---|---|---|---|
28
+ | `waveform` | `(B, 1, 2, 256)` | float32 | channel 0 = `raw/scale`, channel 1 = `decon/scale`, where `scale = max(|raw|.max, |decon|.max, 1.0)`. Window = full ROI right-padded to 256, **or** ±128 ticks centered on `argmax(|decon|)` clamped to ROI bounds. The dim-1 axis is a dummy to satisfy WCT's 4-D requirement. |
29
+ | `scalars` | `(B, 1, 1, 29)` | float32 | the 29 scalar features in `scalar_feature_order` (see meta JSON) |
30
+
31
+ `nbin = 256`, `amp_floor = 1.0`.
32
+
33
+ ### Scalar feature order (29)
34
+
35
+ ```
36
+ nbin_fit, temp_sum, temp1_sum, temp2_sum, max_val, min_val, prev_gap, next_gap,
37
+ flag, ratio, temp_sum_pos, temp_sum_neg, n_above_pos, n_above_neg, argmax_tick,
38
+ argmin_tick, sig_peak, sig_integral, gmax, gauss_fill, gauss_fwhm_frac,
39
+ roi_energy_frac, raw_asym_wide, core_lo, core_hi, core_length, core_fill,
40
+ core_fwhm_frac, core_raw_asym_wide
41
+ ```
42
+
43
+ The 30th feature (`vae_kl`, `kl_index = 29`) appears in the full
44
+ `feature_order` but is **not** part of the model's scalar input — it is the KL
45
+ term from the stage-B VAE (`model_n16.pt`, `vae_n_lat = 16`) used in training,
46
+ not consumed at inference.
47
+
48
+ ## Output
49
+
50
+ `score` of shape `(B, 1, 1, 1)`, a `sigmoid` probability in `[0, 1]`. An ROI is
51
+ kept when `score ≥ default_threshold = 0.9945`. The threshold convention is the
52
+ p99.9 of the data-corpus score distribution from the training run; see the
53
+ experiment dir's `notes.md` for the promoted value.
54
+
55
+ ## Provenance
56
+
57
+ | field | value |
58
+ |---|---|
59
+ | experiment dir | `/nfs/data/1/xqian/toolkit-dev/l1sp_dl_tagger/experiments/stage_a_pu_round4` |
60
+ | VAE checkpoint | `…/experiments/stage_b_vae/model_n16.pt` (`vae_n_lat = 16`) |
61
+ | git sha | `708b942b199e2cc7395e9e3468b926b8146e171b` |
62
+
63
+ ## Note on the PDVD sibling
64
+
65
+ `l1sp/pdvd/l1sp_dnn_pdvd_v1.ts` is the same architecture and I/O layout. The
66
+ differences are the training corpus / detector (PDVD `stage_a_pu_round2_pdvd`)
67
+ and a much lower `default_threshold` (**0.16** vs 0.9945 here) — the two are
68
+ **not** interchangeable; always use the model matching the detector and its
69
+ own threshold.
l1sp/pdhd/20260615/l1sp_dnn_pdhd_v1.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:563be0e7948b1c988323fc3211cf36362c36732d28dc7583652de7bbd4e7ed85
3
+ size 917502
l1sp/pdvd/20260615/README.md ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # `l1sp_dnn_pdvd_v1.ts` — PDVD L1SP DNN ROI tagger
2
+
3
+ TorchScript (`.ts`) model loaded by the wire-cell-toolkit L1SP deep-learning
4
+ ROI tagger for ProtoDUNE Vertical Drift. It is a **per-ROI binary classifier**
5
+ (not a per-pixel segmentation U-Net like the `dnnroi/` models): for each
6
+ candidate ROI it consumes a short waveform window plus 29 hand-engineered scalar
7
+ features and emits a single `sigmoid` score in `[0, 1]`, which is cut at a
8
+ default threshold to keep or drop the ROI.
9
+
10
+ Full machine-readable spec: [`l1sp_dnn_pdvd_v1.meta.json`](l1sp_dnn_pdvd_v1.meta.json).
11
+
12
+ | field | value |
13
+ |---|---|
14
+ | file | `l1sp/pdvd/l1sp_dnn_pdvd_v1.ts` |
15
+ | size | 917,502 bytes (≈896 KB) |
16
+ | task | per-ROI binary classification (keep / drop) |
17
+ | output | `score` = `sigmoid` in `[0, 1]`, cut at `default_threshold` |
18
+ | **default threshold** | **0.16** |
19
+ | precision | FP32 |
20
+
21
+ ## Inputs
22
+
23
+ The model `forward` takes **two** tensors (C++ `Pytorch::from_itensor` 4-D
24
+ convention, batch `B`):
25
+
26
+ | input | shape | dtype | contents |
27
+ |---|---|---|---|
28
+ | `waveform` | `(B, 1, 2, 256)` | float32 | channel 0 = `raw/scale`, channel 1 = `decon/scale`, where `scale = max(|raw|.max, |decon|.max, 1.0)`. Window = full ROI right-padded to 256, **or** ±128 ticks centered on `argmax(|decon|)` clamped to ROI bounds. The dim-1 axis is a dummy to satisfy WCT's 4-D requirement. |
29
+ | `scalars` | `(B, 1, 1, 29)` | float32 | the 29 scalar features in `scalar_feature_order` (see meta JSON) |
30
+
31
+ `nbin = 256`, `amp_floor = 1.0`.
32
+
33
+ ### Scalar feature order (29)
34
+
35
+ ```
36
+ nbin_fit, temp_sum, temp1_sum, temp2_sum, max_val, min_val, prev_gap, next_gap,
37
+ flag, ratio, temp_sum_pos, temp_sum_neg, n_above_pos, n_above_neg, argmax_tick,
38
+ argmin_tick, sig_peak, sig_integral, gmax, gauss_fill, gauss_fwhm_frac,
39
+ roi_energy_frac, raw_asym_wide, core_lo, core_hi, core_length, core_fill,
40
+ core_fwhm_frac, core_raw_asym_wide
41
+ ```
42
+
43
+ The 30th feature (`vae_kl`, `kl_index = 29`) appears in the full
44
+ `feature_order` but is **not** part of the model's scalar input — it is the KL
45
+ term from the stage-B VAE (`model_n16.pt`, `vae_n_lat = 16`) used in training,
46
+ not consumed at inference.
47
+
48
+ ## Output
49
+
50
+ `score` of shape `(B, 1, 1, 1)`, a `sigmoid` probability in `[0, 1]`. An ROI is
51
+ kept when `score ≥ default_threshold = 0.16`. The threshold convention is the
52
+ p99.9 of the data-corpus score distribution from the training run; see the
53
+ experiment dir's `notes.md` for the promoted value.
54
+
55
+ ## Provenance
56
+
57
+ | field | value |
58
+ |---|---|
59
+ | experiment dir | `/nfs/data/1/xqian/toolkit-dev/l1sp_dl_tagger/experiments/stage_a_pu_round2_pdvd` |
60
+ | VAE checkpoint | `…/experiments/stage_b_vae/model_n16.pt` (`vae_n_lat = 16`) |
61
+ | git sha | `cd038ae0da106fd215a54a061824daa835f05fc6` |
62
+
63
+ ## Note on the PDHD sibling
64
+
65
+ `l1sp/pdhd/l1sp_dnn_pdhd_v1.ts` is the same architecture and I/O layout. The
66
+ differences are the training corpus / detector (PDHD `stage_a_pu_round4`) and a
67
+ much higher `default_threshold` (**0.9945** vs 0.16 here) — the two are **not**
68
+ interchangeable; always use the model matching the detector and its own
69
+ threshold.
l1sp/pdvd/20260615/l1sp_dnn_pdvd_v1.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8e757e10a1b61e1f3f35b60c452597875f2cfd63e952af5c74db9beae3d3654
3
+ size 917502