Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
linyebin123 b0128b7bed | 1 year ago | |
---|---|---|
.. | ||
brats | 1 year ago | |
doc | 1 year ago | |
test | 1 year ago | |
unet3dlegacy | 1 year ago | |
README.md | 1 year ago | |
requirements.txt | 1 year ago |
I am leaving this code to make it easier for people using the old code.
Eventually, the only way to access this code will be through the "legacy" branch.
The code was written to be trained using the
BRATS 2020 data set for brain tumors, but it can
be easily modified to be used in other 3D applications.
brats/data
folder.cd
into the 3DUnetCNN repository.
Add the repository directory to the PYTONPATH
system variable:
$ export PYTHONPATH=${PWD}:$PYTHONPATH
cd
into the brats
folder.
Run the training:
$ python train.py
$ python predict.py
The predicted segmentations will be in the "BraTS2020_Validation_predictions".
If you run out of memory during training: try setting
config['patch_shape`] = (64, 64, 64)
for starters.
Also, read the "Configuration" notes at the bottom of this page.
In the training above, part of the data was held out for validation purposes.
To write the predicted label maps to file:
$ python predict.py
The predictions will be written in the prediction
folder along with the input data and ground truth labels for
comparison.
Changing the configuration dictionary in the train.py scripts, makes it easy to test out different model and
training configurations.
I would recommend trying it out then modifying the parameters until you have satisfactory
results.
If you are running out of memory, try training using (64, 64, 64)
shaped patches.
Reducing the "batch_size" and "validation_batch_size" parameters will also reduce the amount of memory required for
training as smaller batch sizes feed smaller chunks of data to the CNN.
If the batch size is reduced down to 1 and it still you are still running
out of memory, you could also try changing the patch size to (32, 32, 32)
.
Keep in mind, though, that a smaller patch sizes may not perform as well as larger patch sizes.
If you want to train a 3D UNet on a different set of data, you can copy either the train.py script and modify it to
read in your data rather than the preprocessed BRATS data that they are currently setup to train on.
The following Keras model were trained on the BRATS 2020 data:
Dice Enhancing Tumor | Dice Whole Tumor | Dice Tumor Core |
---|---|---|
0.65446 | 0.86171 | 0.75757 |
用于医学图像分割的Pytorch 3D U-Net卷积神经网络(CNN)
Python
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》