Sample scripts for training nnU-Net on mouse fetus data
This is an experiment to use nnU-Net for segmenting mouse embryo scans for comparison to MEMOS.
Model was trained on the mouse_fetus
data from here: http://bit.ly/monai
Install nnU-Net version 2 as described on their web site. I used miniconda on a Ubuntu machine.
Creation of the model used the following helper scripts running in 3D Slicer version 5.4.0. The Python code was just pasted into the python console. The training shell script was run in bash. Paths need to be adjusted based on where you keep the data.
mouse-prep.py : converts the naming convention for compatibility with nnU-Net requirements.
mouse-remap.py : ensures that the labelmaps indices are sequentially numbered, which is a requirement for nnU-Net.
mouse-json.py : builds the required json file to describe the segmentation process.
mouse-train.sh : used for planning and training. First run bash mouse-train.sh plan
which takes several minutes, then bash mouse-train.sh train
which will take several days to train 5 folds of the model depending on your CPU and GPU configuration (tested on a 16 core A100 GPU with 20GB and training time is about 1.5 days per fold).
mouse-review.py : creates a simple interface to load and review data from fold 0 in 3D Slicer.
In 2D the ground truth is outline and the fill is the model.
For the 3D view the ground truth is on the left and the model results are on the right.