Skip to content

Commit 791b0e0

Browse files
committed
use mixup for segmentation
1 parent cb31dce commit 791b0e0

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

segmentation/prostate/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ In this example, we use 3D U-Net with deep supervision to segment the prostate f
1616
pymic_run train config/unet3d.cfg
1717
```
1818

19-
Note that we set `deep_supervise = True` and `loss_type = [DiceLoss, CrossEntropyLoss]` in the configure file.
19+
Note that we set `deep_supervise = True` and `loss_type = [DiceLoss, CrossEntropyLoss]` in the configure file. We also use Mixup for data
20+
augmentation by setting `mixup_probability=0.5`.
2021

2122
2. During training or after training, run `tensorboard --logdir model/unet3d` and you will see a link in the output, such as `http://your-computer:6006`. Open the link in the browser and you can observe the average Dice score and loss during the training stage, such as shown in the following images, where blue and red curves are for training set and validation set respectively.
2223

@@ -36,5 +37,5 @@ pymic_run test config/unet3d.cfg
3637
pymic_eval_seg config/evaluation.cfg
3738
```
3839

39-
The obtained average Dice score by default setting should be close to 87.45%. You can set `metric = assd` in `config/evaluation.cfg` and run the evaluation command again. You will get Average Symmetric Surface Distance (ASSD) evaluation results. You can try your efforts to improve the performance with different networks or training strategies by changing the configuration file `config/unet3d.cfg`.
40+
The obtained average Dice score by default setting should be close to 87.92%. You can set `metric = assd` in `config/evaluation.cfg` and run the evaluation command again. You will get Average Symmetric Surface Distance (ASSD) evaluation results. You can try your efforts to improve the performance with different networks or training strategies by changing the configuration file `config/unet3d.cfg`.
4041

segmentation/prostate/config/unet3d.cfg

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ deep_supervise= True
5757
# list of gpus
5858
gpus = [0]
5959

60+
mixup_probability = 0.5
6061
loss_type = [DiceLoss, CrossEntropyLoss]
6162
loss_weight = [1.0, 1.0]
6263

@@ -69,15 +70,15 @@ weight_decay = 1e-5
6970
# for lr schedular (MultiStepLR)
7071
lr_scheduler = MultiStepLR
7172
lr_gamma = 0.5
72-
lr_milestones = [3000, 6000]
73+
lr_milestones = [3000, 6000, 9000]
7374

7475
ckpt_save_dir = model/unet3d
7576

7677
# start iter
7778
iter_start = 0
78-
iter_max = 9000
79+
iter_max = 12000
7980
iter_valid = 200
80-
iter_save = 9000
81+
iter_save = 12000
8182

8283
[testing]
8384
# list of gpus

0 commit comments

Comments
 (0)