-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathfiber_linghu26.yaml
More file actions
205 lines (201 loc) · 4.4 KB
/
fiber_linghu26.yaml
File metadata and controls
205 lines (201 loc) · 4.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
_base_:
- ../connectomics/config/all_profiles.yaml
experiment_name: fiber_mednext_bcs
description: Fiber segmentation with MedNeXt and multi-task learning (Binary + Contour + SDT)
default:
system:
num_gpus: -1
num_workers: -1
seed: 42
model:
arch:
profile: mednext_s
out_channels: 3
input_size:
- 32
- 128
- 128
output_size:
- 32
- 128
- 128
loss:
deep_supervision: false
losses:
- function: WeightedBCEWithLogitsLoss
weight: 1.0
kwargs: {reduction: mean}
pred_slice: "0:1"
target_slice: "0:1"
- function: DiceLoss
weight: 0.5
kwargs: {sigmoid: true, smooth_nr: 1e-5, smooth_dr: 1e-5}
pred_slice: "0:1"
target_slice: "0:1"
- function: WeightedBCEWithLogitsLoss
weight: 1.0
kwargs: {reduction: mean}
pred_slice: "1:2"
target_slice: "1:2"
- function: DiceLoss
weight: 0.5
kwargs: {sigmoid: true, smooth_nr: 1e-5, smooth_dr: 1e-5}
pred_slice: "1:2"
target_slice: "1:2"
- function: WeightedMSELoss
weight: 4.0
kwargs: {tanh: true}
pred_slice: "2:3"
target_slice: "2:3"
mednext:
size: S
kernel_size: 3
data:
dataloader:
use_preloaded_cache_train: true
persistent_workers: true
patch_size: [32, 128, 128]
nnunet_preprocessing:
enabled: true
crop_to_nonzero: true
normalization: zscore
normalization_use_nonzero_mask: true
clip_percentile_low: 0.005
clip_percentile_high: 0.995
label_transform:
targets:
- name: binary
kwargs: {}
- name: instance_boundary
kwargs:
thickness: 1
edge_mode: all
mode: 2d
- name: skeleton_aware_edt
kwargs:
resolution:
- 40
- 16
- 16
alpha: 1
bg_value: -1.0
relabel: true
augmentation:
flip:
enabled: true
rotate:
enabled: true
spatial_axes:
- 1
- 2
intensity:
enabled: true
gaussian_noise_prob: 0
gaussian_noise_std: 0.5
shift_intensity_prob: 0.5
shift_intensity_offset: 0.1
contrast_prob: 0.5
contrast_range: [0.9, 1.1]
inference:
system:
num_workers: 1
sliding_window:
window_size:
- 32
- 128
- 128
overlap: 0.5
blending: gaussian
sigma_scale: 0.25
padding_mode: reflect
test_time_augmentation:
enabled: true
channel_activations:
- {channels: "0:2", activation: sigmoid}
- {channels: "2:3", activation: tanh}
decoding:
steps:
- name: decode_binary_contour_distance_watershed
kwargs:
binary_threshold:
- 0.9
- 0.85
contour_threshold:
- 0.8
- 1.1
distance_threshold:
- 0.5
- -0.5
min_instance_size: 100
min_seed_size: 20
prediction_scale: 1
train:
optimization:
max_epochs: 500
n_steps_per_epoch: 1000
gradient_clip_val: 0.5
accumulate_grad_batches: 1
precision: "16-mixed"
log_every_n_steps: 100
optimizer:
lr: 0.0003
weight_decay: 0.01
eps: 1.0e-08
scheduler:
name: WarmupCosineLR
warmup_epochs: 3
warmup_start_lr: 1.0e-05
min_lr: 1.0e-06
ema:
enabled: true
decay: 0.999
validate_with_ema: true
monitor:
nan_detection:
enabled: true
debug_on_nan: false
logging:
scalar:
loss:
- train_loss_total_epoch
loss_every_n_steps: 10
images:
max_images: 2
num_slices: 4
log_every_n_epochs: 5
checkpoint:
save_top_k: 3
save_every_n_epochs: 5
early_stopping:
monitor: train_loss_total_epoch
patience: 100
min_delta: 1.0e-05
threshold: 0.01
divergence_threshold: 100.0
data:
train:
path: /projects/weilab/dataset/barcode/2026/PT37_round2/
image:
- "*raw.tif"
label:
- "*mask.tif"
resolution:
- 40
- 16
- 16
test:
data:
test:
path: /projects/weilab/dataset/barcode/2026/PT37_round2/
image:
- "*raw.tif"
label:
- "*mask.tif"
resolution:
- 40
- 16
- 16
evaluation:
enabled: true
metrics:
- adapted_rand