# Advanced Examples of 3D Brain Tumor Segmentation and Experiment Manager
This repository uses code based on the product example for "3-D Brain Tumor Segmentation Using Deep Learning", see
https://www.mathworks.com/help/releases/R2021a/deeplearning/ug/segment-3d-brain-tumor-using-deep-learning.html?s_tid=doc_srchtitle. The 3-D Brain Segmentation uses the BRaTS dataset that is volumetric representations of the brain with 4 channels or modalities. The examples here were implemented based on my work with a University of Freiburg research team using a head&neck dataset with 7 modalities. See 1) Bielak, L., Wiedenmann, N., Berlin, A. et al. Convolutional neural networks for head and neck tumor segmentation on 7-channel multiparametric MRI: a leave-one-out analysis. Radiat Oncol 15, 181 (2020). https://doi.org/10.1186/s13014-020-01618-z
The paper was followed by a presentation I gave to the NVIDIA® GTC conference titled "Scale Your Deep Learning Research from Desk to Cloud with MATLAB: Implementing Multiple AI Experiments for Head and Neck Tumor Segmentation"
with emphasis on showing some advanced features implemented with the Experiment Manager. I am including in this repository the code I presented and a blog that goes into more detail of the work.
ParameterSweepingWithExpMgr: modified the Brain Segmentation code to demonstrate how the Experiment Manager App can be used to do a Leave-One-Out analysis, as well as, Bayesian Optimization for hyperparameter determination.
segment3DBrainTumorUsingExpMgr: incorporates a number of advanced features which were implemented with a custom training loop and parallel communication and constructs. The two major features are implementing a virtual minibatch size by aggregating losses over sub-iterations which emulate multi-gpu's and background tasks running in the background to facilitate validation and plotting. This code will also run independent of the experiment manager. See the presentation slides for more information on the included features.
## Setup
I recommend running the product based 3D Brain Example first from the link above. And change the conditions to allow for actual training so that you confirm that your computer configuration is correct for doing this. The full training will take a long time so you might want to make a plan to stop it early by either reducing the data size or number of epochs, etc. or hit the stop button. In doing this, it will download the BRaTS dataset and pre-process the dataset.
The example code in this repository will do the same thing if the dataset doesn't exist, but it is better to confirm with original example. Also when running from the experiment manager it does not allow the use of debugging code, so this is more easily done with the original. Also, it will be easier to seek help from technical support when first trying to get it correct using the product example.
Copy the repository to a folder.
The examples here are advanced, so I recommend becoming familiar with the basics of the experiment manager app by going throught the product documentation and examples.
ParameterSweepingWithExpMgr includes the experiment setups for Leave-One-Out (LOO) and Bayesian Optimization.
1. start experimentManager app, either from command line or Apps tab
2. open the experiment manager project ParameterSweepingWithExpMgr\ParameterSweepingWithExpMgr.prj
3. In the project there are experiments for either BayesOptimization or Leave-One-Out
4. If you have multiple gpu's you can
a) run the default parallel cluster or explicitly specify how many gpu's you want to use with parpool command
For example, parpool(4) to run 4 gpu's.
b) select <Use Parallel> button on the app ribbon.
5) select <Run> button on the app ribbon to begin experimentation
segment3DBrainTumorUsingExpMgr includes the setup for the corresponding experiment.
1. start experimentManager app, either from command line or Apps tab
2. open the experiment manager project segment3DBrainTumorUsingExpMgr\segment3DBrainTumorUsintExpMgr.prj
3. In the project there is a single experiment: Experiment1
4. The script internally uses multi-gpu's by default so you cannot select UseParallel.
5) select <Run> button on the app ribbon to begin experimentation
Note the first Hyperparameters, "trialParams", is an array of strings. This was done to directly associate two corresponding parameters that are converted to integers in the function. The first of the pair in each string represents the channel to be left out and the second is the trial number to associated with it for output reporting purposes. The remainder of hyperparameters are fixed. Also note that it can be run in single 'gpu' mode by changing the executionEnvironment parameter.
For either of experiment wrapper functions, they can be called directly to support debugging. Just call them with a params structure that matches the Hyperparameters list. For example:
params.initialLearnRate = 5e-3;
params.learnRate = .85e-3;
segment3DBrainTumor_LOOWrapper_single(params);
or
params.trialParams = "0 1";
params.maxEpochs = 3;
params.miniBatchSize = 4;
params.executionEnvironment = "multi-gpu"
params.miniBatchMultiplier = 4;
params.secondaryUI_HideRedundantInfo = 0;
segment3DBrainTumorUsingExpMgr(params,[]);
segment3DBrainTumorUsingExpMgr([],[]) will use default hyperparameters.
The custom training function does not facilitate debugging when in multi-gpu mode.
As noted previously, the experiment manager app doesn't allow debugging. However you can still run the function wrappers direcly
Additional information about set up
### MathWorks Products (https://www.mathworks.com)
Requires MATLAB release R#### or newer
- R2021a(https://www.mathworks.com/downloads/web_downloads/)
- Image Processing Toolbox(https://www.mathworks.com/products/image.html)
- Computer Vision Toolbox(https://www.mathworks.com/products/computer-vision.html)
- Parallel Computing Toolbox(https://www.mathworks.com/products/parallel-computing.html)
- Deep Learning Toolbox(https://www.mathworks.com/products/deep-learning.html)
## Installation
Installation instuctions
Before proceeding, ensure that the below products are installed:
* R2021a(https://www.mathworks.com/downloads/web_downloads/)
* Image Processing Toolbox(https://www.mathworks.com/products/image.html)
* Computer Vision Toolbox(https://www.mathworks.com/products/computer-vision.html)
* Parallel Computing Toolbox(https://www.mathworks.com/products/parallel-computing.html)
* Deep Learning Toolbox(https://www.mathworks.com/products/deep-learning.html)
## License
The license for https://github.com/mathworks/Advanced-Examples-Of-3D-Brain-Tumor-Segmentation-And-Exp-Mgr is available in the [LICENSE.TXT](LICENSE.TXT) file in this GitHub repository.
## Community Support
[MATLAB Central](https://www.mathworks.com/matlabcentral)
Copyright 2021 The MathWorks, Inc.
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Advanced-Examples-of-3D-Brain-Tumor-Segmentation-and-Experiment (115个子文件)
customTrainNetworkParallel3dBrain.m 41KB
randomBlockedImageLabelDatastore.m 23KB
displayTrainingProgress3dBrain.m 20KB
preprocessBraTSdataset.m 5KB
preprocessBraTSdataset.m 5KB
processValidation3dBrain.m 5KB
validateModel3dBrain.m 4KB
generateRandomBlockedImageLabelDatastore.m 3KB
augmentAndCrop3dPatch_LOO.m 1KB
predict3dBrain.m 1KB
augmentAndCrop3dPatch.m 1KB
downloadTrained3DUnetSampleData.m 1KB
downloadTrained3DUnetSampleData.m 1KB
backgroundProcesses3dBrain.m 911B
createCheckpointFile.m 312B
dl2Net.m 296B
matRead.m 96B
matRead.m 96B
train_tumorBlocks.mat 94KB
train_bkgdBlocks.mat 94KB
Experiment1.mat 1KB
Leave-One-Out.mat 1KB
BayesOptimization.mat 1KB
README.md 7KB
SECURITY.md 389B
segment3DBrainTumorUsingExpMgr.mlx 12KB
segment3DBrainTumor_LOOWrapper_single.mlx 10KB
meanDice.mlx 6KB
Experiment1_training1.mlx 5KB
Experiment1_setup2.mlx 4KB
Experiment1_setup1.mlx 4KB
Example of New Experiment Manager for Custom Training.pdf 1.25MB
SKO2021_Demo_Showcase_ExperimentManager_Demo_Pitch for pdf.pptx 4.28MB
Segment3DBrainTumorUsingExpMgr.prj 177B
ParameterSweepingWithExpMgr.prj 177B
logFile.txt 24KB
license.txt 1KB
HIH5PU~1.XML 141B
LPPBSC~1.XML 141B
lpPbsc2beP5azjswP1VTSq-rB1cd.xml 141B
Hih5PU4Yq7sc_w85I6GDnnxSy-4d.xml 141B
lEZWtMPgWbfCdXV8smoD5bAXSQYd.xml 141B
HP-Q4x9lnFFBia0uMubZywdd2Ygd.xml 141B
jnBYynwMCKQuypocafxU5FnFGLcd.xml 141B
_5e2sW4ic5pg3j98yjzsEvd2FwQd.xml 141B
QWzWi0-hgpZQZbkxeO1o3uL4Rgod.xml 141B
NjSPEMsIuLUyIpr2u1Js5bVPsOsd.xml 115B
NJSPEM~1.XML 115B
NjSPEMsIuLUyIpr2u1Js5bVPsOsd.xml 115B
T4aPynDObHB4oP-bMVsW1VFfdVQp.xml 112B
1iyUlvl7Cll4LIDy74INbGTHVIwp.xml 112B
GiiBklLgTxteCEmomM8RCvWT0nQd.xml 101B
LPPBSC~2.XML 96B
lpPbsc2beP5azjswP1VTSq-rB1cp.xml 96B
QWzWi0-hgpZQZbkxeO1o3uL4Rgop.xml 93B
lEZWtMPgWbfCdXV8smoD5bAXSQYp.xml 93B
NjSPEMsIuLUyIpr2u1Js5bVPsOsp.xml 92B
NJSPEM~2.XML 92B
HP-Q4x9lnFFBia0uMubZywdd2Ygp.xml 92B
NjSPEMsIuLUyIpr2u1Js5bVPsOsp.xml 92B
_5e2sW4ic5pg3j98yjzsEvd2FwQp.xml 88B
QWNDYJD5mGW1bWYvPx9DtKnxzw4d.xml 87B
QWNDYJD5mGW1bWYvPx9DtKnxzw4d.xml 87B
Hih5PU4Yq7sc_w85I6GDnnxSy-4p.xml 86B
HIH5PU~2.XML 86B
GiiBklLgTxteCEmomM8RCvWT0nQd.xml 85B
r8LR4nLmg9ai3oHrW1r_-KocQzkd.xml 84B
r8LR4nLmg9ai3oHrW1r_-KocQzkd.xml 84B
aEHSZBIY-yve10yGis12Zr5DLZod.xml 83B
QWNDYJD5mGW1bWYvPx9DtKnxzw4p.xml 83B
aEHSZBIY-yve10yGis12Zr5DLZod.xml 83B
QWNDYJD5mGW1bWYvPx9DtKnxzw4p.xml 83B
jnBYynwMCKQuypocafxU5FnFGLcp.xml 83B
EEtUlUb-dLAdf0KpMVivaUlztwAp.xml 82B
NmGqIpAwUJcXFyLjFAGnU9uyN5Yp.xml 82B
KAXfQgCar2Yb8zOxgvf9hdmLP1Ep.xml 82B
GiiBklLgTxteCEmomM8RCvWT0nQp.xml 82B
j4xwF_j8iFTVayUMfxLgMnTbencd.xml 82B
NmGqIpAwUJcXFyLjFAGnU9uyN5Yp.xml 82B
KAXfQgCar2Yb8zOxgvf9hdmLP1Ep.xml 82B
EEtUlUb-dLAdf0KpMVivaUlztwAp.xml 82B
GiiBklLgTxteCEmomM8RCvWT0nQp.xml 82B
j4xwF_j8iFTVayUMfxLgMnTbencd.xml 82B
fjRQtWiSIy7hIlj-Kmk87M7s21kp.xml 81B
6x1BhZX_fLnKpcwqra0qFwv1jIgp.xml 81B
KKyDJtbdIBOlaeHmIZd5VX6vqx8d.xml 81B
fjRQtWiSIy7hIlj-Kmk87M7s21kp.xml 81B
6x1BhZX_fLnKpcwqra0qFwv1jIgp.xml 81B
KKyDJtbdIBOlaeHmIZd5VX6vqx8d.xml 81B
r8LR4nLmg9ai3oHrW1r_-KocQzkp.xml 80B
R1RggVhA72agIvELiuhWPRS8F0Id.xml 80B
2kj09UetkV_lru3gvSPXnY6-nM4d.xml 80B
r8LR4nLmg9ai3oHrW1r_-KocQzkp.xml 80B
2kj09UetkV_lru3gvSPXnY6-nM4d.xml 80B
R1RggVhA72agIvELiuhWPRS8F0Id.xml 80B
aEHSZBIY-yve10yGis12Zr5DLZop.xml 79B
aEHSZBIY-yve10yGis12Zr5DLZop.xml 79B
j4xwF_j8iFTVayUMfxLgMnTbencp.xml 78B
j4xwF_j8iFTVayUMfxLgMnTbencp.xml 78B
KKyDJtbdIBOlaeHmIZd5VX6vqx8p.xml 77B
共 115 条
- 1
- 2
资源评论
DavidWangYang
- 粉丝: 2397
- 资源: 341
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 技术资料分享TJA1050很好的技术资料.zip
- 技术资料分享TF应用很好的技术资料.zip
- 技术资料分享TF卡资料很好的技术资料.zip
- 综合实验课程设计-基于WFP(Windows Filter Platform)的个人防火墙系统 +C++项目源码+文档说明
- deepinIDE支持在mips64el架构下UOS专业版1031及以上版本安装
- 免费通讯库 6.0.1.0版本
- 基于paddle的命名实体识别的代码,契合飞桨平台环境
- springboot农产品报价系统(附源码+数据库)37300
- 利用pyqt6开发的一款桌面程序app-美颜商店
- 北航操作系统实验课和理论课的平时作业 +项目源码+文档说明+实验指导书
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功