-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathvesicle_xm.yaml
More file actions
143 lines (136 loc) · 4.05 KB
/
vesicle_xm.yaml
File metadata and controls
143 lines (136 loc) · 4.05 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
experiment_name: vesicle_xm_mednext_bcd
description: Vesicle segmentation with MedNeXt and multi-task learning (Binary + Contour + DT)
_base_:
- ../connectomics/config/all_profiles.yaml
default:
pipeline_profile: bcd
system:
profile: all-gpu-cpu
model:
arch:
profile: mednext_s
input_size: [32, 128, 128]
output_size: [32, 128, 128]
data:
dataloader:
profile: cached
batch_size: 4
patch_size: [32, 128, 128]
image_transform:
normalize: "0-1"
augmentation:
profile: aug_light
inference:
test_time_augmentation:
enabled: true
flip_axes: [1, 2]
rotation90_axes: [[1, 2]]
sliding_window:
window_size: [32, 128, 128]
save_prediction:
enabled: true
decoding:
steps:
- name: decode_instance_binary_contour_distance
kwargs:
binary_threshold: [0.76, 0.5]
contour_threshold: [0.6, 1]
distance_threshold: [0.7, -0.2]
min_instance_size: 100
min_seed_size: 20
postprocessing:
enabled: true
instance_cc3d:
connectivity: 6 # 6-connected (face only) for conservative splitting
min_size: 100 # remove components smaller than 100 voxels
evaluation:
enabled: true
metrics:
- adapted_rand
train:
data:
train:
image: ["datasets/bouton-lv/train/vol0_im_bouton.h5", "datasets/hydra-lv/vol*_im.h5"]
label: ["datasets/bouton-lv/train/vol0_lv_bouton.h5", "datasets/hydra-lv/vol*_vesicle_ins.h5"]
mask: ["datasets/bouton-lv/train/vol0_mask_bouton.h5", "datasets/hydra-lv/vol*_mask.h5"]
resolution: [30, 8, 8]
# make sure samples have enough foreground for masked sampling
dataloader:
cached_sampling_foreground_threshold: 0.05
cached_sampling_sample_nonzero_mask: true
optimization:
profile: warmup_cosine_lr
n_steps_per_epoch: 1000
max_epochs: 500
monitor:
logging:
scalar:
loss_every_n_steps: 50
images:
log_every_n_epochs: 10
max_images: 8
num_slices: 2
checkpoint:
save_top_k: 3
monitor: train_loss_total_epoch
test:
data:
test:
path: "/projects/weilab/dataset/xiaomeng/vesicle/"
# debugging
image: "im/Bouton_228_EM.tif"
mask: "mask/Bouton_228_em_mask.tif"
#image: "im/Bouton_*_EM.tif"
#mask: "mask/Bouton_*_em_mask.tif"
resolution: [30, 8, 8]
# fix: the exported mask is 2x downsampled, so we need to upsample it to the original size
mask_transform:
resize: [1, 2, 2]
align_to_image: true
binarize: true
# ============================================================================
# Parameter tuning for BCD watershed thresholds (--mode tune)
# ============================================================================
tune:
profile: tune_bcd
n_trials: 50
study_name: vesicle_xm_bcd_tuning
data:
val:
image: ["datasets/bouton-lv/train/vol0_im_bouton.h5", "datasets/hydra-lv/vol*_im.h5"]
label: ["datasets/bouton-lv/train/vol0_lv_bouton.h5", "datasets/hydra-lv/vol*_vesicle_ins.h5"]
mask: ["datasets/bouton-lv/train/vol0_mask_bouton.h5", "datasets/hydra-lv/vol*_mask.h5"]
# Override profile defaults for vesicle-specific search ranges
parameter_space:
decoding:
defaults:
binary_threshold: [0.9, 0.85]
contour_threshold: [0.8, 1]
distance_threshold: [0.5, -0.5]
min_instance_size: 30
min_seed_size: 5
parameters:
binary_threshold_seed:
range: [0.7, 0.99]
step: 0.01
binary_threshold_fg:
range: [0.5, 0.95]
step: 0.05
contour_threshold_low:
range: [0.3, 0.95]
step: 0.05
contour_threshold_high:
range: [0.8, 1]
step: 0.1
distance_threshold_seed:
range: [0.0, 1.0]
step: 0.1
distance_threshold_fg:
range: [-1.0, 0.5]
step: 0.1
min_instance_size:
range: [10, 200]
step: 10
min_seed_size:
range: [1, 30]
step: 1