First, we need to obtain and preprocess the data for the segmentation task
The data is provided by the medical segmentation decathlon challenge(http://medicaldecathlon.com/)
(Data License: CC-BY-SA 4.0, https://creativecommons.org/licenses/by-sa/4.0/)
We need to implement the following functionality:
then, we will create the model for the atrium segmentation!
We will use the most famous architecture for this task, the U-NET (https://arxiv.org/abs/1505.04597).
The idea behind a UNET is the Encoder-Decoder architecture with additional skip-connctions on different levels:
The encoder reduces the size of the feature maps by using downconvolutional layers.
The decoder reconstructs a mask of the input shape over several layers by upsampling.
Additionally skip-connections allow a direct information flow from the encoder to the decoder on all intermediate levels of the UNET.
This allows for a high quality of the produced mask and simplifies the training process.
We will implement full segmentaion model with pytorch-lightning.
Lung tumors are often very small, thus we need to make sure that our model does not learn a trivial solution which simply outputs 0 for all voxels.
We will use oversampling to sample slices which contain a tumor more often.
To do so we can use the WeightedRandomSampler provided by pytorch which needs a weight for each sample in the dataset.
As this is a harder task to train you might try different loss functions:
We achieved best results by using the Binary Cross Entropy instead of the Dice Loss.
Computed Dice-score: 0.896