HCedric commited on
Commit
393dd2d
·
verified ·
1 Parent(s): 080c071

Models moved to the model repo HCedric/IMPACTSeg

Browse files
README.md CHANGED
@@ -21,9 +21,9 @@ size_categories:
21
 
22
  <p align="center"><img src="ImpactSeg.png" alt="IMPACT-Seg logo" width="180"></p>
23
 
24
- <h1 align="center">IMPACT-Seg dataset and models</h1>
25
  <p align="center"><b>One model. One label set. CT, CBCT and MRI.</b></p>
26
- <p align="center"><a href="https://github.com/HEMONCedric/IMPACTSeg">💻 Code on GitHub</a> · <a href="#pretrained-models">🧠 Pretrained models</a> · <a href="#labels">🏷️ Labels</a></p>
27
 
28
  <table>
29
  <tr>
@@ -31,15 +31,16 @@ size_categories:
31
  <td>
32
 
33
  IMPACT-Seg is a multi-source anatomical segmentation dataset for **CT, cone-beam CT and MRI** with one shared label
34
- set, and the networks trained on it. It was built for radiotherapy imaging, where the same patient is imaged on a
35
  planning CT, daily CBCTs and MRI.
36
 
37
  - **8,171 volumes**: 4,247 CT, 3,143 CBCT (279 real, 2,864 simulated from CT) and 781 MRI, from public datasets.
38
  - **Two masks per volume**: `mask_fine`, **131 anatomical structures** (organs, vessels, muscles, every vertebra and
39
  rib by level, head-and-neck organs at risk), and `mask_coarse`, 11 body regions and tissues.
40
- - **Pretrained models** in [`models/`](#pretrained-models): a 2.5D and a 3D network, five folds each, and a light coarse 3D network for `mask_coarse`, one model for
41
- the three modalities, run with a plain `konfai PREDICTION`. On real CBCT they reach a Dice of 0.84, where the best
42
- CT-only whole-body tool reaches 0.67.
 
43
  - **Registration**: used as the similarity of a multimodal registration, the 3D network ranks **first on the
44
  Learn2Reg [AbdomenMRCT](https://learn2reg.grand-challenge.org/evaluation/test/leaderboard/) (Dice 0.917) and
45
  [ThoraxCBCT](https://learn2reg.grand-challenge.org/evaluation/thoraxcbct/leaderboard/) (Dice 0.762) leaderboards**.
@@ -60,7 +61,6 @@ CBCT/SynthRAD/<case>/ real CBCT (SynthRAD 2023 and 2025)
60
  CBCT/Synthetic/<case>/ CBCT simulated from TotalSegmentator CTs (three per CT)
61
  MRI/<source>/<case>/
62
  labels.json label ids and names of both masks
63
- models/ pretrained networks, configurations and the code KonfAI needs to load them
64
  ```
65
 
66
  | Folder | Source | Volumes | License | Original dataset |
@@ -110,104 +110,27 @@ TotalSegmentator-MR, `mask_coarse` is an audited pseudo-label from a coarse self
110
 
111
  ## Pretrained models
112
 
113
- Two networks trained on this dataset are provided in `models/`, each as five folds trained on different patient
114
- splits. Both predict 126 of the 131 labels of `mask_fine` (not `mask_coarse`) on CT, CBCT and MRI with the same weights:
115
- the cochleae, the optic chiasm and the optic nerves, a few tens of voxels at the training resolution, were not learned and
116
- are never output (`not_output_by_the_models` in `labels.json`).
117
-
118
- | Folder | Network | Input / patch | Normalization | Checkpoint |
119
- |---|---|---|---|---:|
120
- | `models/2_5D` | 2.5D residual-encoder U-Net | 5 adjacent slices, 288 × 288 | BatchNorm | 411 MB / fold |
121
- | `models/3D` | 3D residual-encoder U-Net | 128 × 128 × 128 | InstanceNorm | 1.2 GB / fold |
122
-
123
- **Key results** (mean Dice on shared structures, out-of-fold predictions, same cases and labels for every method;
124
- preliminary, the manuscript is in preparation):
125
-
126
- | Benchmark | 2.5D | 3D | Best other method |
127
- |---|---:|---:|---:|
128
- | Real CBCT (SynthRAD, 139 cases) | 0.819 | **0.842** | 0.671 (NV-Segment-CTMR) |
129
- | Simulated CBCT (497 cases) | 0.833 | **0.855** | 0.741 (TotalSegmentator) |
130
- | CT (VISCERAL, 58 cases) | 0.833 | 0.850 | **0.853** (TotalSegmentator) |
131
- | MRI (SynthRAD, 52 cases) | 0.817 | **0.822** | 0.820 (TotalSegmentator) |
132
- | External CT, TotalSegmentator v3 (247 cases, 5-fold ensemble) | 0.816 | 0.846 | **0.932** (TotalSegmentator) |
133
- | External MRI, TotalSegmentator v3 (253 cases, 5-fold ensemble) | 0.780 | 0.795 | **0.843** (TotalSegmentator) |
134
-
135
- On one RTX A6000, a whole-body CT takes about 8 s with the 2.5D network and 15 s with the 3D network (series of 30 volumes, model loaded once), with less than 6 GB of GPU memory.
136
-
137
- **Coarse model.** `models/coarse` is a separate, light 3D network (7 M parameters, 57 MB, 3 mm input) that predicts
138
- the 11 classes of `mask_coarse` (subcutaneous tissue, muscle, abdominal and thoracic cavities, bones, glandular
139
- structure, pericardium, breast implant, mediastinum, spinal cord, brain) on CT, CBCT and MRI. It was trained on one
140
- split (2661 training, 100 validation and 64 test volumes; hashes in `models/coarse/model_manifest.json`) and reached a
141
- case-level Dice of 0.888 on CT, 0.859 on CBCT and 0.812 on MRI on the test volumes, and 0.768 on the 100 validation
142
- MRIs. These values are indicative: part of the coarse references are audited pseudo-labels. `coarse/Prediction.yml`
143
- uses the training patch grid (`overlap: None`, no padded patch at the volume edges); with a 50 % overlap, padded
144
- edge patches that contain only air can produce spurious tissue on large fields of view.
145
-
146
- ```text
147
- models/
148
- ├── impactseg_v2/ network and output classes imported by KonfAI
149
- ├── labels.json, preprocessing.json, LICENSE, NOTICE
150
- ├── 2_5D/ and 3D/
151
- │ ├── Prediction.yml KonfAI prediction configuration (whole pipeline)
152
- │ ├── model_manifest.json SHA-256, selected iteration and split hashes per fold
153
- │ └── fold1 … fold5/ foldK.pt (full KonfAI checkpoint), inference_source.yml
154
- ├── coarse/
155
- │ ├── Prediction.yml coarse pipeline (3 mm), writes mask_coarse.nii.gz
156
- │ ├── model_manifest.json SHA-256, selected iteration, split hashes and test results
157
- │ └── coarse.pt full KonfAI checkpoint
158
- ```
159
-
160
- ### Running the models
161
-
162
- The network class is not a stock nnU-Net or MONAI U-Net; it is defined in `models/impactseg_v2/`, which KonfAI
163
- imports from the working directory, so **run the commands from inside `models/`**:
164
-
165
- ```bash
166
- pip install "konfai[itk]==1.8.3" huggingface_hub
167
- python -c "from huggingface_hub import snapshot_download; snapshot_download('HCedric/IMPACTSeg', repo_type='dataset', local_dir='IMPACTSeg', allow_patterns=['models/**'])"
168
- cd IMPACTSeg/models
169
-
170
- # Volumes to segment (CT, CBCT or MRI, any orientation): Dataset/<case>/image.nii.gz
171
- konfai PREDICTION --config 3D/Prediction.yml --models 3D/fold1/fold1.pt --gpu 0 # one fold
172
- konfai PREDICTION --config 3D/Prediction.yml --models 3D/fold{1,2,3,4,5}/fold*.pt --gpu 0 # five-fold ensemble
173
- konfai PREDICTION --config coarse/Prediction.yml --models coarse/coarse.pt --gpu 0 # coarse map
174
- ```
175
-
176
- Use `2_5D/Prediction.yml` with the `2_5D/foldK/foldK.pt` checkpoints for the 2.5D network. Label maps are written to
177
- `Predictions/IMPACTSeg_<network>/Segmentations/<case>/mask_fine.nii.gz` (`IMPACTSeg_coarse/.../mask_coarse.nii.gz`
178
- for the coarse model) on the grid of the input image. To read
179
- another folder, edit `dataset_filenames` in `Prediction.yml`; add `-y` to overwrite a previous run.
180
-
181
- `Prediction.yml` applies the whole pipeline: reorientation to RAS, z-score normalization over the volume (no HU
182
- window), resampling to 1.5 × 1.5 × 2.0 mm, sliding-window inference with 50 % overlap where overlapping patches keep
183
- the most confident prediction (with several `--models`, softmax outputs are averaged first), and return to the
184
- original grid with nearest-neighbour interpolation. These configurations reproduce the predictions of the
185
- evaluation pipeline (identical maps for the 2.5D ensemble, > 99.7 % identical voxels for single folds).
186
-
187
- **Which fold.** Every fold is a complete model. On new data, the five-fold ensemble is the most accurate option.
188
- Do not evaluate a fold or an ensemble on cases of this dataset without checking the split: every case was used for
189
- training by some of the folds (split hashes in `model_manifest.json`).
190
-
191
- **Scope.** Adult anatomy from head and neck to pelvis. Paediatric scans, limb-only or joint acquisitions and
192
- brain-only scans are outside the intended scope. The checkpoints are full KonfAI training checkpoints (with
193
- optimizer state), loaded with pickle: only use files whose SHA-256 matches `model_manifest.json`.
194
-
195
- The training code, the five splits and a crosswalk from the split case IDs to the folders of this repository are in
196
- the code repository: [github.com/HEMONCedric/IMPACTSeg](https://github.com/HEMONCedric/IMPACTSeg).
197
 
198
  ## Intended uses
199
 
200
  - supervised anatomical segmentation and pretraining for CT, CBCT and MRI;
201
  - cross-modality robustness and domain adaptation studies (paired CT/CBCT/MRI of the same patients);
202
  - robustness to CBCT artefacts (real and simulated CBCT with the same anatomy);
203
- - body-region and tissue segmentation with `mask_coarse` and the coarse model.
204
 
205
  ## Licensing and redistribution
206
 
207
  This is a derived research dataset. Each folder keeps the license of its source dataset (table above), several of
208
  which are non-commercial; respect the license and attribution requirements of every source you use, and cite the
209
- original datasets. The model files in `models/` are distributed under the Apache License 2.0 (`models/LICENSE`); they
210
- were trained on these sources, so check that their terms are compatible with your intended use.
211
 
212
  ## Citation
213
 
 
21
 
22
  <p align="center"><img src="ImpactSeg.png" alt="IMPACT-Seg logo" width="180"></p>
23
 
24
+ <h1 align="center">IMPACT-Seg dataset</h1>
25
  <p align="center"><b>One model. One label set. CT, CBCT and MRI.</b></p>
26
+ <p align="center"><a href="https://github.com/HEMONCedric/IMPACTSeg">💻 Code on GitHub</a> · <a href="https://huggingface.co/HCedric/IMPACTSeg">🧠 Pretrained models</a> · <a href="#labels">🏷️ Labels</a></p>
27
 
28
  <table>
29
  <tr>
 
31
  <td>
32
 
33
  IMPACT-Seg is a multi-source anatomical segmentation dataset for **CT, cone-beam CT and MRI** with one shared label
34
+ set. It was built for radiotherapy imaging, where the same patient is imaged on a
35
  planning CT, daily CBCTs and MRI.
36
 
37
  - **8,171 volumes**: 4,247 CT, 3,143 CBCT (279 real, 2,864 simulated from CT) and 781 MRI, from public datasets.
38
  - **Two masks per volume**: `mask_fine`, **131 anatomical structures** (organs, vessels, muscles, every vertebra and
39
  rib by level, head-and-neck organs at risk), and `mask_coarse`, 11 body regions and tissues.
40
+ - **Pretrained models** in the model repository [HCedric/IMPACTSeg](https://huggingface.co/HCedric/IMPACTSeg): a 2.5D
41
+ and a 3D network, five folds each, and a light coarse network for `mask_coarse`, one model for the three modalities,
42
+ run with a plain `konfai PREDICTION`. On real CBCT they reach a Dice of 0.84, where the best CT-only whole-body tool
43
+ reaches 0.67.
44
  - **Registration**: used as the similarity of a multimodal registration, the 3D network ranks **first on the
45
  Learn2Reg [AbdomenMRCT](https://learn2reg.grand-challenge.org/evaluation/test/leaderboard/) (Dice 0.917) and
46
  [ThoraxCBCT](https://learn2reg.grand-challenge.org/evaluation/thoraxcbct/leaderboard/) (Dice 0.762) leaderboards**.
 
61
  CBCT/Synthetic/<case>/ CBCT simulated from TotalSegmentator CTs (three per CT)
62
  MRI/<source>/<case>/
63
  labels.json label ids and names of both masks
 
64
  ```
65
 
66
  | Folder | Source | Volumes | License | Original dataset |
 
110
 
111
  ## Pretrained models
112
 
113
+ The networks trained on this dataset are in the model repository
114
+ **[HCedric/IMPACTSeg](https://huggingface.co/HCedric/IMPACTSeg)**: a 2.5D and a 3D network (five folds each) that
115
+ predict 126 of the 131 labels of `mask_fine` on CT, CBCT and MRI with the same weights, and a coarse network for
116
+ `mask_coarse`, with their KonfAI prediction configurations and results. Every case of this dataset was used for
117
+ training by some of the folds: the training code, the five splits and a crosswalk from the split case IDs to the
118
+ folders of this repository are in the code repository,
119
+ [github.com/HEMONCedric/IMPACTSeg](https://github.com/HEMONCedric/IMPACTSeg).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
 
121
  ## Intended uses
122
 
123
  - supervised anatomical segmentation and pretraining for CT, CBCT and MRI;
124
  - cross-modality robustness and domain adaptation studies (paired CT/CBCT/MRI of the same patients);
125
  - robustness to CBCT artefacts (real and simulated CBCT with the same anatomy);
126
+ - body-region and tissue segmentation with `mask_coarse`.
127
 
128
  ## Licensing and redistribution
129
 
130
  This is a derived research dataset. Each folder keeps the license of its source dataset (table above), several of
131
  which are non-commercial; respect the license and attribution requirements of every source you use, and cite the
132
+ original datasets. The pretrained models are distributed separately, under the Apache License 2.0, in
133
+ [HCedric/IMPACTSeg](https://huggingface.co/HCedric/IMPACTSeg).
134
 
135
  ## Citation
136
 
models/2_5D/Prediction.yml DELETED
@@ -1,131 +0,0 @@
1
- Predictor:
2
- train_name: IMPACTSeg_2_5D
3
- manual_seed: 42
4
- autocast: true
5
- channels_last: false
6
- gpu_checkpoints: None
7
- combine: Mean
8
- data_log: None
9
- check_training_transforms: false
10
- Model:
11
- classpath: impactseg_v2.models:ImpactSegResidualEncoderUNet
12
- ImpactSegResidualEncoderUNet:
13
- dim: 2
14
- in_channels: 5
15
- num_classes: 132
16
- n_stages: 6
17
- features_per_stage:
18
- - 32
19
- - 64
20
- - 128
21
- - 256
22
- - 320
23
- - 512
24
- strides:
25
- - 1
26
- - 2
27
- - 2
28
- - 2
29
- - 2
30
- - 2
31
- kernel_sizes: 3
32
- n_blocks_per_stage:
33
- - 1
34
- - 3
35
- - 4
36
- - 6
37
- - 6
38
- - 6
39
- n_conv_per_stage_decoder:
40
- - 1
41
- - 1
42
- - 1
43
- - 1
44
- - 1
45
- conv_bias: true
46
- negative_slope: 0.01
47
- norm_mode: BATCH
48
- deep_supervision_outputs: 3
49
- ModelPatch: None
50
- nb_batch_per_step: 1
51
- outputs_criterions: None
52
- emit_confidence: false
53
- confidence_threshold: None
54
- allow_head_resize: false
55
- pretrained_from: None
56
- Dataset:
57
- dataset_filenames:
58
- - ./Dataset:a:nii.gz
59
- groups_src:
60
- image:
61
- groups_dest:
62
- image:
63
- is_input: true
64
- transforms:
65
- impactseg_v2.release:LoadWholeVolume: {}
66
- Canonical:
67
- inverse: true
68
- Standardize:
69
- lazy: false
70
- mean: None
71
- std: None
72
- mask: None
73
- inverse: false
74
- TensorCast:
75
- dtype: float32
76
- inverse: false
77
- Resample:
78
- spacing:
79
- - 1.5
80
- - 1.5
81
- - 2.0
82
- align: extent
83
- inverse: true
84
- shape: None
85
- reference: None
86
- reference_group: None
87
- reference_dataset: None
88
- transforms: None
89
- field: None
90
- field_group: None
91
- interpolation: None
92
- fill: 0.0
93
- precision: exact
94
- patch_transforms: None
95
- augmentations: None
96
- subset: None
97
- batch_size: 16
98
- memory_budget: 16 GiB
99
- num_workers: 2
100
- pin_memory: true
101
- prefetch_factor: 2
102
- persistent_workers: true
103
- Patch:
104
- patch_size:
105
- - 1
106
- - 288
107
- - 288
108
- overlap: 0.5
109
- pad_value: -2
110
- extend_slice: 4
111
- outputs_dataset:
112
- Softmax_4:
113
- OutputDataset:
114
- name_class:
115
- impactseg_v2.inference:ProbabilityConfidenceSelectOutputDataset
116
- same_as_group: image:image
117
- dataset_filename: Segmentations:nii.gz
118
- group: mask_fine
119
- before_reduction_transforms: None
120
- after_reduction_transforms:
121
- TensorCast:
122
- dtype: uint8
123
- inverse: false
124
- final_transforms:
125
- TensorCast:
126
- dtype: uint8
127
- inverse: false
128
- patch_combine: None
129
- reduction: Mean
130
- attributes: None
131
- Mean: {}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/2_5D/fold1/fold1.pt DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:b4c97069e1cbd0780f412d6dc18abdac826bc1f7e4ff3e46f53eaf58c43fb345
3
- size 411143195
 
 
 
 
models/2_5D/fold1/inference_source.yml DELETED
@@ -1,51 +0,0 @@
1
- Trainer:
2
- Model:
3
- classpath: impactseg_v2.models:ImpactSegResidualEncoderUNet
4
- ImpactSegResidualEncoderUNet:
5
- dim: 2
6
- in_channels: 5
7
- num_classes: 132
8
- n_stages: 6
9
- features_per_stage:
10
- - 32
11
- - 64
12
- - 128
13
- - 256
14
- - 320
15
- - 512
16
- strides:
17
- - 1
18
- - 2
19
- - 2
20
- - 2
21
- - 2
22
- - 2
23
- kernel_sizes: 3
24
- n_blocks_per_stage:
25
- - 1
26
- - 3
27
- - 4
28
- - 6
29
- - 6
30
- - 6
31
- n_conv_per_stage_decoder:
32
- - 1
33
- - 1
34
- - 1
35
- - 1
36
- - 1
37
- conv_bias: true
38
- negative_slope: 0.01
39
- norm_mode: BATCH
40
- deep_supervision_outputs: 3
41
- ModelPatch: None
42
- nb_batch_per_step: 1
43
- Dataset:
44
- Patch:
45
- patch_size:
46
- - 1
47
- - 288
48
- - 288
49
- overlap: None
50
- pad_value: -2
51
- extend_slice: 4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/2_5D/fold2/fold2.pt DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:0aa318e85ca509172361c78e2f2e0083ab7068ed932039e567be65caf5f8d8a9
3
- size 411143195
 
 
 
 
models/2_5D/fold2/inference_source.yml DELETED
@@ -1,51 +0,0 @@
1
- Trainer:
2
- Model:
3
- classpath: impactseg_v2.models:ImpactSegResidualEncoderUNet
4
- ImpactSegResidualEncoderUNet:
5
- dim: 2
6
- in_channels: 5
7
- num_classes: 132
8
- n_stages: 6
9
- features_per_stage:
10
- - 32
11
- - 64
12
- - 128
13
- - 256
14
- - 320
15
- - 512
16
- strides:
17
- - 1
18
- - 2
19
- - 2
20
- - 2
21
- - 2
22
- - 2
23
- kernel_sizes: 3
24
- n_blocks_per_stage:
25
- - 1
26
- - 3
27
- - 4
28
- - 6
29
- - 6
30
- - 6
31
- n_conv_per_stage_decoder:
32
- - 1
33
- - 1
34
- - 1
35
- - 1
36
- - 1
37
- conv_bias: true
38
- negative_slope: 0.01
39
- norm_mode: BATCH
40
- deep_supervision_outputs: 3
41
- ModelPatch: None
42
- nb_batch_per_step: 1
43
- Dataset:
44
- Patch:
45
- patch_size:
46
- - 1
47
- - 288
48
- - 288
49
- overlap: None
50
- pad_value: -2
51
- extend_slice: 4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/2_5D/fold3/fold3.pt DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:f4230131750a9057a8e57f52f968dc91da96277cf62b3a1c6d2ffa1b7ae924e9
3
- size 411143195
 
 
 
 
models/2_5D/fold3/inference_source.yml DELETED
@@ -1,51 +0,0 @@
1
- Trainer:
2
- Model:
3
- classpath: impactseg_v2.models:ImpactSegResidualEncoderUNet
4
- ImpactSegResidualEncoderUNet:
5
- dim: 2
6
- in_channels: 5
7
- num_classes: 132
8
- n_stages: 6
9
- features_per_stage:
10
- - 32
11
- - 64
12
- - 128
13
- - 256
14
- - 320
15
- - 512
16
- strides:
17
- - 1
18
- - 2
19
- - 2
20
- - 2
21
- - 2
22
- - 2
23
- kernel_sizes: 3
24
- n_blocks_per_stage:
25
- - 1
26
- - 3
27
- - 4
28
- - 6
29
- - 6
30
- - 6
31
- n_conv_per_stage_decoder:
32
- - 1
33
- - 1
34
- - 1
35
- - 1
36
- - 1
37
- conv_bias: true
38
- negative_slope: 0.01
39
- norm_mode: BATCH
40
- deep_supervision_outputs: 3
41
- ModelPatch: None
42
- nb_batch_per_step: 1
43
- Dataset:
44
- Patch:
45
- patch_size:
46
- - 1
47
- - 288
48
- - 288
49
- overlap: None
50
- pad_value: -2
51
- extend_slice: 4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/2_5D/fold4/fold4.pt DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:cce529f2e56d02d3194682874b097bfceca45a98c5cc8a93e4e8ee26e0845b1c
3
- size 411143195
 
 
 
 
models/2_5D/fold4/inference_source.yml DELETED
@@ -1,51 +0,0 @@
1
- Trainer:
2
- Model:
3
- classpath: impactseg_v2.models:ImpactSegResidualEncoderUNet
4
- ImpactSegResidualEncoderUNet:
5
- dim: 2
6
- in_channels: 5
7
- num_classes: 132
8
- n_stages: 6
9
- features_per_stage:
10
- - 32
11
- - 64
12
- - 128
13
- - 256
14
- - 320
15
- - 512
16
- strides:
17
- - 1
18
- - 2
19
- - 2
20
- - 2
21
- - 2
22
- - 2
23
- kernel_sizes: 3
24
- n_blocks_per_stage:
25
- - 1
26
- - 3
27
- - 4
28
- - 6
29
- - 6
30
- - 6
31
- n_conv_per_stage_decoder:
32
- - 1
33
- - 1
34
- - 1
35
- - 1
36
- - 1
37
- conv_bias: true
38
- negative_slope: 0.01
39
- norm_mode: BATCH
40
- deep_supervision_outputs: 3
41
- ModelPatch: None
42
- nb_batch_per_step: 1
43
- Dataset:
44
- Patch:
45
- patch_size:
46
- - 1
47
- - 288
48
- - 288
49
- overlap: None
50
- pad_value: -2
51
- extend_slice: 4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/2_5D/fold5/fold5.pt DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:e0bdf4904d4477f54e1d8b87c71662e295e0037ab1b3835662a94c35b197c585
3
- size 411143195
 
 
 
 
models/2_5D/fold5/inference_source.yml DELETED
@@ -1,51 +0,0 @@
1
- Trainer:
2
- Model:
3
- classpath: impactseg_v2.models:ImpactSegResidualEncoderUNet
4
- ImpactSegResidualEncoderUNet:
5
- dim: 2
6
- in_channels: 5
7
- num_classes: 132
8
- n_stages: 6
9
- features_per_stage:
10
- - 32
11
- - 64
12
- - 128
13
- - 256
14
- - 320
15
- - 512
16
- strides:
17
- - 1
18
- - 2
19
- - 2
20
- - 2
21
- - 2
22
- - 2
23
- kernel_sizes: 3
24
- n_blocks_per_stage:
25
- - 1
26
- - 3
27
- - 4
28
- - 6
29
- - 6
30
- - 6
31
- n_conv_per_stage_decoder:
32
- - 1
33
- - 1
34
- - 1
35
- - 1
36
- - 1
37
- conv_bias: true
38
- negative_slope: 0.01
39
- norm_mode: BATCH
40
- deep_supervision_outputs: 3
41
- ModelPatch: None
42
- nb_batch_per_step: 1
43
- Dataset:
44
- Patch:
45
- patch_size:
46
- - 1
47
- - 288
48
- - 288
49
- overlap: None
50
- pad_value: -2
51
- extend_slice: 4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/2_5D/model_manifest.json DELETED
@@ -1,151 +0,0 @@
1
- {
2
- "schema": "impactseg-model-release/v1",
3
- "network": "2_5D",
4
- "convention_id": "impactseg_ct_formalism_v3",
5
- "checkpoint_format": "Full KonfAI training checkpoint",
6
- "folds": {
7
- "1": {
8
- "checkpoint": "fold1/fold1.pt",
9
- "sha256": "b4c97069e1cbd0780f412d6dc18abdac826bc1f7e4ff3e46f53eaf58c43fb345",
10
- "bytes": 411143195,
11
- "inference_config": "fold1/inference_source.yml",
12
- "inference_config_sha256": "13b6d624582c7946d4361fa8112e61f113b8fc40a383154add8d2d98826ab5e3",
13
- "source_run": "IMPACTSeg_fold1_preprocessed_native_sgd_poly_2M_20260924_10-50-22",
14
- "selected_iteration": 1900000,
15
- "training_limit": 2000000,
16
- "checkpoint_selection": "BEST validation loss (single checkpoint kept by KonfAI)",
17
- "split": {
18
- "split_dir": "Code_v2/splits/fold1",
19
- "counts": {
20
- "train": 1872,
21
- "validation": 300,
22
- "test": 171
23
- },
24
- "sha256": {
25
- "train": "9709c356c22288e46c364f6b7405ad196d21a868f44e9ebf0118771e4bb20834",
26
- "validation": "4acd197f39cf79adaeb0a1ebd2bac7c5f33cc4c77e59fb462a642c02775c803b",
27
- "test": "d25dab9be79fd8d828b894a3092d93f6f9ec2bf79d5ba8d69ad11f6b6a238523",
28
- "fit": "5e1a6365dfbcc51501bb4acd28a1663580406a8d943a95e0461f013d1aed422a"
29
- },
30
- "test_file": "Code_v2/splits/fold1/test.txt"
31
- },
32
- "container_sha256": "79cacb50c92368c9ad9d1343db907b8610e84eb3101686752c5087114eef5001"
33
- },
34
- "2": {
35
- "checkpoint": "fold2/fold2.pt",
36
- "sha256": "0aa318e85ca509172361c78e2f2e0083ab7068ed932039e567be65caf5f8d8a9",
37
- "bytes": 411143195,
38
- "inference_config": "fold2/inference_source.yml",
39
- "inference_config_sha256": "13b6d624582c7946d4361fa8112e61f113b8fc40a383154add8d2d98826ab5e3",
40
- "source_run": "IMPACTSeg_fold2_preprocessed_native_sgd_poly_2M_20260924_10-50-22",
41
- "selected_iteration": 1700000,
42
- "training_limit": 2000000,
43
- "checkpoint_selection": "BEST validation loss (single checkpoint kept by KonfAI)",
44
- "split": {
45
- "split_dir": "Code_v2/splits/fold2",
46
- "counts": {
47
- "train": 1875,
48
- "validation": 300,
49
- "test": 168
50
- },
51
- "sha256": {
52
- "train": "251d4ae8aefa112c164d09ad2df5a104f4e8383fd87624b6801144710238b607",
53
- "validation": "ed950a466c22767fe2fc4bd88a38506004361c668ca9d2b4911c87ec4222ec92",
54
- "test": "28babdbf364e8225269a60532a35ff948028678a6e674ab28cbdbd9f03ec9b0a",
55
- "fit": "ec04bf0e44d63ff10632852199047bc636f63e9a9c997c58a5456fa026e7c168"
56
- },
57
- "test_file": "Code_v2/splits/fold2/test.txt"
58
- },
59
- "container_sha256": "79cacb50c92368c9ad9d1343db907b8610e84eb3101686752c5087114eef5001"
60
- },
61
- "3": {
62
- "checkpoint": "fold3/fold3.pt",
63
- "sha256": "f4230131750a9057a8e57f52f968dc91da96277cf62b3a1c6d2ffa1b7ae924e9",
64
- "bytes": 411143195,
65
- "inference_config": "fold3/inference_source.yml",
66
- "inference_config_sha256": "13b6d624582c7946d4361fa8112e61f113b8fc40a383154add8d2d98826ab5e3",
67
- "source_run": "IMPACTSeg_fold3_preprocessed_native_sgd_poly_2M_20260925_01-20-50",
68
- "selected_iteration": 1700000,
69
- "training_limit": 2000000,
70
- "checkpoint_selection": "BEST validation loss (single checkpoint kept by KonfAI)",
71
- "split": {
72
- "split_dir": "Code_v2/splits/fold3",
73
- "counts": {
74
- "train": 1875,
75
- "validation": 300,
76
- "test": 168
77
- },
78
- "sha256": {
79
- "train": "fbfb8c38f007b7020937d4439862ecf6a51ce8e0d54e6b66bcc877df11f481f0",
80
- "validation": "505f56a3ce96108852702da60b0bd14dc3506cbec6372ee378b472bac7a3ae28",
81
- "test": "1115ce4dcc4393880655d126adba4d920f29e97680a97bfc1506840a46181c75",
82
- "fit": "62416e83d16a7e63555f308f17ab02319bb26d7fcb0633244ff52fc322a64fc0"
83
- },
84
- "test_file": "Code_v2/splits/fold3/test.txt"
85
- },
86
- "container_sha256": "79cacb50c92368c9ad9d1343db907b8610e84eb3101686752c5087114eef5001"
87
- },
88
- "4": {
89
- "checkpoint": "fold4/fold4.pt",
90
- "sha256": "cce529f2e56d02d3194682874b097bfceca45a98c5cc8a93e4e8ee26e0845b1c",
91
- "bytes": 411143195,
92
- "inference_config": "fold4/inference_source.yml",
93
- "inference_config_sha256": "13b6d624582c7946d4361fa8112e61f113b8fc40a383154add8d2d98826ab5e3",
94
- "source_run": "IMPACTSeg_fold4_sgd_poly_resume_2M_20261007_18-09-15",
95
- "selected_iteration": 1800000,
96
- "training_limit": 2000000,
97
- "checkpoint_selection": "BEST validation loss (single checkpoint kept by KonfAI)",
98
- "split": {
99
- "split_dir": "Code_v2/splits/fold4",
100
- "counts": {
101
- "train": 1875,
102
- "validation": 300,
103
- "test": 168
104
- },
105
- "sha256": {
106
- "train": "38c887848ac4271d9f138dc35576611340972202dffede6702997d623a2c8de6",
107
- "validation": "d5ec4d93dc8380d4e2026075a980cdaf80459cc862e90c7ab4866d0001143093",
108
- "test": "172cd2835a0c084d9f438afbd329b95837744428648dd4ac67c1c969d9e76948",
109
- "fit": "a72b9246332f3798fb76a70eda18db0198ea32f94cd78869bf9102da255061da"
110
- },
111
- "test_file": "Code_v2/splits/fold4/test.txt"
112
- },
113
- "container_sha256": "fbcc225e0f1e43ad4f9ea344020c060596ff30c4fa58ae61b4de8f1fbdfb5514"
114
- },
115
- "5": {
116
- "checkpoint": "fold5/fold5.pt",
117
- "sha256": "e0bdf4904d4477f54e1d8b87c71662e295e0037ab1b3835662a94c35b197c585",
118
- "bytes": 411143195,
119
- "inference_config": "fold5/inference_source.yml",
120
- "inference_config_sha256": "13b6d624582c7946d4361fa8112e61f113b8fc40a383154add8d2d98826ab5e3",
121
- "source_run": "IMPACTSeg_fold5_preprocessed_native_sgd_poly_2M_20260918_15-13-12",
122
- "selected_iteration": 1700000,
123
- "training_limit": 2000000,
124
- "checkpoint_selection": "BEST validation loss (single checkpoint kept by KonfAI)",
125
- "split": {
126
- "split_dir": "Code_v2/splits/fold5",
127
- "counts": {
128
- "train": 1875,
129
- "validation": 300,
130
- "test": 168
131
- },
132
- "sha256": {
133
- "train": "447d04466f4be83fb61475daac3cefea9855aef434a8b7f9553d921d19a7901a",
134
- "validation": "e64cc5121b83e8e2c178eb8cb0dd52278c790553c5df34662715772a157f6849",
135
- "test": "80a0fac9f946feb68af3b9adba054e6c6c97fc20d4f77462647e6cd0efe89569",
136
- "fit": "6ff3fab18a33d01c57a556f9a60748a7b60aaf912dc7343bdd9c53fd98a76fcd"
137
- },
138
- "test_file": "Code_v2/splits/fold5/test.txt"
139
- },
140
- "container_sha256": "79cacb50c92368c9ad9d1343db907b8610e84eb3101686752c5087114eef5001"
141
- }
142
- },
143
- "available_folds": [
144
- 1,
145
- 2,
146
- 3,
147
- 4,
148
- 5
149
- ],
150
- "not_exported_folds": []
151
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/3D/Prediction.yml DELETED
@@ -1,131 +0,0 @@
1
- Predictor:
2
- train_name: IMPACTSeg_3D
3
- manual_seed: 42
4
- autocast: true
5
- channels_last: false
6
- gpu_checkpoints: None
7
- combine: Mean
8
- data_log: None
9
- check_training_transforms: false
10
- Model:
11
- classpath: impactseg_v2.models:ImpactSegResidualEncoderUNet
12
- ImpactSegResidualEncoderUNet:
13
- dim: 3
14
- in_channels: 1
15
- num_classes: 132
16
- n_stages: 6
17
- features_per_stage:
18
- - 32
19
- - 64
20
- - 128
21
- - 256
22
- - 320
23
- - 512
24
- strides:
25
- - 1
26
- - 2
27
- - 2
28
- - 2
29
- - 2
30
- - 2
31
- kernel_sizes: 3
32
- n_blocks_per_stage:
33
- - 1
34
- - 3
35
- - 4
36
- - 6
37
- - 6
38
- - 6
39
- n_conv_per_stage_decoder:
40
- - 1
41
- - 1
42
- - 1
43
- - 1
44
- - 1
45
- conv_bias: true
46
- negative_slope: 0.01
47
- norm_mode: INSTANCE_AFFINE
48
- deep_supervision_outputs: 3
49
- ModelPatch: None
50
- nb_batch_per_step: 1
51
- outputs_criterions: None
52
- emit_confidence: false
53
- confidence_threshold: None
54
- allow_head_resize: false
55
- pretrained_from: None
56
- Dataset:
57
- dataset_filenames:
58
- - ./Dataset:a:nii.gz
59
- groups_src:
60
- image:
61
- groups_dest:
62
- image:
63
- is_input: true
64
- transforms:
65
- impactseg_v2.release:LoadWholeVolume: {}
66
- Canonical:
67
- inverse: true
68
- Standardize:
69
- lazy: false
70
- mean: None
71
- std: None
72
- mask: None
73
- inverse: false
74
- TensorCast:
75
- dtype: float32
76
- inverse: false
77
- Resample:
78
- spacing:
79
- - 1.5
80
- - 1.5
81
- - 2.0
82
- align: extent
83
- inverse: true
84
- shape: None
85
- reference: None
86
- reference_group: None
87
- reference_dataset: None
88
- transforms: None
89
- field: None
90
- field_group: None
91
- interpolation: None
92
- fill: 0.0
93
- precision: exact
94
- patch_transforms: None
95
- augmentations: None
96
- subset: None
97
- batch_size: 1
98
- memory_budget: 16 GiB
99
- num_workers: 2
100
- pin_memory: true
101
- prefetch_factor: 2
102
- persistent_workers: true
103
- Patch:
104
- patch_size:
105
- - 128
106
- - 128
107
- - 128
108
- overlap: 0.5
109
- pad_value: -2
110
- extend_slice: 0
111
- outputs_dataset:
112
- Softmax_4:
113
- OutputDataset:
114
- name_class:
115
- impactseg_v2.inference:ProbabilityConfidenceSelectOutputDataset
116
- same_as_group: image:image
117
- dataset_filename: Segmentations:nii.gz
118
- group: mask_fine
119
- before_reduction_transforms: None
120
- after_reduction_transforms:
121
- TensorCast:
122
- dtype: uint8
123
- inverse: false
124
- final_transforms:
125
- TensorCast:
126
- dtype: uint8
127
- inverse: false
128
- patch_combine: None
129
- reduction: Mean
130
- attributes: None
131
- Mean: {}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/3D/fold1/fold1.pt DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:d6bd2e6e5b719674ffbcecebd970b01caf80164128ee3572569e1742f027f5ab
3
- size 1217332619
 
 
 
 
models/3D/fold1/inference_source.yml DELETED
@@ -1,51 +0,0 @@
1
- Trainer:
2
- Model:
3
- classpath: impactseg_v2.models:ImpactSegResidualEncoderUNet
4
- ImpactSegResidualEncoderUNet:
5
- dim: 3
6
- in_channels: 1
7
- num_classes: 132
8
- n_stages: 6
9
- features_per_stage:
10
- - 32
11
- - 64
12
- - 128
13
- - 256
14
- - 320
15
- - 512
16
- strides:
17
- - 1
18
- - 2
19
- - 2
20
- - 2
21
- - 2
22
- - 2
23
- kernel_sizes: 3
24
- n_blocks_per_stage:
25
- - 1
26
- - 3
27
- - 4
28
- - 6
29
- - 6
30
- - 6
31
- n_conv_per_stage_decoder:
32
- - 1
33
- - 1
34
- - 1
35
- - 1
36
- - 1
37
- conv_bias: true
38
- negative_slope: 0.01
39
- norm_mode: INSTANCE_AFFINE
40
- deep_supervision_outputs: 3
41
- ModelPatch: None
42
- nb_batch_per_step: 1
43
- Dataset:
44
- Patch:
45
- patch_size:
46
- - 128
47
- - 128
48
- - 128
49
- overlap: None
50
- pad_value: -2
51
- extend_slice: 0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/3D/fold2/fold2.pt DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:08c53b9aa191b11de6c15781a48d65a4c26ff9606a02a527fb02541b3955a79e
3
- size 1217332619
 
 
 
 
models/3D/fold2/inference_source.yml DELETED
@@ -1,51 +0,0 @@
1
- Trainer:
2
- Model:
3
- classpath: impactseg_v2.models:ImpactSegResidualEncoderUNet
4
- ImpactSegResidualEncoderUNet:
5
- dim: 3
6
- in_channels: 1
7
- num_classes: 132
8
- n_stages: 6
9
- features_per_stage:
10
- - 32
11
- - 64
12
- - 128
13
- - 256
14
- - 320
15
- - 512
16
- strides:
17
- - 1
18
- - 2
19
- - 2
20
- - 2
21
- - 2
22
- - 2
23
- kernel_sizes: 3
24
- n_blocks_per_stage:
25
- - 1
26
- - 3
27
- - 4
28
- - 6
29
- - 6
30
- - 6
31
- n_conv_per_stage_decoder:
32
- - 1
33
- - 1
34
- - 1
35
- - 1
36
- - 1
37
- conv_bias: true
38
- negative_slope: 0.01
39
- norm_mode: INSTANCE_AFFINE
40
- deep_supervision_outputs: 3
41
- ModelPatch: None
42
- nb_batch_per_step: 1
43
- Dataset:
44
- Patch:
45
- patch_size:
46
- - 128
47
- - 128
48
- - 128
49
- overlap: None
50
- pad_value: -2
51
- extend_slice: 0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/3D/fold3/fold3.pt DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:746021d6e2d9b6ec6030f68e0cd4a9d1d4f73826b14c67f0be0089b27ea5739d
3
- size 1217332619
 
 
 
 
models/3D/fold3/inference_source.yml DELETED
@@ -1,51 +0,0 @@
1
- Trainer:
2
- Model:
3
- classpath: impactseg_v2.models:ImpactSegResidualEncoderUNet
4
- ImpactSegResidualEncoderUNet:
5
- dim: 3
6
- in_channels: 1
7
- num_classes: 132
8
- n_stages: 6
9
- features_per_stage:
10
- - 32
11
- - 64
12
- - 128
13
- - 256
14
- - 320
15
- - 512
16
- strides:
17
- - 1
18
- - 2
19
- - 2
20
- - 2
21
- - 2
22
- - 2
23
- kernel_sizes: 3
24
- n_blocks_per_stage:
25
- - 1
26
- - 3
27
- - 4
28
- - 6
29
- - 6
30
- - 6
31
- n_conv_per_stage_decoder:
32
- - 1
33
- - 1
34
- - 1
35
- - 1
36
- - 1
37
- conv_bias: true
38
- negative_slope: 0.01
39
- norm_mode: INSTANCE_AFFINE
40
- deep_supervision_outputs: 3
41
- ModelPatch: None
42
- nb_batch_per_step: 1
43
- Dataset:
44
- Patch:
45
- patch_size:
46
- - 128
47
- - 128
48
- - 128
49
- overlap: None
50
- pad_value: -2
51
- extend_slice: 0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/3D/fold4/fold4.pt DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:7464d47fcd4fd94e7cfce9d42a301380a56bdd698844bf5a0d2467339b44f51a
3
- size 1217332619
 
 
 
 
models/3D/fold4/inference_source.yml DELETED
@@ -1,51 +0,0 @@
1
- Trainer:
2
- Model:
3
- classpath: impactseg_v2.models:ImpactSegResidualEncoderUNet
4
- ImpactSegResidualEncoderUNet:
5
- dim: 3
6
- in_channels: 1
7
- num_classes: 132
8
- n_stages: 6
9
- features_per_stage:
10
- - 32
11
- - 64
12
- - 128
13
- - 256
14
- - 320
15
- - 512
16
- strides:
17
- - 1
18
- - 2
19
- - 2
20
- - 2
21
- - 2
22
- - 2
23
- kernel_sizes: 3
24
- n_blocks_per_stage:
25
- - 1
26
- - 3
27
- - 4
28
- - 6
29
- - 6
30
- - 6
31
- n_conv_per_stage_decoder:
32
- - 1
33
- - 1
34
- - 1
35
- - 1
36
- - 1
37
- conv_bias: true
38
- negative_slope: 0.01
39
- norm_mode: INSTANCE_AFFINE
40
- deep_supervision_outputs: 3
41
- ModelPatch: None
42
- nb_batch_per_step: 1
43
- Dataset:
44
- Patch:
45
- patch_size:
46
- - 128
47
- - 128
48
- - 128
49
- overlap: None
50
- pad_value: -2
51
- extend_slice: 0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/3D/fold5/fold5.pt DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:b2f1cef094f5b5243bc4ea38a66c78659a92a8000c916354544720f31c4bfaaf
3
- size 1217332619
 
 
 
 
models/3D/fold5/inference_source.yml DELETED
@@ -1,51 +0,0 @@
1
- Trainer:
2
- Model:
3
- classpath: impactseg_v2.models:ImpactSegResidualEncoderUNet
4
- ImpactSegResidualEncoderUNet:
5
- dim: 3
6
- in_channels: 1
7
- num_classes: 132
8
- n_stages: 6
9
- features_per_stage:
10
- - 32
11
- - 64
12
- - 128
13
- - 256
14
- - 320
15
- - 512
16
- strides:
17
- - 1
18
- - 2
19
- - 2
20
- - 2
21
- - 2
22
- - 2
23
- kernel_sizes: 3
24
- n_blocks_per_stage:
25
- - 1
26
- - 3
27
- - 4
28
- - 6
29
- - 6
30
- - 6
31
- n_conv_per_stage_decoder:
32
- - 1
33
- - 1
34
- - 1
35
- - 1
36
- - 1
37
- conv_bias: true
38
- negative_slope: 0.01
39
- norm_mode: INSTANCE_AFFINE
40
- deep_supervision_outputs: 3
41
- ModelPatch: None
42
- nb_batch_per_step: 1
43
- Dataset:
44
- Patch:
45
- patch_size:
46
- - 128
47
- - 128
48
- - 128
49
- overlap: None
50
- pad_value: -2
51
- extend_slice: 0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/3D/model_manifest.json DELETED
@@ -1,151 +0,0 @@
1
- {
2
- "schema": "impactseg-model-release/v1",
3
- "network": "3D",
4
- "convention_id": "impactseg_ct_formalism_v3",
5
- "checkpoint_format": "Full KonfAI training checkpoint",
6
- "folds": {
7
- "1": {
8
- "checkpoint": "fold1/fold1.pt",
9
- "sha256": "d6bd2e6e5b719674ffbcecebd970b01caf80164128ee3572569e1742f027f5ab",
10
- "bytes": 1217332619,
11
- "inference_config": "fold1/inference_source.yml",
12
- "inference_config_sha256": "c54470c27c7b30f48501ac1e88d37a9b986ade773a78e8a62ecb62500836ab4c",
13
- "source_run": "IMPACTSeg_fold1_3D128_B1_sgd_poly_resume_2M_20261007_18-09-15",
14
- "selected_iteration": 2000000,
15
- "training_limit": 2000000,
16
- "checkpoint_selection": "BEST validation loss (single checkpoint kept by KonfAI)",
17
- "split": {
18
- "split_dir": "Code_v2/splits/fold1",
19
- "counts": {
20
- "train": 1872,
21
- "validation": 300,
22
- "test": 171
23
- },
24
- "sha256": {
25
- "train": "9709c356c22288e46c364f6b7405ad196d21a868f44e9ebf0118771e4bb20834",
26
- "validation": "4acd197f39cf79adaeb0a1ebd2bac7c5f33cc4c77e59fb462a642c02775c803b",
27
- "test": "d25dab9be79fd8d828b894a3092d93f6f9ec2bf79d5ba8d69ad11f6b6a238523",
28
- "fit": "5e1a6365dfbcc51501bb4acd28a1663580406a8d943a95e0461f013d1aed422a"
29
- },
30
- "test_file": "Code_v2/splits/fold1/test.txt"
31
- },
32
- "container_sha256": "fbcc225e0f1e43ad4f9ea344020c060596ff30c4fa58ae61b4de8f1fbdfb5514"
33
- },
34
- "2": {
35
- "checkpoint": "fold2/fold2.pt",
36
- "sha256": "08c53b9aa191b11de6c15781a48d65a4c26ff9606a02a527fb02541b3955a79e",
37
- "bytes": 1217332619,
38
- "inference_config": "fold2/inference_source.yml",
39
- "inference_config_sha256": "c54470c27c7b30f48501ac1e88d37a9b986ade773a78e8a62ecb62500836ab4c",
40
- "source_run": "IMPACTSeg_fold2_3D128_B1_sgd_poly_resume_2M_20261007_18-09-15",
41
- "selected_iteration": 2000000,
42
- "training_limit": 2000000,
43
- "checkpoint_selection": "BEST validation loss (single checkpoint kept by KonfAI)",
44
- "split": {
45
- "split_dir": "Code_v2/splits/fold2",
46
- "counts": {
47
- "train": 1875,
48
- "validation": 300,
49
- "test": 168
50
- },
51
- "sha256": {
52
- "train": "251d4ae8aefa112c164d09ad2df5a104f4e8383fd87624b6801144710238b607",
53
- "validation": "ed950a466c22767fe2fc4bd88a38506004361c668ca9d2b4911c87ec4222ec92",
54
- "test": "28babdbf364e8225269a60532a35ff948028678a6e674ab28cbdbd9f03ec9b0a",
55
- "fit": "ec04bf0e44d63ff10632852199047bc636f63e9a9c997c58a5456fa026e7c168"
56
- },
57
- "test_file": "Code_v2/splits/fold2/test.txt"
58
- },
59
- "container_sha256": "fbcc225e0f1e43ad4f9ea344020c060596ff30c4fa58ae61b4de8f1fbdfb5514"
60
- },
61
- "3": {
62
- "checkpoint": "fold3/fold3.pt",
63
- "sha256": "746021d6e2d9b6ec6030f68e0cd4a9d1d4f73826b14c67f0be0089b27ea5739d",
64
- "bytes": 1217332619,
65
- "inference_config": "fold3/inference_source.yml",
66
- "inference_config_sha256": "c54470c27c7b30f48501ac1e88d37a9b986ade773a78e8a62ecb62500836ab4c",
67
- "source_run": "IMPACTSeg_fold3_3D128_B1_sgd_poly_2M_20261010_12-26-14",
68
- "selected_iteration": 2000000,
69
- "training_limit": 2000000,
70
- "checkpoint_selection": "BEST validation loss (single checkpoint kept by KonfAI)",
71
- "split": {
72
- "split_dir": "Code_v2/splits/fold3",
73
- "counts": {
74
- "train": 1875,
75
- "validation": 300,
76
- "test": 168
77
- },
78
- "sha256": {
79
- "train": "fbfb8c38f007b7020937d4439862ecf6a51ce8e0d54e6b66bcc877df11f481f0",
80
- "validation": "505f56a3ce96108852702da60b0bd14dc3506cbec6372ee378b472bac7a3ae28",
81
- "test": "1115ce4dcc4393880655d126adba4d920f29e97680a97bfc1506840a46181c75",
82
- "fit": "62416e83d16a7e63555f308f17ab02319bb26d7fcb0633244ff52fc322a64fc0"
83
- },
84
- "test_file": "Code_v2/splits/fold3/test.txt"
85
- },
86
- "container_sha256": "fbcc225e0f1e43ad4f9ea344020c060596ff30c4fa58ae61b4de8f1fbdfb5514"
87
- },
88
- "4": {
89
- "checkpoint": "fold4/fold4.pt",
90
- "sha256": "7464d47fcd4fd94e7cfce9d42a301380a56bdd698844bf5a0d2467339b44f51a",
91
- "bytes": 1217332619,
92
- "inference_config": "fold4/inference_source.yml",
93
- "inference_config_sha256": "c54470c27c7b30f48501ac1e88d37a9b986ade773a78e8a62ecb62500836ab4c",
94
- "source_run": "IMPACTSeg_fold4_3D128_B1_sgd_poly_2M_20261010_12-26-14",
95
- "selected_iteration": 2000000,
96
- "training_limit": 2000000,
97
- "checkpoint_selection": "BEST validation loss (single checkpoint kept by KonfAI)",
98
- "split": {
99
- "split_dir": "Code_v2/splits/fold4",
100
- "counts": {
101
- "train": 1875,
102
- "validation": 300,
103
- "test": 168
104
- },
105
- "sha256": {
106
- "train": "38c887848ac4271d9f138dc35576611340972202dffede6702997d623a2c8de6",
107
- "validation": "d5ec4d93dc8380d4e2026075a980cdaf80459cc862e90c7ab4866d0001143093",
108
- "test": "172cd2835a0c084d9f438afbd329b95837744428648dd4ac67c1c969d9e76948",
109
- "fit": "a72b9246332f3798fb76a70eda18db0198ea32f94cd78869bf9102da255061da"
110
- },
111
- "test_file": "Code_v2/splits/fold4/test.txt"
112
- },
113
- "container_sha256": "fbcc225e0f1e43ad4f9ea344020c060596ff30c4fa58ae61b4de8f1fbdfb5514"
114
- },
115
- "5": {
116
- "checkpoint": "fold5/fold5.pt",
117
- "sha256": "b2f1cef094f5b5243bc4ea38a66c78659a92a8000c916354544720f31c4bfaaf",
118
- "bytes": 1217332619,
119
- "inference_config": "fold5/inference_source.yml",
120
- "inference_config_sha256": "c54470c27c7b30f48501ac1e88d37a9b986ade773a78e8a62ecb62500836ab4c",
121
- "source_run": "IMPACTSeg_fold5_3D128_B1_sgd_poly_2M_20261010_12-30-02",
122
- "selected_iteration": 2000000,
123
- "training_limit": 2000000,
124
- "checkpoint_selection": "BEST validation loss (single checkpoint kept by KonfAI)",
125
- "split": {
126
- "split_dir": "Code_v2/splits/fold5",
127
- "counts": {
128
- "train": 1875,
129
- "validation": 300,
130
- "test": 168
131
- },
132
- "sha256": {
133
- "train": "447d04466f4be83fb61475daac3cefea9855aef434a8b7f9553d921d19a7901a",
134
- "validation": "e64cc5121b83e8e2c178eb8cb0dd52278c790553c5df34662715772a157f6849",
135
- "test": "80a0fac9f946feb68af3b9adba054e6c6c97fc20d4f77462647e6cd0efe89569",
136
- "fit": "6ff3fab18a33d01c57a556f9a60748a7b60aaf912dc7343bdd9c53fd98a76fcd"
137
- },
138
- "test_file": "Code_v2/splits/fold5/test.txt"
139
- },
140
- "container_sha256": "fbcc225e0f1e43ad4f9ea344020c060596ff30c4fa58ae61b4de8f1fbdfb5514"
141
- }
142
- },
143
- "available_folds": [
144
- 1,
145
- 2,
146
- 3,
147
- 4,
148
- 5
149
- ],
150
- "not_exported_folds": []
151
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/LICENSE DELETED
@@ -1,202 +0,0 @@
1
-
2
- Apache License
3
- Version 2.0, January 2004
4
- http://www.apache.org/licenses/
5
-
6
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
- 1. Definitions.
9
-
10
- "License" shall mean the terms and conditions for use, reproduction,
11
- and distribution as defined by Sections 1 through 9 of this document.
12
-
13
- "Licensor" shall mean the copyright owner or entity authorized by
14
- the copyright owner that is granting the License.
15
-
16
- "Legal Entity" shall mean the union of the acting entity and all
17
- other entities that control, are controlled by, or are under common
18
- control with that entity. For the purposes of this definition,
19
- "control" means (i) the power, direct or indirect, to cause the
20
- direction or management of such entity, whether by contract or
21
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
- outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
- "You" (or "Your") shall mean an individual or Legal Entity
25
- exercising permissions granted by this License.
26
-
27
- "Source" form shall mean the preferred form for making modifications,
28
- including but not limited to software source code, documentation
29
- source, and configuration files.
30
-
31
- "Object" form shall mean any form resulting from mechanical
32
- transformation or translation of a Source form, including but
33
- not limited to compiled object code, generated documentation,
34
- and conversions to other media types.
35
-
36
- "Work" shall mean the work of authorship, whether in Source or
37
- Object form, made available under the License, as indicated by a
38
- copyright notice that is included in or attached to the work
39
- (an example is provided in the Appendix below).
40
-
41
- "Derivative Works" shall mean any work, whether in Source or Object
42
- form, that is based on (or derived from) the Work and for which the
43
- editorial revisions, annotations, elaborations, or other modifications
44
- represent, as a whole, an original work of authorship. For the purposes
45
- of this License, Derivative Works shall not include works that remain
46
- separable from, or merely link (or bind by name) to the interfaces of,
47
- the Work and Derivative Works thereof.
48
-
49
- "Contribution" shall mean any work of authorship, including
50
- the original version of the Work and any modifications or additions
51
- to that Work or Derivative Works thereof, that is intentionally
52
- submitted to Licensor for inclusion in the Work by the copyright owner
53
- or by an individual or Legal Entity authorized to submit on behalf of
54
- the copyright owner. For the purposes of this definition, "submitted"
55
- means any form of electronic, verbal, or written communication sent
56
- to the Licensor or its representatives, including but not limited to
57
- communication on electronic mailing lists, source code control systems,
58
- and issue tracking systems that are managed by, or on behalf of, the
59
- Licensor for the purpose of discussing and improving the Work, but
60
- excluding communication that is conspicuously marked or otherwise
61
- designated in writing by the copyright owner as "Not a Contribution."
62
-
63
- "Contributor" shall mean Licensor and any individual or Legal Entity
64
- on behalf of whom a Contribution has been received by Licensor and
65
- subsequently incorporated within the Work.
66
-
67
- 2. Grant of Copyright License. Subject to the terms and conditions of
68
- this License, each Contributor hereby grants to You a perpetual,
69
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
- copyright license to reproduce, prepare Derivative Works of,
71
- publicly display, publicly perform, sublicense, and distribute the
72
- Work and such Derivative Works in Source or Object form.
73
-
74
- 3. Grant of Patent License. Subject to the terms and conditions of
75
- this License, each Contributor hereby grants to You a perpetual,
76
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
- (except as stated in this section) patent license to make, have made,
78
- use, offer to sell, sell, import, and otherwise transfer the Work,
79
- where such license applies only to those patent claims licensable
80
- by such Contributor that are necessarily infringed by their
81
- Contribution(s) alone or by combination of their Contribution(s)
82
- with the Work to which such Contribution(s) was submitted. If You
83
- institute patent litigation against any entity (including a
84
- cross-claim or counterclaim in a lawsuit) alleging that the Work
85
- or a Contribution incorporated within the Work constitutes direct
86
- or contributory patent infringement, then any patent licenses
87
- granted to You under this License for that Work shall terminate
88
- as of the date such litigation is filed.
89
-
90
- 4. Redistribution. You may reproduce and distribute copies of the
91
- Work or Derivative Works thereof in any medium, with or without
92
- modifications, and in Source or Object form, provided that You
93
- meet the following conditions:
94
-
95
- (a) You must give any other recipients of the Work or
96
- Derivative Works a copy of this License; and
97
-
98
- (b) You must cause any modified files to carry prominent notices
99
- stating that You changed the files; and
100
-
101
- (c) You must retain, in the Source form of any Derivative Works
102
- that You distribute, all copyright, patent, trademark, and
103
- attribution notices from the Source form of the Work,
104
- excluding those notices that do not pertain to any part of
105
- the Derivative Works; and
106
-
107
- (d) If the Work includes a "NOTICE" text file as part of its
108
- distribution, then any Derivative Works that You distribute must
109
- include a readable copy of the attribution notices contained
110
- within such NOTICE file, excluding those notices that do not
111
- pertain to any part of the Derivative Works, in at least one
112
- of the following places: within a NOTICE text file distributed
113
- as part of the Derivative Works; within the Source form or
114
- documentation, if provided along with the Derivative Works; or,
115
- within a display generated by the Derivative Works, if and
116
- wherever such third-party notices normally appear. The contents
117
- of the NOTICE file are for informational purposes only and
118
- do not modify the License. You may add Your own attribution
119
- notices within Derivative Works that You distribute, alongside
120
- or as an addendum to the NOTICE text from the Work, provided
121
- that such additional attribution notices cannot be construed
122
- as modifying the License.
123
-
124
- You may add Your own copyright statement to Your modifications and
125
- may provide additional or different license terms and conditions
126
- for use, reproduction, or distribution of Your modifications, or
127
- for any such Derivative Works as a whole, provided Your use,
128
- reproduction, and distribution of the Work otherwise complies with
129
- the conditions stated in this License.
130
-
131
- 5. Submission of Contributions. Unless You explicitly state otherwise,
132
- any Contribution intentionally submitted for inclusion in the Work
133
- by You to the Licensor shall be under the terms and conditions of
134
- this License, without any additional terms or conditions.
135
- Notwithstanding the above, nothing herein shall supersede or modify
136
- the terms of any separate license agreement you may have executed
137
- with Licensor regarding such Contributions.
138
-
139
- 6. Trademarks. This License does not grant permission to use the trade
140
- names, trademarks, service marks, or product names of the Licensor,
141
- except as required for reasonable and customary use in describing the
142
- origin of the Work and reproducing the content of the NOTICE file.
143
-
144
- 7. Disclaimer of Warranty. Unless required by applicable law or
145
- agreed to in writing, Licensor provides the Work (and each
146
- Contributor provides its Contributions) on an "AS IS" BASIS,
147
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
- implied, including, without limitation, any warranties or conditions
149
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
- PARTICULAR PURPOSE. You are solely responsible for determining the
151
- appropriateness of using or redistributing the Work and assume any
152
- risks associated with Your exercise of permissions under this License.
153
-
154
- 8. Limitation of Liability. In no event and under no legal theory,
155
- whether in tort (including negligence), contract, or otherwise,
156
- unless required by applicable law (such as deliberate and grossly
157
- negligent acts) or agreed to in writing, shall any Contributor be
158
- liable to You for damages, including any direct, indirect, special,
159
- incidental, or consequential damages of any character arising as a
160
- result of this License or out of the use or inability to use the
161
- Work (including but not limited to damages for loss of goodwill,
162
- work stoppage, computer failure or malfunction, or any and all
163
- other commercial damages or losses), even if such Contributor
164
- has been advised of the possibility of such damages.
165
-
166
- 9. Accepting Warranty or Additional Liability. While redistributing
167
- the Work or Derivative Works thereof, You may choose to offer,
168
- and charge a fee for, acceptance of support, warranty, indemnity,
169
- or other liability obligations and/or rights consistent with this
170
- License. However, in accepting such obligations, You may act only
171
- on Your own behalf and on Your sole responsibility, not on behalf
172
- of any other Contributor, and only if You agree to indemnify,
173
- defend, and hold each Contributor harmless for any liability
174
- incurred by, or claims asserted against, such Contributor by reason
175
- of your accepting any such warranty or additional liability.
176
-
177
- END OF TERMS AND CONDITIONS
178
-
179
- APPENDIX: How to apply the Apache License to your work.
180
-
181
- To apply the Apache License to your work, attach the following
182
- boilerplate notice, with the fields enclosed by brackets "[]"
183
- replaced with your own identifying information. (Don't include
184
- the brackets!) The text should be enclosed in the appropriate
185
- comment syntax for the file format. We also recommend that a
186
- file or class name and description of purpose be included on the
187
- same "printed page" as the copyright notice for easier
188
- identification within third-party archives.
189
-
190
- Copyright [yyyy] [name of copyright owner]
191
-
192
- Licensed under the Apache License, Version 2.0 (the "License");
193
- you may not use this file except in compliance with the License.
194
- You may obtain a copy of the License at
195
-
196
- http://www.apache.org/licenses/LICENSE-2.0
197
-
198
- Unless required by applicable law or agreed to in writing, software
199
- distributed under the License is distributed on an "AS IS" BASIS,
200
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- See the License for the specific language governing permissions and
202
- limitations under the License.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/NOTICE DELETED
@@ -1,13 +0,0 @@
1
- IMPACTSeg / IMPACT-Seg
2
- Copyright 2026 IMPACTSeg contributors.
3
- Project code is distributed under the Apache License, Version 2.0.
4
-
5
- Scientific attribution (draft manuscript): Cédric Hémon, Valentin Boussot,
6
- Christopher Kurz and Guillaume Landry.
7
-
8
- IMPACTSeg uses KonfAI (https://github.com/fideus-labs/KonfAI), PyTorch,
9
- nnU-Net-style residual encoder architectures, SimpleITK and other separately
10
- licensed dependencies. Dependency copyrights and licenses remain their own.
11
-
12
- This NOTICE is informational and does not replace the original dataset terms
13
- or authorize redistribution of third-party data or model binaries.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/coarse/Prediction.yml DELETED
@@ -1,129 +0,0 @@
1
- Predictor:
2
- train_name: IMPACTSeg_coarse
3
- manual_seed: 42
4
- autocast: true
5
- channels_last: false
6
- gpu_checkpoints: None
7
- combine: Mean
8
- data_log: None
9
- check_training_transforms: false
10
- Model:
11
- classpath: impactseg_v2.models:ImpactSegResidualEncoderUNet
12
- ImpactSegResidualEncoderUNet:
13
- dim: 3
14
- in_channels: 1
15
- num_classes: 12
16
- n_stages: 5
17
- features_per_stage:
18
- - 16
19
- - 32
20
- - 64
21
- - 128
22
- - 192
23
- strides:
24
- - 1
25
- - 2
26
- - 2
27
- - 2
28
- - 2
29
- kernel_sizes: 3
30
- n_blocks_per_stage:
31
- - 1
32
- - 1
33
- - 2
34
- - 2
35
- - 2
36
- n_conv_per_stage_decoder:
37
- - 1
38
- - 1
39
- - 1
40
- - 1
41
- conv_bias: true
42
- negative_slope: 0.01
43
- norm_mode: INSTANCE_AFFINE
44
- deep_supervision_outputs: 3
45
- ModelPatch: None
46
- nb_batch_per_step: 1
47
- outputs_criterions: None
48
- emit_confidence: false
49
- confidence_threshold: None
50
- allow_head_resize: false
51
- pretrained_from: None
52
- Dataset:
53
- dataset_filenames:
54
- - ./Dataset:a:nii.gz
55
- groups_src:
56
- image:
57
- groups_dest:
58
- image:
59
- is_input: true
60
- transforms:
61
- impactseg_v2.release:LoadWholeVolume: {}
62
- Canonical:
63
- inverse: true
64
- Standardize:
65
- lazy: false
66
- mean: None
67
- std: None
68
- mask: None
69
- inverse: false
70
- TensorCast:
71
- dtype: float32
72
- inverse: false
73
- Resample:
74
- spacing:
75
- - 3.0
76
- - 3.0
77
- - 3.0
78
- align: extent
79
- inverse: true
80
- shape: None
81
- reference: None
82
- reference_group: None
83
- reference_dataset: None
84
- transforms: None
85
- field: None
86
- field_group: None
87
- interpolation: None
88
- fill: 0.0
89
- precision: exact
90
- patch_transforms: None
91
- augmentations: None
92
- subset: None
93
- batch_size: 1
94
- memory_budget: 16 GiB
95
- num_workers: 2
96
- pin_memory: true
97
- prefetch_factor: 2
98
- persistent_workers: true
99
- Patch:
100
- patch_size:
101
- - 128
102
- - 128
103
- - 128
104
- # Training grid: patches spread inside the volume, never padded (the coarse network
105
- # was never trained on padded edge patches and can hallucinate tissue on them).
106
- overlap: None
107
- pad_value: -2
108
- extend_slice: 0
109
- outputs_dataset:
110
- Softmax_3:
111
- OutputDataset:
112
- name_class:
113
- impactseg_v2.inference:ProbabilityConfidenceSelectOutputDataset
114
- same_as_group: image:image
115
- dataset_filename: Segmentations:nii.gz
116
- group: mask_coarse
117
- before_reduction_transforms: None
118
- after_reduction_transforms:
119
- TensorCast:
120
- dtype: uint8
121
- inverse: false
122
- final_transforms:
123
- TensorCast:
124
- dtype: uint8
125
- inverse: false
126
- patch_combine: None
127
- reduction: Mean
128
- attributes: None
129
- Mean: {}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/coarse/coarse.pt DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:6352259e4553e8773f5b77b0f234851d7eacd9a1a1287df95c398db2fc8d3de0
3
- size 57209907
 
 
 
 
models/coarse/model_manifest.json DELETED
@@ -1,78 +0,0 @@
1
- {
2
- "schema": "impactseg-model-release/v1",
3
- "network": "coarse 3D",
4
- "convention_id": "impactseg_ct_formalism_v3",
5
- "checkpoint_format": "Full KonfAI training checkpoint",
6
- "label_map": "coarse_map (labels.json), 11 classes + background",
7
- "checkpoint": "coarse.pt",
8
- "sha256": "6352259e4553e8773f5b77b0f234851d7eacd9a1a1287df95c398db2fc8d3de0",
9
- "bytes": 57209907,
10
- "inference_config": "Prediction.yml",
11
- "inference_config_sha256": "bfe3d26da383a18eaef2c7b7772ca74875666b5a6ad124411ef4da2887c9e1f1",
12
- "source_run": "IMPACTSeg_coarse_scratch_sgd_2M_20261019_18-49-51",
13
- "selected_iteration": 1275000,
14
- "training_limit": 2000000,
15
- "checkpoint_selection": "lowest validation loss (BEST); compared with the last checkpoint on the test and validation partitions (overlap 0.5: Dice 0.807 vs 0.803 and 0.766 vs 0.755)",
16
- "architecture": {
17
- "n_stages": 5,
18
- "features_per_stage": [
19
- 16,
20
- 32,
21
- 64,
22
- 128,
23
- 192
24
- ],
25
- "n_blocks_per_stage": [
26
- 1,
27
- 1,
28
- 2,
29
- 2,
30
- 2
31
- ],
32
- "norm": "InstanceNorm (affine)",
33
- "patch": [
34
- 128,
35
- 128,
36
- 128
37
- ]
38
- },
39
- "preprocessing": {
40
- "orientation": "RAS",
41
- "standardize": "z-score over the whole raw volume",
42
- "dtype": "float32",
43
- "spacing_xyz_mm": [
44
- 3.0,
45
- 3.0,
46
- 3.0
47
- ],
48
- "align": "extent",
49
- "native_output": "nearest-neighbour resampling to original image geometry"
50
- },
51
- "split": {
52
- "split_dir": "Code_v2/splits/coarse_final_ct1000_cbct1000_allmri_fine_bodymr_zcaps",
53
- "counts": {
54
- "train": 2661,
55
- "validation": 100,
56
- "test": 64
57
- },
58
- "sha256": {
59
- "train": "1dcba0d03e48e81cdca0a56ea76e9709747b3ac749410a7877eb9d11ed2236b8",
60
- "validation": "458a6d0fc0ddac7891fbea3eba123da94871d52531dc642732a5dd7c24e2b16f",
61
- "test": "e50d34f1fb18bab5bf1f42fb909c0e3e2926ea9672d3c5a815de0893a9370aa9"
62
- }
63
- },
64
- "evaluation": {
65
- "test_cases": 64,
66
- "validation_cases": 100,
67
- "inference_grid": "overlap None",
68
- "dice_case_macro": {
69
- "test_all": 0.855,
70
- "test_CT": 0.888,
71
- "test_CBCT": 0.859,
72
- "test_MRI": 0.812,
73
- "validation_MRI": 0.768
74
- },
75
- "note": "References are partly audited pseudo-labels; some whole-body MRI references (BigMAC) are incomplete."
76
- },
77
- "inference_grid": "overlap None: the training grid (patches spread inside the volume, no padded edge patch)"
78
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/impactseg_v2/__init__.py DELETED
@@ -1,5 +0,0 @@
1
- """IMPACTSeg v2 extensions for the public KonfAI API."""
2
-
3
- from .labels import FINE_LABELS, MAP_559_LABELS
4
-
5
- __all__ = ["FINE_LABELS", "MAP_559_LABELS"]
 
 
 
 
 
 
models/impactseg_v2/inference.py DELETED
@@ -1,185 +0,0 @@
1
- """Inference-only extensions for IMPACTSeg.
2
-
3
- KonfAI's legacy ``overlap: None`` grid keeps every border patch full-sized by
4
- spreading the remainder over the grid. In KonfAI 1.8, however, ``None`` also
5
- disables the output combine stage, so overlapping label patches are assembled
6
- with last-write-wins semantics. ``ConfidenceSelectOutputDataset`` instead
7
- retains, at each overlapping voxel, the label predicted with the highest
8
- softmax confidence. Historical trim experiments are archived separately.
9
- """
10
-
11
- from __future__ import annotations
12
-
13
- from typing import Any
14
-
15
- import torch
16
-
17
- from konfai.data.patching import Accumulator
18
- from konfai.predictor import OutputDataset
19
-
20
- from .labels import FINE_NETWORK_OUTPUTS, NOT_PREDICTED_FINE_IDS
21
-
22
-
23
- def __getattr__(name: str) -> Any:
24
- """Replay old run-local YAMLs without keeping trim in the production code."""
25
- if name == "AdaptiveAutoTrimOutputDataset":
26
- import warnings
27
- from legacy.experimental.inference import AdaptiveAutoTrimOutputDataset
28
- warnings.warn(
29
- "AdaptiveAutoTrimOutputDataset is archived; use "
30
- "legacy.experimental.inference:AdaptiveAutoTrimOutputDataset for historical replays.",
31
- DeprecationWarning, stacklevel=2,
32
- )
33
- return AdaptiveAutoTrimOutputDataset
34
- raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
35
-
36
-
37
- class _ConfidenceSelectAccumulator(Accumulator):
38
- """Keep, in overlap regions, the label from the most confident patch."""
39
-
40
- def _blend(
41
- self,
42
- layer: torch.Tensor,
43
- patch_slice: tuple[slice, ...],
44
- row_offset: int = 0,
45
- ) -> None:
46
- n = self._n
47
- data = layer
48
- for dim, item in enumerate(patch_slice):
49
- if item.stop - item.start == 1:
50
- data = data.unsqueeze(dim=dim + n)
51
-
52
- dest = [slice(item.start, min(item.stop, self.shape[dim])) for dim, item in enumerate(patch_slice)]
53
- data = data[tuple([slice(None)] * n + [slice(0, item.stop - item.start) for item in dest])]
54
- slices_dest = tuple([slice(None)] * n + dest)
55
- if self._result is None:
56
- self._result = torch.zeros(
57
- [2, *self.shape],
58
- dtype=data.dtype,
59
- device=data.device,
60
- )
61
- result = self._result
62
- current = result[slices_dest]
63
- labels = data[0:1]
64
- scores = data[1:2]
65
- current_labels = current[0:1]
66
- current_scores = current[1:2]
67
- torch.where(scores >= current_scores, labels, current_labels, out=current_labels)
68
- torch.maximum(current_scores, scores, out=current_scores)
69
-
70
- def assemble(self) -> torch.Tensor:
71
- if self._result is None:
72
- return super().assemble()
73
- labels = self._result[0:1]
74
- self._reset()
75
- return labels
76
-
77
-
78
- class _ProbabilityConfidenceSelectAccumulator(_ConfidenceSelectAccumulator):
79
- """Convert an ensemble mean-probability patch before overlap selection."""
80
-
81
- def _blend(
82
- self,
83
- layer: torch.Tensor,
84
- patch_slice: tuple[slice, ...],
85
- row_offset: int = 0,
86
- ) -> None:
87
- confidence, labels = torch.max(layer, dim=0, keepdim=True)
88
- packed = torch.cat(
89
- (
90
- labels.to(torch.uint8),
91
- torch.round(confidence * 255.0).to(torch.uint8),
92
- ),
93
- dim=0,
94
- )
95
- super()._blend(packed, patch_slice, row_offset=row_offset)
96
-
97
-
98
- class ConfidenceSelectOutputDataset(OutputDataset):
99
- """Assemble packed label/confidence patches by maximum confidence."""
100
-
101
- accumulator_type: type[Accumulator] = _ConfidenceSelectAccumulator
102
-
103
- def set_patch_config(
104
- self,
105
- patch_size: list[int] | None,
106
- overlap: int | float | str | list[int | float | str] | None,
107
- nb_data_augmentation: int,
108
- ) -> None:
109
- super().set_patch_config(patch_size, overlap, nb_data_augmentation)
110
- self._streaming_enabled = False
111
-
112
- def _ensure_case_state(
113
- self,
114
- index_dataset: int,
115
- index_augmentation: int,
116
- layer: torch.Tensor,
117
- dataset: Any,
118
- attribute: Any,
119
- number_of_channels_per_model: list[int] | None,
120
- ) -> None:
121
- existed = (
122
- index_dataset in self.output_layer_accumulator
123
- and index_augmentation in self.output_layer_accumulator[index_dataset]
124
- )
125
- super()._ensure_case_state(
126
- index_dataset,
127
- index_augmentation,
128
- layer,
129
- dataset,
130
- attribute,
131
- number_of_channels_per_model,
132
- )
133
- if existed:
134
- return
135
- input_dataset = dataset.get_dataset_from_index(self.group_dest, index_dataset)
136
- patch_slices = input_dataset.patch.get_patch_slices(index_augmentation)
137
- self.output_layer_accumulator[index_dataset][index_augmentation] = self.accumulator_type(
138
- patch_slices,
139
- input_dataset.patch.patch_size,
140
- None,
141
- batch=False,
142
- sweep_axis=input_dataset.patch.get_sweep_axis(index_augmentation),
143
- )
144
-
145
-
146
- class ProbabilityConfidenceSelectOutputDataset(ConfidenceSelectOutputDataset):
147
- """Pack mean probabilities on-device, then resolve overlaps by confidence.
148
-
149
- ``ModelComposite`` has already averaged the models when ``add_layer`` is
150
- called. Packing here, while the patch is still on the GPU, avoids moving
151
- every class-probability channel to the host merely to compute an argmax.
152
- """
153
-
154
- accumulator_type = _ConfidenceSelectAccumulator
155
-
156
- def add_layer(
157
- self,
158
- index_dataset: int,
159
- index_augmentation: int,
160
- index_patch: int,
161
- layer: torch.Tensor,
162
- dataset: Any,
163
- attribute: Any = None,
164
- number_of_channels_per_model: list[int] | None = None,
165
- ) -> Any:
166
- if layer.shape[0] == FINE_NETWORK_OUTPUTS: # fine map: classes not provided by the released models
167
- layer = layer.clone()
168
- layer[list(NOT_PREDICTED_FINE_IDS)] = 0
169
- confidence, labels = torch.max(layer, dim=0, keepdim=True)
170
- packed = torch.cat(
171
- (
172
- labels.to(torch.uint8),
173
- torch.round(confidence * 255.0).to(torch.uint8),
174
- ),
175
- dim=0,
176
- )
177
- return super().add_layer(
178
- index_dataset,
179
- index_augmentation,
180
- index_patch,
181
- packed,
182
- dataset,
183
- attribute,
184
- number_of_channels_per_model,
185
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/impactseg_v2/labels.py DELETED
@@ -1,84 +0,0 @@
1
- """The sole authoritative IMPACTSeg v2 label convention.
2
-
3
- This module is intentionally data-only: all v2 validation, model configuration,
4
- and documentation derive class counts and names from these mappings. It adopts
5
- the CT formalism introduced by ``task_2maps_labels_new.json`` and makes the
6
- historically omitted ``mask_559`` brain label explicit.
7
- """
8
-
9
- from __future__ import annotations
10
-
11
- from collections.abc import Iterable
12
-
13
-
14
- CONVENTION_ID = "impactseg_ct_formalism_v3"
15
- FINE_LABELS: dict[int, str] = {
16
- 0: "background", 1: "spleen", 2: "kidney_right", 3: "kidney_left", 4: "gallbladder",
17
- 5: "liver", 6: "stomach", 7: "aorta", 8: "inferior_vena_cava", 9: "portal_and_splenic_veins",
18
- 10: "pancreas", 11: "adrenal_gland_right", 12: "adrenal_gland_left", 13: "left_lung_upper_lobe",
19
- 14: "left_lung_lower_lobe", 15: "right_lung_upper_lobe", 16: "right_lung_middle_lobe",
20
- 17: "right_lung_lower_lobe", 18: "vertebrae_l5", 19: "vertebrae_l4", 20: "vertebrae_l3",
21
- 21: "vertebrae_l2", 22: "vertebrae_l1", 23: "vertebrae_t12", 24: "vertebrae_t11",
22
- 25: "vertebrae_t10", 26: "vertebrae_t9", 27: "vertebrae_t8", 28: "vertebrae_t7",
23
- 29: "vertebrae_t6", 30: "vertebrae_t5", 31: "vertebrae_t4", 32: "vertebrae_t3",
24
- 33: "vertebrae_t2", 34: "vertebrae_t1", 35: "vertebrae_c7", 36: "vertebrae_c6",
25
- 37: "vertebrae_c5", 38: "vertebrae_c4", 39: "vertebrae_c3", 40: "vertebrae_c2",
26
- 41: "vertebrae_c1", 42: "esophagus", 43: "trachea", 44: "myocardium",
27
- 45: "heart_atrium_left", 46: "heart_ventricle_left", 47: "heart_atrium_right",
28
- 48: "heart_ventricle_right", 49: "pulmonary_artery", 50: "common_iliac_artery_left",
29
- 51: "common_iliac_artery_right", 52: "common_iliac_vein_left", 53: "common_iliac_vein_right",
30
- 54: "small_intestine", 55: "duodenum", 56: "colon", 57: "urinary_bladder",
31
- 58: "humerus_left", 59: "humerus_right", 60: "scapula_left", 61: "scapula_right",
32
- 62: "clavicle_left", 63: "clavicle_right", 64: "femur_left", 65: "femur_right",
33
- 66: "hip_left", 67: "hip_right", 68: "sacrum", 69: "gluteus_maximus_left",
34
- 70: "gluteus_maximus_right", 71: "gluteus_medius_left", 72: "gluteus_medius_right",
35
- 73: "gluteus_minimus_left", 74: "gluteus_minimus_right", 75: "deep_back_muscle_left",
36
- 76: "deep_back_muscle_right", 77: "iliopsoas_left", 78: "iliopsoas_right",
37
- 79: "rib_1_left", 80: "rib_2_left", 81: "rib_3_left", 82: "rib_4_left", 83: "rib_5_left",
38
- 84: "rib_6_left", 85: "rib_7_left", 86: "rib_8_left", 87: "rib_9_left", 88: "rib_10_left",
39
- 89: "rib_11_left", 90: "rib_12_left", 91: "rib_1_right", 92: "rib_2_right",
40
- 93: "rib_3_right", 94: "rib_4_right", 95: "rib_5_right", 96: "rib_6_right",
41
- 97: "rib_7_right", 98: "rib_8_right", 99: "rib_9_right", 100: "rib_10_right",
42
- 101: "rib_11_right", 102: "rib_12_right", 103: "spinal_canal", 104: "prostate",
43
- 105: "seminal_vesicle", 106: "sternum", 107: "rectus_abdominis_right",
44
- 108: "rectus_abdominis_left", 109: "carotid_artery_left", 110: "carotid_artery_right",
45
- 111: "mandible", 112: "brainstem", 113: "buccal_mucosa", 114: "oral_cavity",
46
- 115: "cochlea_left", 116: "cochlea_right", 117: "eyeball_anterior_segment_left",
47
- 118: "eyeball_anterior_segment_right", 119: "eyeball_posterior_segment_left",
48
- 120: "eyeball_posterior_segment_right", 121: "submandibular_gland_left",
49
- 122: "submandibular_gland_right", 123: "thyroid", 124: "glottis", 125: "supraglottis",
50
- 126: "lips", 127: "optic_chiasm", 128: "optic_nerve_left", 129: "optic_nerve_right",
51
- 130: "parotid_gland_left", 131: "parotid_gland_right",
52
- }
53
-
54
- MAP_559_LABELS: dict[int, str] = {
55
- 0: "background", 1: "subcutaneous_tissue", 2: "muscle", 3: "abdominal_cavity",
56
- 4: "thoracic_cavity", 5: "bones", 6: "gland_structure", 7: "pericardium",
57
- 8: "prosthetic_breast_implant", 9: "mediastinum", 10: "spinal_cord", 11: "brain",
58
- }
59
-
60
-
61
- def foreground_count(label_map: dict[int, str]) -> int:
62
- """Return the number of foreground classes, validating contiguous IDs."""
63
- expected = set(range(max(label_map) + 1))
64
- if set(label_map) != expected or label_map.get(0) != "background":
65
- raise ValueError("IMPACTSeg label maps must be contiguous and include background=0.")
66
- return max(label_map)
67
-
68
-
69
- def invalid_labels(values: Iterable[int], label_map: dict[int, str]) -> set[int]:
70
- """Return IDs that are outside the map; used by data-validation scripts."""
71
- valid = set(label_map)
72
- return {int(value) for value in values if int(value) not in valid}
73
-
74
-
75
- FINE_FOREGROUND_COUNT = foreground_count(FINE_LABELS)
76
- FINE_NETWORK_OUTPUTS = FINE_FOREGROUND_COUNT + 1
77
- MAP_559_FOREGROUND_COUNT = foreground_count(MAP_559_LABELS)
78
- MAP_559_NETWORK_OUTPUTS = MAP_559_FOREGROUND_COUNT + 1
79
-
80
- # Structures of mask_fine that the released fine networks never output: a few tens of voxels at the training
81
- # resolution, they were not learned (softmax ~0.001 inside the reference). The inference outputs suppress them and the
82
- # evaluation excludes them, so the models provide FINE_FOREGROUND_COUNT - 5 = 126 structures (IDs unchanged).
83
- NOT_PREDICTED_FINE_LABELS = ("cochlea_left", "cochlea_right", "optic_chiasm", "optic_nerve_left", "optic_nerve_right")
84
- NOT_PREDICTED_FINE_IDS = tuple(i for i, name in FINE_LABELS.items() if name in NOT_PREDICTED_FINE_LABELS)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/impactseg_v2/models.py DELETED
@@ -1,252 +0,0 @@
1
- """KonfAI 1.8 model preserving the original ResEncMCT topology.
2
-
3
- KonfAI 1.8 already ships a weight-exact nnU-Net ResidualEncoderUNet. This
4
- variant exposes the named logits/probability supervision heads used by the
5
- IMPACTSeg criteria, preserves historical BatchNorm for the 2.5D experiments,
6
- and supports configurable normalization for 3D experiments. The topology,
7
- strides and convolution order remain the nnU-Net ResEnc implementation.
8
- """
9
-
10
- from __future__ import annotations
11
-
12
- from typing import Any
13
-
14
- import torch
15
- from konfai.data.patching import ModelPatch
16
- from konfai.network import blocks, network
17
- from konfai.utils.config import config
18
-
19
- from .labels import FINE_NETWORK_OUTPUTS, NOT_PREDICTED_FINE_IDS
20
-
21
-
22
- def _validate_topology(name: str, dim: int, n_stages: int, features: list[int], strides: list[int | list[int]]) -> None:
23
- """Local validation: avoid importing KonfAI's private nnU-Net helper module."""
24
- if dim not in (2, 3):
25
- raise ValueError(f"{name} supports dim 2 or 3, got {dim}.")
26
- if n_stages < 2 or len(features) != n_stages or len(strides) != n_stages:
27
- raise ValueError("Topology needs >=2 stages and one feature width/stride per stage.")
28
-
29
-
30
- def _as_stage_list(value: int | list[int], length: int, name: str) -> list[int]:
31
- values = [value] * length if isinstance(value, int) else list(value)
32
- if len(values) != length or any(item < 1 for item in values):
33
- raise ValueError(f"{name} must have {length} positive entries, got {values}.")
34
- return values
35
-
36
-
37
- def _as_kernel_list(kernel_sizes: int | list[Any], n_stages: int) -> list[Any]:
38
- if isinstance(kernel_sizes, int):
39
- return [kernel_sizes] * n_stages
40
- if len(kernel_sizes) != n_stages:
41
- raise ValueError(f"kernel_sizes must have {n_stages} entries, got {kernel_sizes}.")
42
- return list(kernel_sizes)
43
-
44
-
45
- def _padding(kernel_size: int | list[int]) -> int | list[int]:
46
- if isinstance(kernel_size, int):
47
- return (kernel_size - 1) // 2
48
- return [(int(value) - 1) // 2 for value in kernel_size]
49
-
50
-
51
- def _decoder_block_config(
52
- stride: int | list[int], kernel_size: int | list[int], conv_bias: bool, negative_slope: float, norm_mode: str
53
- ) -> blocks.BlockConfig:
54
- return blocks.BlockConfig(
55
- kernel_size=kernel_size,
56
- stride=stride,
57
- padding=_padding(kernel_size),
58
- bias=conv_bias,
59
- activation=f"LeakyReLU;{negative_slope}",
60
- norm_mode=norm_mode,
61
- )
62
-
63
-
64
- class _ConfidenceArgmax(torch.nn.Module):
65
- """Argmax that rejects low-confidence foreground voxels as background."""
66
-
67
- def __init__(self, threshold: float) -> None:
68
- super().__init__()
69
- self.threshold = float(threshold)
70
-
71
- def forward(self, probabilities: torch.Tensor) -> torch.Tensor:
72
- confidence, labels = torch.max(probabilities, dim=1, keepdim=True)
73
- return labels.masked_fill((labels != 0) & (confidence < self.threshold), 0)
74
-
75
-
76
- class _ArgmaxConfidence(torch.nn.Module):
77
- """Pack argmax labels and 8-bit confidence into two channels."""
78
-
79
- def forward(self, probabilities: torch.Tensor) -> torch.Tensor:
80
- if probabilities.shape[1] == FINE_NETWORK_OUTPUTS: # fine map: classes not provided by the released models
81
- probabilities = probabilities.clone()
82
- probabilities[:, list(NOT_PREDICTED_FINE_IDS)] = 0
83
- confidence, labels = torch.max(probabilities, dim=1, keepdim=True)
84
- labels = labels.to(torch.uint8)
85
- confidence_u8 = torch.round(confidence * 255.0).to(torch.uint8)
86
- return torch.cat((labels, confidence_u8), dim=1)
87
-
88
-
89
- @config()
90
- class ImpactSegResidualEncoderUNet(network.Network):
91
- """2D/2.5D or 3D residual U-Net with named logits/probability DS heads."""
92
-
93
- def __init__(
94
- self,
95
- optimizer: network.OptimizerLoader = network.OptimizerLoader(),
96
- schedulers: dict[str, network.LRSchedulersLoader] = {
97
- "default|PolynomialLR": network.LRSchedulersLoader(0)
98
- },
99
- outputs_criterions: dict[str, network.TargetCriterionsLoader] = {
100
- "default": network.TargetCriterionsLoader()
101
- },
102
- patch: ModelPatch | None = None,
103
- nb_batch_per_step: int = 1,
104
- dim: int = 2,
105
- in_channels: int = 5,
106
- n_stages: int = 6,
107
- features_per_stage: list[int] = [32, 64, 128, 256, 320, 512],
108
- strides: list[int | list[int]] = [1, 2, 2, 2, 2, 2],
109
- kernel_sizes: int | list[Any] = 3,
110
- n_blocks_per_stage: int | list[int] = [1, 3, 4, 6, 6, 6],
111
- n_conv_per_stage_decoder: int | list[int] = [1, 1, 1, 1, 1],
112
- num_classes: int = 132,
113
- conv_bias: bool = True,
114
- negative_slope: float = 1e-2,
115
- norm_mode: str = "BATCH",
116
- deep_supervision_outputs: int = 3,
117
- confidence_threshold: float | None = None,
118
- emit_confidence: bool = False,
119
- ) -> None:
120
- _validate_topology("ImpactSegResidualEncoderUNet", dim, n_stages, features_per_stage, strides)
121
- if norm_mode not in blocks.NormMode.__members__:
122
- raise ValueError(f"Unknown KonfAI norm_mode={norm_mode!r}")
123
- if not 1 <= deep_supervision_outputs <= n_stages - 1:
124
- raise ValueError("deep_supervision_outputs must be in [1, n_stages - 1]")
125
- if confidence_threshold is not None and not 0.0 <= confidence_threshold <= 1.0:
126
- raise ValueError("confidence_threshold must be in [0, 1]")
127
- if confidence_threshold is not None and emit_confidence:
128
- raise ValueError("confidence_threshold and emit_confidence are mutually exclusive")
129
-
130
- kernel_list = _as_kernel_list(kernel_sizes, n_stages)
131
- encoder_blocks = _as_stage_list(n_blocks_per_stage, n_stages, "n_blocks_per_stage")
132
- decoder_blocks = _as_stage_list(n_conv_per_stage_decoder, n_stages - 1, "n_conv_per_stage_decoder")
133
- super().__init__(
134
- in_channels=in_channels,
135
- optimizer=optimizer,
136
- schedulers=schedulers,
137
- outputs_criterions=outputs_criterions,
138
- patch=patch,
139
- nb_batch_per_step=nb_batch_per_step,
140
- dim=dim,
141
- )
142
-
143
- self.add_module(
144
- "Stem",
145
- blocks.ConvBlock(
146
- in_channels=in_channels,
147
- out_channels=features_per_stage[0],
148
- block_configs=[
149
- _decoder_block_config(1, kernel_list[0], conv_bias, negative_slope, norm_mode)
150
- ],
151
- dim=dim,
152
- ),
153
- in_branch=[0],
154
- out_branch=["stem"],
155
- )
156
- for stage in range(n_stages):
157
- stage_input = features_per_stage[0] if stage == 0 else features_per_stage[stage - 1]
158
- for block in range(encoder_blocks[stage]):
159
- source = "stem" if stage == 0 and block == 0 else f"enc{stage - 1}" if block == 0 else f"enc{stage}"
160
- self.add_module(
161
- f"Encoder_{stage}_Block_{block}",
162
- blocks.ResidualBlockD(
163
- in_channels=stage_input if block == 0 else features_per_stage[stage],
164
- out_channels=features_per_stage[stage],
165
- dim=dim,
166
- kernel_size=kernel_list[stage],
167
- stride=strides[stage] if block == 0 else 1,
168
- conv_bias=conv_bias,
169
- negative_slope=negative_slope,
170
- norm_mode=norm_mode,
171
- ),
172
- in_branch=[source],
173
- out_branch=[f"enc{stage}"],
174
- )
175
-
176
- # Coarsest-to-finest decoder. The last N heads are the historical
177
- # final + auxiliary deep-supervision outputs, exposed both as logits
178
- # and softmax probabilities for the CE and Dice criteria respectively.
179
- for decoder_stage in range(n_stages - 1):
180
- below = n_stages - 1 - decoder_stage
181
- skip = n_stages - 2 - decoder_stage
182
- upsample_stride: Any = strides[below]
183
- self.add_module(
184
- f"Up_{decoder_stage}",
185
- blocks.get_torch_module("ConvTranspose", dim)(
186
- in_channels=features_per_stage[below],
187
- out_channels=features_per_stage[skip],
188
- kernel_size=upsample_stride,
189
- stride=upsample_stride,
190
- padding=0,
191
- bias=conv_bias,
192
- ),
193
- in_branch=[f"enc{n_stages - 1}" if decoder_stage == 0 else f"dec{decoder_stage - 1}"],
194
- out_branch=[f"up{decoder_stage}"],
195
- )
196
- self.add_module(
197
- f"Skip_{decoder_stage}",
198
- blocks.Concat(),
199
- in_branch=[f"up{decoder_stage}", f"enc{skip}"],
200
- out_branch=[f"up{decoder_stage}"],
201
- )
202
- self.add_module(
203
- f"Decoder_{decoder_stage}",
204
- blocks.ConvBlock(
205
- in_channels=2 * features_per_stage[skip],
206
- out_channels=features_per_stage[skip],
207
- block_configs=[
208
- _decoder_block_config(1, kernel_list[skip], conv_bias, negative_slope, norm_mode)
209
- for _ in range(decoder_blocks[decoder_stage])
210
- ],
211
- dim=dim,
212
- ),
213
- in_branch=[f"up{decoder_stage}"],
214
- out_branch=[f"dec{decoder_stage}"],
215
- )
216
- if decoder_stage >= (n_stages - 1 - deep_supervision_outputs):
217
- self.add_module(
218
- f"Logits_{decoder_stage}",
219
- blocks.get_torch_module("Conv", dim)(
220
- features_per_stage[skip], num_classes, kernel_size=1, stride=1, padding=0, bias=True
221
- ),
222
- in_branch=[f"dec{decoder_stage}"],
223
- out_branch=[f"logits{decoder_stage}", -1],
224
- )
225
- self.add_module(
226
- f"Softmax_{decoder_stage}",
227
- torch.nn.Softmax(dim=1),
228
- in_branch=[f"logits{decoder_stage}"],
229
- out_branch=[f"probabilities{decoder_stage}", -1],
230
- )
231
-
232
- final_stage = n_stages - 2
233
- self.add_module(
234
- "Argmax",
235
- blocks.ArgMax(dim=1),
236
- in_branch=[f"logits{final_stage}"],
237
- out_branch=[-1],
238
- )
239
- if confidence_threshold is not None:
240
- self.add_module(
241
- "ConfidenceArgmax",
242
- _ConfidenceArgmax(confidence_threshold),
243
- in_branch=[f"probabilities{final_stage}"],
244
- out_branch=[-1],
245
- )
246
- elif emit_confidence:
247
- self.add_module(
248
- "ArgmaxConfidence",
249
- _ArgmaxConfidence(),
250
- in_branch=[f"probabilities{final_stage}"],
251
- out_branch=[-1],
252
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/impactseg_v2/release.py DELETED
@@ -1,18 +0,0 @@
1
- """Helpers for running the released IMPACT-Seg models with a plain ``konfai PREDICTION``."""
2
-
3
- from __future__ import annotations
4
-
5
- import torch
6
- from konfai.data.transform import Transform
7
- from konfai.utils.dataset import Attribute
8
-
9
-
10
- class LoadWholeVolume(Transform):
11
- """Identity stage that keeps KonfAI's default WHOLE_VOLUME patch locality.
12
-
13
- It makes KonfAI load each case whole instead of streaming disk regions, which the 2.5D
14
- slice-context patches (``extend_slice``) need, and matches how the released results were produced.
15
- """
16
-
17
- def __call__(self, name: str, tensor: torch.Tensor, cache_attribute: Attribute) -> torch.Tensor:
18
- return tensor
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/labels.json DELETED
@@ -1,172 +0,0 @@
1
- {
2
- "schema": "impactseg-labels/v1",
3
- "convention_id": "impactseg_ct_formalism_v3",
4
- "authoritative_source": "impactseg_v2/labels.py",
5
- "source_sha256": "a5f6e4e3cc461375ba61a92efee9db7054681b2882659660d4f18afa566a1cf6",
6
- "fine_map": {
7
- "foreground_classes": 131,
8
- "network_outputs_including_background": 132,
9
- "labels": {
10
- "0": "background",
11
- "1": "spleen",
12
- "2": "kidney_right",
13
- "3": "kidney_left",
14
- "4": "gallbladder",
15
- "5": "liver",
16
- "6": "stomach",
17
- "7": "aorta",
18
- "8": "inferior_vena_cava",
19
- "9": "portal_and_splenic_veins",
20
- "10": "pancreas",
21
- "11": "adrenal_gland_right",
22
- "12": "adrenal_gland_left",
23
- "13": "left_lung_upper_lobe",
24
- "14": "left_lung_lower_lobe",
25
- "15": "right_lung_upper_lobe",
26
- "16": "right_lung_middle_lobe",
27
- "17": "right_lung_lower_lobe",
28
- "18": "vertebrae_l5",
29
- "19": "vertebrae_l4",
30
- "20": "vertebrae_l3",
31
- "21": "vertebrae_l2",
32
- "22": "vertebrae_l1",
33
- "23": "vertebrae_t12",
34
- "24": "vertebrae_t11",
35
- "25": "vertebrae_t10",
36
- "26": "vertebrae_t9",
37
- "27": "vertebrae_t8",
38
- "28": "vertebrae_t7",
39
- "29": "vertebrae_t6",
40
- "30": "vertebrae_t5",
41
- "31": "vertebrae_t4",
42
- "32": "vertebrae_t3",
43
- "33": "vertebrae_t2",
44
- "34": "vertebrae_t1",
45
- "35": "vertebrae_c7",
46
- "36": "vertebrae_c6",
47
- "37": "vertebrae_c5",
48
- "38": "vertebrae_c4",
49
- "39": "vertebrae_c3",
50
- "40": "vertebrae_c2",
51
- "41": "vertebrae_c1",
52
- "42": "esophagus",
53
- "43": "trachea",
54
- "44": "myocardium",
55
- "45": "heart_atrium_left",
56
- "46": "heart_ventricle_left",
57
- "47": "heart_atrium_right",
58
- "48": "heart_ventricle_right",
59
- "49": "pulmonary_artery",
60
- "50": "common_iliac_artery_left",
61
- "51": "common_iliac_artery_right",
62
- "52": "common_iliac_vein_left",
63
- "53": "common_iliac_vein_right",
64
- "54": "small_intestine",
65
- "55": "duodenum",
66
- "56": "colon",
67
- "57": "urinary_bladder",
68
- "58": "humerus_left",
69
- "59": "humerus_right",
70
- "60": "scapula_left",
71
- "61": "scapula_right",
72
- "62": "clavicle_left",
73
- "63": "clavicle_right",
74
- "64": "femur_left",
75
- "65": "femur_right",
76
- "66": "hip_left",
77
- "67": "hip_right",
78
- "68": "sacrum",
79
- "69": "gluteus_maximus_left",
80
- "70": "gluteus_maximus_right",
81
- "71": "gluteus_medius_left",
82
- "72": "gluteus_medius_right",
83
- "73": "gluteus_minimus_left",
84
- "74": "gluteus_minimus_right",
85
- "75": "deep_back_muscle_left",
86
- "76": "deep_back_muscle_right",
87
- "77": "iliopsoas_left",
88
- "78": "iliopsoas_right",
89
- "79": "rib_1_left",
90
- "80": "rib_2_left",
91
- "81": "rib_3_left",
92
- "82": "rib_4_left",
93
- "83": "rib_5_left",
94
- "84": "rib_6_left",
95
- "85": "rib_7_left",
96
- "86": "rib_8_left",
97
- "87": "rib_9_left",
98
- "88": "rib_10_left",
99
- "89": "rib_11_left",
100
- "90": "rib_12_left",
101
- "91": "rib_1_right",
102
- "92": "rib_2_right",
103
- "93": "rib_3_right",
104
- "94": "rib_4_right",
105
- "95": "rib_5_right",
106
- "96": "rib_6_right",
107
- "97": "rib_7_right",
108
- "98": "rib_8_right",
109
- "99": "rib_9_right",
110
- "100": "rib_10_right",
111
- "101": "rib_11_right",
112
- "102": "rib_12_right",
113
- "103": "spinal_canal",
114
- "104": "prostate",
115
- "105": "seminal_vesicle",
116
- "106": "sternum",
117
- "107": "rectus_abdominis_right",
118
- "108": "rectus_abdominis_left",
119
- "109": "carotid_artery_left",
120
- "110": "carotid_artery_right",
121
- "111": "mandible",
122
- "112": "brainstem",
123
- "113": "buccal_mucosa",
124
- "114": "oral_cavity",
125
- "115": "cochlea_left",
126
- "116": "cochlea_right",
127
- "117": "eyeball_anterior_segment_left",
128
- "118": "eyeball_anterior_segment_right",
129
- "119": "eyeball_posterior_segment_left",
130
- "120": "eyeball_posterior_segment_right",
131
- "121": "submandibular_gland_left",
132
- "122": "submandibular_gland_right",
133
- "123": "thyroid",
134
- "124": "glottis",
135
- "125": "supraglottis",
136
- "126": "lips",
137
- "127": "optic_chiasm",
138
- "128": "optic_nerve_left",
139
- "129": "optic_nerve_right",
140
- "130": "parotid_gland_left",
141
- "131": "parotid_gland_right"
142
- },
143
- "not_output_by_the_models": {
144
- "115": "cochlea_left",
145
- "116": "cochlea_right",
146
- "127": "optic_chiasm",
147
- "128": "optic_nerve_left",
148
- "129": "optic_nerve_right"
149
- },
150
- "structures_output_by_the_models": 126
151
- },
152
- "coarse_map": {
153
- "foreground_classes": 11,
154
- "network_outputs_including_background": 12,
155
- "hub_filename": "mask_coarse.nii.gz",
156
- "labels": {
157
- "0": "background",
158
- "1": "subcutaneous_tissue",
159
- "2": "muscle",
160
- "3": "abdominal_cavity",
161
- "4": "thoracic_cavity",
162
- "5": "bones",
163
- "6": "gland_structure",
164
- "7": "pericardium",
165
- "8": "prosthetic_breast_implant",
166
- "9": "mediastinum",
167
- "10": "spinal_cord",
168
- "11": "brain"
169
- }
170
- },
171
- "note": "These maps define IDs, not guaranteed per-case presence or annotation quality."
172
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/preprocessing.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "orientation": "RAS",
3
- "order": [
4
- "Canonical",
5
- "Standardize",
6
- "TensorCast",
7
- "Resample"
8
- ],
9
- "standardize": {
10
- "mean": null,
11
- "std": null,
12
- "mask": null,
13
- "scope": "whole raw volume"
14
- },
15
- "dtype": "float32",
16
- "spacing_xyz_mm": [
17
- 1.5,
18
- 1.5,
19
- 2.0
20
- ],
21
- "align": "extent",
22
- "native_output": "nearest-neighbour resampling to original image geometry",
23
- "inference_reconstruction": "confidence_select",
24
- "default_overlap": 0.5
25
- }