Skip to content

Commit d57e6be

Browse files
committed
update default params
1 parent 58f8daa commit d57e6be

File tree

3 files changed

+10
-48
lines changed

3 files changed

+10
-48
lines changed

segmentation/JSRT/config/train_test.cfg

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ test_csv = config/jsrt_test.csv
1010

1111
train_batch_size = 4
1212

13-
load_pixelwise_weight = False
1413
# modality number
1514
modal_num = 1
1615

@@ -20,24 +19,13 @@ valid_transform = [NormalizeWithMeanStd, LabelConvert, LabelToProbability]
2019
test_transform = [NormalizeWithMeanStd]
2120

2221
NormalizeWithMeanStd_channels = [0]
23-
NormalizeWithMeanStd_mean = None
24-
NormalizeWithMeanStd_std = None
25-
NormalizeWithMeanStd_mask = False
26-
NormalizeWithMeanStd_random_fill = False
27-
NormalizeWithMeanStd_inverse = False
2822

2923
LabelConvert_source_list = [0, 255]
3024
LabelConvert_target_list = [0, 1]
31-
LabelConvert_inverse = False
3225

3326
RandomCrop_output_size = [240, 240]
34-
RandomCrop_foreground_focus = False
35-
RandomCrop_foreground_ratio = None
36-
RandomCrop_mask_label = None
37-
RandomCrop_inverse = False
3827

3928
LabelToProbability_class_num = 2
40-
LabelToProbability_inverse = False
4129

4230
[network]
4331
# this section gives parameters for network
@@ -59,8 +47,6 @@ bilinear = False
5947
gpus = [0]
6048

6149
loss_type = DiceLoss
62-
DiceLoss_enable_pixel_weight = False
63-
DiceLoss_enable_class_weight = False
6450

6551
# for optimizers
6652
optimizer = Adam
@@ -88,12 +74,6 @@ gpus = [0]
8874
# checkpoint mode can be [0-latest, 1-best, 2-specified]
8975
ckpt_mode = 0
9076
output_dir = result
91-
evaluation_mode = True
92-
test_time_dropout = False
93-
94-
# use test time augmentation
95-
tta_mode = 0
96-
infer_sliding_window = False
9777

9878
# convert the label of prediction output
9979
label_source = [0, 1]

segmentation/fetal_hc/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pymic_net_run train config/train_test.cfg
2626
![avg_loss](./picture/train_avg_loss.png)
2727

2828
## Testing and evaluation
29-
1. Run the following command to obtain segmentation results of testing images based on the best-performing checkpoint on the validation set. By default we use test time augmentation and sliding window inference to get better results. You can also edit the `testing` section of `config/train_test.cfg` to use other inference strategies.
29+
1. Run the following command to obtain segmentation results of testing images based on the best-performing checkpoint on the validation set. By default we use sliding window inference to get better results. You can also edit the `testing` section of `config/train_test.cfg` to use other inference strategies.
3030

3131
```bash
3232
mkdir result
@@ -39,6 +39,6 @@ pymic_net_run test config/train_test.cfg
3939
pymic_evaluate_seg config/evaluation.cfg
4040
```
4141

42-
The obtained average Dice score by default setting should be close to 97.12%. You can set `metric = assd` in `config/evaluation.cfg` and run the evaluation command again to get Average Symmetric Surface Distance (ASSD) evaluation results.
42+
The obtained average Dice score by default setting should be close to 97.10%. You can set `metric = assd` in `config/evaluation.cfg` and run the evaluation command again to get Average Symmetric Surface Distance (ASSD) evaluation results.
4343

44-
3. Set `tta_mode = 0` and `infer_sliding_window = False` in `config/train_test.cfg`, and run the testing and evaluation code again, we find that the average Dice will be decreased to around 96.86%.
44+
3. Set `tta_mode = 1` in `config/train_test.cfg` to enable test time augmentation, and run the testing and evaluation code again, we find that the average Dice will be increased to around 97.22%.

segmentation/fetal_hc/config/train_test.cfg

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,27 @@ test_csv = config/fetal_hc_test.csv
1010

1111
train_batch_size = 4
1212

13-
load_pixelwise_weight = False
1413
# modality number
1514
modal_num = 1
1615

1716
# data transforms
1817
train_transform = [Rescale, RandomCrop, RandomFlip, NormalizeWithMeanStd, LabelConvert, LabelToProbability]
19-
valid_transform = [Rescale, NormalizeWithMeanStd, LabelToProbability]
18+
valid_transform = [Rescale, NormalizeWithMeanStd, LabelConvert, LabelToProbability]
2019
test_transform = [Rescale, NormalizeWithMeanStd]
2120

22-
Rescale_output_size = [256, 384]
23-
Rescale_inverse = True
24-
21+
Rescale_output_size = [256, 384]
2522
RandomCrop_output_size = [224, 320]
26-
RandomCrop_foreground_focus = False
27-
RandomCrop_foreground_ratio = None
28-
RandomCrop_mask_label = None
29-
RandomCrop_inverse = False
3023

3124
RandomFlip_flip_depth = False
3225
RandomFlip_flip_height = True
3326
RandomFlip_flip_width = True
34-
RandomFlip_inverse = False
3527

3628
NormalizeWithMeanStd_channels = [0]
37-
NormalizeWithMeanStd_mean = None
38-
NormalizeWithMeanStd_std = None
39-
NormalizeWithMeanStd_mask = False
40-
NormalizeWithMeanStd_random_fill = False
41-
NormalizeWithMeanStd_inverse = False
4229

4330
LabelConvert_source_list = [0, 255]
4431
LabelConvert_target_list = [0, 1]
45-
LabelConvert_inverse = False
4632

4733
LabelToProbability_class_num = 2
48-
LabelToProbability_inverse = False
4934

5035
[network]
5136
# this section gives parameters for network
@@ -67,8 +52,6 @@ bilinear = True
6752
gpus = [0]
6853

6954
loss_type = DiceLoss
70-
DiceLoss_enable_pixel_weight = False
71-
DiceLoss_enable_class_weight = False
7255

7356
# for optimizers
7457
optimizer = Adam
@@ -94,14 +77,13 @@ iter_save = 5000
9477
gpus = [0]
9578

9679
# checkpoint mode can be [0-latest, 1-best, 2-specified]
97-
ckpt_mode = 1
98-
output_dir = result
99-
evaluation_mode = True
100-
test_time_dropout = False
80+
ckpt_mode = 1
81+
output_dir = result
10182

10283
# use test time augmentation
103-
tta_mode = 1
104-
infer_sliding_window = True
84+
tta_mode = 0
85+
86+
sliding_window_enable = True
10587
sliding_window_size = [224, 320]
10688
sliding_window_stride = [224, 320]
10789

0 commit comments

Comments
 (0)