shorleach commited on
Commit
66ea27c
·
verified ·
1 Parent(s): ac672c5

Add multihead amyloid FIB segmentation model

Browse files
README.md CHANGED
@@ -12,6 +12,7 @@ tags:
12
  - preprocess
13
  - IsoNet2
14
  - nnInteractive
 
15
  license_name: tomolens-per-model-licenses
16
  license_link: https://huggingface.co/SynET-Bilab/tomolens-model/blob/main/README.md#license
17
  ---
@@ -24,6 +25,7 @@ Model bundles maintained by SynET-Bilab for TomoLens / SynapseSeg.
24
  | --- | --- | --- | --- | --- | --- |
25
  | [Multihead — Synapse / Intact Cell](multihead/synapse_intact_cell/README.md) | multihead | synapse | intact_cell | IsoNet1 | CC BY-NC 4.0 |
26
  | [Multihead — Synapse / FIB](multihead/synapse_fib/README.md) | multihead | synapse | FIB | Not yet documented | CC BY-NC 4.0 |
 
27
 
28
  Each bundle includes its own description, label definitions, inference configuration and file checksums. These models require their documented runtime; a hosted generic Transformers inference pipeline is not provided.
29
 
 
12
  - preprocess
13
  - IsoNet2
14
  - nnInteractive
15
+ - amyloid
16
  license_name: tomolens-per-model-licenses
17
  license_link: https://huggingface.co/SynET-Bilab/tomolens-model/blob/main/README.md#license
18
  ---
 
25
  | --- | --- | --- | --- | --- | --- |
26
  | [Multihead — Synapse / Intact Cell](multihead/synapse_intact_cell/README.md) | multihead | synapse | intact_cell | IsoNet1 | CC BY-NC 4.0 |
27
  | [Multihead — Synapse / FIB](multihead/synapse_fib/README.md) | multihead | synapse | FIB | Not yet documented | CC BY-NC 4.0 |
28
+ | [Amyloid FIB model](multihead/amyloid_fib/README.md) | multihead | amyloid | FIB | Not yet documented | CC BY-NC 4.0 |
29
 
30
  Each bundle includes its own description, label definitions, inference configuration and file checksums. These models require their documented runtime; a hosted generic Transformers inference pipeline is not provided.
31
 
multihead/amyloid_fib/README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ model_name: Amyloid FIB model
3
+ license: cc-by-nc-4.0
4
+ tags:
5
+ - multihead
6
+ - cryo-et
7
+ - FIB
8
+ - amyloid
9
+ ---
10
+
11
+ # Amyloid FIB model
12
+
13
+ Multihead model for amyloid segmentation in FIB cryo-electron tomograms, published by SynET-Bilab for TomoLens / SynapseSeg.
14
+
15
+ ## Configuration
16
+
17
+ | Field | Value |
18
+ | --- | --- |
19
+ | Model family | `multihead` |
20
+ | Target | `amyloid` |
21
+ | Sample preparation | FIB |
22
+ | Input | One `cryoET` channel; MRC volume |
23
+ | Planned spacing (Z, Y, X) | Approximately 10.96 Å/voxel on all axes |
24
+ | Configuration | `3d_fullres` |
25
+ | Patch size | 96 × 128 × 128 |
26
+ | Normalization | `ZScoreNormalization` |
27
+ | Architecture | `PlainConvUNetHead` |
28
+ | Trainer | `nnUNetTrainerFinetune` |
29
+ | Checkpoint epoch metadata | 985 |
30
+ | Training cases declared in dataset.json | 8 |
31
+
32
+ The checkpoint contains `background` and `amyloid` heads. The original dataset.json uses region-style labels: `background: 0`, `amyloid: [1]`, with `regions_class_order: [1]`. Preserve this region configuration when loading and map the model output to the application's amyloid category.
33
+
34
+ The spacing is read from the supplied plans.json. Use the actual input spacing and the model's preprocessing/resampling workflow. Reconstruction/restoration processing and the validated spacing range have not yet been documented.
35
+
36
+ ## Files
37
+
38
+ - `checkpoint_best.pth`: original `fold_0/checkpoint_best.pth`, without weight conversion or training-state removal.
39
+ - `dataset.json` and `plans.json`: original companion files.
40
+ - `SHA256SUMS`: hashes for the three original files.
41
+ - `validation.json`: publication loading checks.
42
+
43
+ Run `sha256sum -c SHA256SUMS` from this directory to verify the downloaded files.
44
+
45
+ ## Download and loading
46
+
47
+ ```python
48
+ from pathlib import Path
49
+ from huggingface_hub import snapshot_download
50
+ from synapseseg.domain.multihead_model.predict import init_multihead_model_predictor
51
+
52
+ snapshot = Path(snapshot_download(
53
+ repo_id="SynET-Bilab/tomolens-model",
54
+ revision="<full verified HF commit SHA>",
55
+ allow_patterns=["multihead/amyloid_fib/*"],
56
+ ))
57
+ model = snapshot / "multihead/amyloid_fib"
58
+ predictor = init_multihead_model_predictor(
59
+ dataset_json_path=str(model / "dataset.json"),
60
+ plans_json_path=str(model / "plans.json"),
61
+ checkpoint_paths=str(model / "checkpoint_best.pth"),
62
+ )
63
+ ```
64
+
65
+ Replace the revision placeholder with the actual upload commit. Use the customized nnU-Net backend supplied with TomoLens / SynapseSeg, including `PlainConvUNetHead`, `nnUNetTrainerFinetune`, and the explicit-file loader. The application helper above uses CUDA.
66
+
67
+ ## Validation
68
+
69
+ The model passed CPU network construction and strict state-dict loading with the local backend, plus parsing and hashing of the supplied files. No GPU inference or new segmentation-quality evaluation was performed for this publication. Training/base-weight provenance, training code revision, data split, evaluation metrics, citation, and performance measurements remain to be documented.
70
+
71
+ ## License
72
+
73
+ Published under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/), following the publisher's model-release policy. Attribute SynET-Bilab, link to the license and model source, and indicate modifications. Commercial use is not permitted under this license. Runtime dependencies retain their own licenses.
multihead/amyloid_fib/SHA256SUMS ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ d7f286fdbebe1ed2b1d00b9efa0638f90a992ad2dfe724ed181fbc8583d7368b dataset.json
2
+ 342bb2d3180f50333d4704e10f2d9ad7426672c3be65c108300f853ac11e578d plans.json
3
+ 5fef4a82b53520e8f8863678b7183aebd3c700b942a949e8e87c74134c81bb02 checkpoint_best.pth
multihead/amyloid_fib/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5fef4a82b53520e8f8863678b7183aebd3c700b942a949e8e87c74134c81bb02
3
+ size 250013923
multihead/amyloid_fib/dataset.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "channel_names": {
3
+ "0": "cryoET"
4
+ },
5
+ "labels": {
6
+ "background": 0,
7
+ "amyloid": [
8
+ 1
9
+ ]
10
+ },
11
+ "regions_class_order": [
12
+ 1
13
+ ],
14
+ "numTraining": 8,
15
+ "file_ending": ".mrc"
16
+ }
multihead/amyloid_fib/plans.json ADDED
@@ -0,0 +1,364 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset_name": "Dataset016_1tomo_crop_filament",
3
+ "plans_name": "nnUNetPlans",
4
+ "original_median_spacing_after_transp": [
5
+ 10.960000038146973,
6
+ 10.960000038146973,
7
+ 10.960000038146973
8
+ ],
9
+ "original_median_shape_after_transp": [
10
+ 100,
11
+ 360,
12
+ 256
13
+ ],
14
+ "image_reader_writer": "MRCIO",
15
+ "transpose_forward": [
16
+ 0,
17
+ 1,
18
+ 2
19
+ ],
20
+ "transpose_backward": [
21
+ 0,
22
+ 1,
23
+ 2
24
+ ],
25
+ "configurations": {
26
+ "2d": {
27
+ "data_identifier": "nnUNetPlans_2d",
28
+ "preprocessor_name": "DefaultPreprocessor",
29
+ "batch_size": 38,
30
+ "patch_size": [
31
+ 384,
32
+ 256
33
+ ],
34
+ "median_image_size_in_voxels": [
35
+ 360.0,
36
+ 256.0
37
+ ],
38
+ "spacing": [
39
+ 10.960000038146973,
40
+ 10.960000038146973
41
+ ],
42
+ "normalization_schemes": [
43
+ "ZScoreNormalization"
44
+ ],
45
+ "use_mask_for_norm": [
46
+ false
47
+ ],
48
+ "resampling_fn_data": "resample_data_or_seg_to_shape",
49
+ "resampling_fn_seg": "resample_data_or_seg_to_shape",
50
+ "resampling_fn_data_kwargs": {
51
+ "is_seg": false,
52
+ "order": 3,
53
+ "order_z": 0,
54
+ "force_separate_z": null
55
+ },
56
+ "resampling_fn_seg_kwargs": {
57
+ "is_seg": true,
58
+ "order": 1,
59
+ "order_z": 0,
60
+ "force_separate_z": null
61
+ },
62
+ "resampling_fn_probabilities": "resample_data_or_seg_to_shape",
63
+ "resampling_fn_probabilities_kwargs": {
64
+ "is_seg": false,
65
+ "order": 1,
66
+ "order_z": 0,
67
+ "force_separate_z": null
68
+ },
69
+ "architecture": {
70
+ "network_class_name": "nnunetv2.network_architecture.plainconv_unet_head.PlainConvUNetHead",
71
+ "arch_kwargs": {
72
+ "n_stages": 7,
73
+ "features_per_stage": [
74
+ 32,
75
+ 64,
76
+ 128,
77
+ 256,
78
+ 512,
79
+ 512,
80
+ 512
81
+ ],
82
+ "conv_op": "torch.nn.modules.conv.Conv2d",
83
+ "kernel_sizes": [
84
+ [
85
+ 3,
86
+ 3
87
+ ],
88
+ [
89
+ 3,
90
+ 3
91
+ ],
92
+ [
93
+ 3,
94
+ 3
95
+ ],
96
+ [
97
+ 3,
98
+ 3
99
+ ],
100
+ [
101
+ 3,
102
+ 3
103
+ ],
104
+ [
105
+ 3,
106
+ 3
107
+ ],
108
+ [
109
+ 3,
110
+ 3
111
+ ]
112
+ ],
113
+ "strides": [
114
+ [
115
+ 1,
116
+ 1
117
+ ],
118
+ [
119
+ 2,
120
+ 2
121
+ ],
122
+ [
123
+ 2,
124
+ 2
125
+ ],
126
+ [
127
+ 2,
128
+ 2
129
+ ],
130
+ [
131
+ 2,
132
+ 2
133
+ ],
134
+ [
135
+ 2,
136
+ 2
137
+ ],
138
+ [
139
+ 2,
140
+ 2
141
+ ]
142
+ ],
143
+ "n_conv_per_stage": [
144
+ 2,
145
+ 2,
146
+ 2,
147
+ 2,
148
+ 2,
149
+ 2,
150
+ 2
151
+ ],
152
+ "n_conv_per_stage_decoder": [
153
+ 2,
154
+ 2,
155
+ 2,
156
+ 2,
157
+ 2,
158
+ 2
159
+ ],
160
+ "conv_bias": true,
161
+ "norm_op": "torch.nn.modules.instancenorm.InstanceNorm2d",
162
+ "norm_op_kwargs": {
163
+ "eps": 1e-05,
164
+ "affine": true
165
+ },
166
+ "dropout_op": null,
167
+ "dropout_op_kwargs": null,
168
+ "nonlin": "torch.nn.LeakyReLU",
169
+ "nonlin_kwargs": {
170
+ "inplace": true
171
+ },
172
+ "class_names": [
173
+ "background",
174
+ "amyloid"
175
+ ]
176
+ },
177
+ "_kw_requires_import": [
178
+ "conv_op",
179
+ "norm_op",
180
+ "dropout_op",
181
+ "nonlin"
182
+ ]
183
+ },
184
+ "batch_dice": true
185
+ },
186
+ "3d_fullres": {
187
+ "data_identifier": "nnUNetPlans_3d_fullres",
188
+ "preprocessor_name": "DefaultPreprocessor",
189
+ "batch_size": 2,
190
+ "patch_size": [
191
+ 96,
192
+ 128,
193
+ 128
194
+ ],
195
+ "median_image_size_in_voxels": [
196
+ 100.0,
197
+ 360.0,
198
+ 256.0
199
+ ],
200
+ "spacing": [
201
+ 10.960000038146973,
202
+ 10.960000038146973,
203
+ 10.960000038146973
204
+ ],
205
+ "normalization_schemes": [
206
+ "ZScoreNormalization"
207
+ ],
208
+ "use_mask_for_norm": [
209
+ false
210
+ ],
211
+ "resampling_fn_data": "resample_data_or_seg_to_shape",
212
+ "resampling_fn_seg": "resample_data_or_seg_to_shape",
213
+ "resampling_fn_data_kwargs": {
214
+ "is_seg": false,
215
+ "order": 3,
216
+ "order_z": 0,
217
+ "force_separate_z": null
218
+ },
219
+ "resampling_fn_seg_kwargs": {
220
+ "is_seg": true,
221
+ "order": 1,
222
+ "order_z": 0,
223
+ "force_separate_z": null
224
+ },
225
+ "resampling_fn_probabilities": "resample_data_or_seg_to_shape",
226
+ "resampling_fn_probabilities_kwargs": {
227
+ "is_seg": false,
228
+ "order": 1,
229
+ "order_z": 0,
230
+ "force_separate_z": null
231
+ },
232
+ "architecture": {
233
+ "network_class_name": "nnunetv2.network_architecture.plainconv_unet_head.PlainConvUNetHead",
234
+ "arch_kwargs": {
235
+ "n_stages": 6,
236
+ "features_per_stage": [
237
+ 32,
238
+ 64,
239
+ 128,
240
+ 256,
241
+ 320,
242
+ 320
243
+ ],
244
+ "conv_op": "torch.nn.modules.conv.Conv3d",
245
+ "kernel_sizes": [
246
+ [
247
+ 3,
248
+ 3,
249
+ 3
250
+ ],
251
+ [
252
+ 3,
253
+ 3,
254
+ 3
255
+ ],
256
+ [
257
+ 3,
258
+ 3,
259
+ 3
260
+ ],
261
+ [
262
+ 3,
263
+ 3,
264
+ 3
265
+ ],
266
+ [
267
+ 3,
268
+ 3,
269
+ 3
270
+ ],
271
+ [
272
+ 3,
273
+ 3,
274
+ 3
275
+ ]
276
+ ],
277
+ "strides": [
278
+ [
279
+ 1,
280
+ 1,
281
+ 1
282
+ ],
283
+ [
284
+ 2,
285
+ 2,
286
+ 2
287
+ ],
288
+ [
289
+ 2,
290
+ 2,
291
+ 2
292
+ ],
293
+ [
294
+ 2,
295
+ 2,
296
+ 2
297
+ ],
298
+ [
299
+ 2,
300
+ 2,
301
+ 2
302
+ ],
303
+ [
304
+ 2,
305
+ 2,
306
+ 2
307
+ ]
308
+ ],
309
+ "n_conv_per_stage": [
310
+ 2,
311
+ 2,
312
+ 2,
313
+ 2,
314
+ 2,
315
+ 2
316
+ ],
317
+ "n_conv_per_stage_decoder": [
318
+ 2,
319
+ 2,
320
+ 2,
321
+ 2,
322
+ 2
323
+ ],
324
+ "conv_bias": true,
325
+ "norm_op": "torch.nn.modules.instancenorm.InstanceNorm3d",
326
+ "norm_op_kwargs": {
327
+ "eps": 1e-05,
328
+ "affine": true
329
+ },
330
+ "dropout_op": null,
331
+ "dropout_op_kwargs": null,
332
+ "nonlin": "torch.nn.LeakyReLU",
333
+ "nonlin_kwargs": {
334
+ "inplace": true
335
+ },
336
+ "class_names": [
337
+ "background",
338
+ "amyloid"
339
+ ]
340
+ },
341
+ "_kw_requires_import": [
342
+ "conv_op",
343
+ "norm_op",
344
+ "dropout_op",
345
+ "nonlin"
346
+ ]
347
+ },
348
+ "batch_dice": false
349
+ }
350
+ },
351
+ "experiment_planner_used": "MultiHeadPlanner",
352
+ "label_manager": "LabelManager",
353
+ "foreground_intensity_properties_per_channel": {
354
+ "0": {
355
+ "max": -0.08972986042499542,
356
+ "mean": -0.8262748122215271,
357
+ "median": -0.8011928796768188,
358
+ "min": -9.804160118103027,
359
+ "percentile_00_5": -1.9673235416412354,
360
+ "percentile_99_5": -0.10382667183876038,
361
+ "std": 0.40515539050102234
362
+ }
363
+ }
364
+ }
multihead/amyloid_fib/validation.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "status": "passed",
3
+ "checks": [
4
+ "checkpoint deserialization with explicit NumPy allowlist",
5
+ "CPU network construction and strict state-dict load",
6
+ "dataset and plans JSON parsing"
7
+ ],
8
+ "network": "PlainConvUNetHead",
9
+ "trainer": "nnUNetTrainerFinetune",
10
+ "parameters": 31195660,
11
+ "heads": [
12
+ "background",
13
+ "amyloid"
14
+ ],
15
+ "spacing_angstrom_per_voxel": [
16
+ 10.960000038146973,
17
+ 10.960000038146973,
18
+ 10.960000038146973
19
+ ],
20
+ "dataset_labels": {
21
+ "background": 0,
22
+ "amyloid": [
23
+ 1
24
+ ]
25
+ },
26
+ "not_performed": [
27
+ "GPU inference",
28
+ "new segmentation quality evaluation"
29
+ ]
30
+ }