-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation of Probabilistic U-Net. #46
base: main
Are you sure you want to change the base?
Changes from all commits
b2033f1
4938d21
55a1c8c
7d25bb8
51faf40
528532f
a3d0722
bdb1bf6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
{ | ||
"command": "train", | ||
"gpu_ids": [0], | ||
"log_directory": "msc2021_softseg_unet3D_unbalanced", | ||
"gpu_ids": [2], | ||
"log_directory": "results/msc2021_softseg_unet3D_unbalanced", | ||
"model_name": "ms_brain", | ||
"debugging": true, | ||
"object_detection_params": { | ||
"object_detection_path": null | ||
}, | ||
"loader_parameters": { | ||
"bids_path": "duke/projects/ivadomed/tmp_ms_challenge_2021_preprocessed", | ||
"path_data": "duke/projects/ivadomed/tmp_ms_challenge_2021_preprocessed", | ||
"target_suffix": ["_seg-lesion"], | ||
"roi_params": { | ||
"suffix": null, | ||
|
@@ -32,30 +32,33 @@ | |
"fname_split": null, | ||
"random_seed": 42, | ||
"center_test": [], | ||
"balance": null, | ||
"balance": null, | ||
"method": "per_patient", | ||
"train_fraction": 0.6, | ||
"test_fraction": 0.2 | ||
}, | ||
"training_parameters": { | ||
"batch_size": 20, | ||
"batch_size": 16, | ||
"loss": { | ||
"name": "AdapWingLoss" | ||
}, | ||
"training_time": { | ||
"num_epochs": 200, | ||
"early_stopping_patience": 50, | ||
"early_stopping_patience": 75, | ||
"early_stopping_epsilon": 0.001 | ||
}, | ||
"scheduler": { | ||
"initial_lr": 5e-05, | ||
"initial_lr": 2e-04, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These might be old experiments and highly dependent on the specific hyperparameters (e.g. batch size) but in my experience with the challenge lowering the learning rate was very helpful. I have seen cases where lowering the learning rate from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I second this! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for this! I really didn't know that lowering the learning rate could make that much of a difference. I am struggling to get PU-Net working for this dataset, maybe this might help to some extent! :) |
||
"lr_scheduler": { | ||
"name": "CosineAnnealingLR", | ||
"base_lr": 1e-05, | ||
"base_lr": 5e-05, | ||
"max_lr": 0.01 | ||
} | ||
}, | ||
"balance_samples": {"applied": false, "type": "gt"}, | ||
"balance_samples": { | ||
"applied": false, | ||
"type": "gt" | ||
}, | ||
"mixup_alpha": null, | ||
"transfer_learning": { | ||
"retrain_model": null, | ||
|
@@ -64,56 +67,41 @@ | |
}, | ||
"Modified3DUNet": { | ||
"applied": true, | ||
"length_3D": [128, 128, 128], | ||
"stride_3D": [64, 64, 64], | ||
"length_3D": [64, 64, 64], | ||
"stride_3D": [32, 32, 32], | ||
"attention": true, | ||
"n_filters": 8 | ||
"n_filters": 16 | ||
}, | ||
"default_model": { | ||
"name": "Unet", | ||
"dropout_rate": 0.3, | ||
"dropout_rate": 0.2, | ||
"bn_momentum": 0.9, | ||
"depth": 4, | ||
"folder_name": "ms_brain", | ||
"in_channel": 2, | ||
"out_channel": 1, | ||
"final_activation": "relu" | ||
}, | ||
"postprocessing": {"binarize_prediction": {"thr": 0.5}}, | ||
"postprocessing": { | ||
"binarize_prediction": {"thr": 0.5} | ||
}, | ||
"transformation": { | ||
"CenterCrop": { | ||
"size": [ | ||
320, | ||
384, | ||
512 | ||
], | ||
"size": [ 320, 384, 512 ], | ||
"preprocessing": true | ||
}, | ||
"RandomAffine": { | ||
"degrees": 20, | ||
"scale": [ | ||
0.1, | ||
0.1, | ||
0.1 | ||
], | ||
"translate": [ | ||
0.1, | ||
0.1, | ||
0.1 | ||
], | ||
"applied_to": [ | ||
"im", | ||
"gt" | ||
], | ||
"dataset_type": [ | ||
"training" | ||
] | ||
"scale": [ 0.1, 0.1, 0.1 ], | ||
"translate": [ 0.1, 0.1, 0.1 ], | ||
"applied_to": [ "im", "gt" ], | ||
"dataset_type": [ "training" ] | ||
}, | ||
"NumpyToTensor": { | ||
"applied_to": ["im", "gt"] | ||
}, | ||
"NumpyToTensor": {}, | ||
"NormalizeInstance": { | ||
"applied_to": [ | ||
"im" | ||
] | ||
"applied_to": [ "im" ] | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
### Probabilistic U-Net for Longitudinal MS Lesion Segmentation | ||
This contains the first attempt of using PU-Net for segmenting MS Lesions. | ||
|
||
The current (tested) version supports single-GPU training. How to run: | ||
|
||
``` | ||
$ export CUDA_VISIBLE_DEVICES=<your-GPU-id-here> | ||
$ python training.py -fd 1.0 | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would actually be very interested to know how much difference this makes; we should definitely do an experiment on this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, definitely! From my experience, increasing the number of feature maps/filters helps in improving performance! Hence, I try to fit as many as possible into the memory.