Group Abstract Group Abstract

Message Boards Message Boards

UNET: neural network for 2D & 3D image segmentation w/ medical examples

Attachments:
POSTED BY: Martijn Froeling
17 Replies

Martjin,

I am very confused on how to load the paclets to run UNET. What is the file structure and where should I put it? When I use "File-Install-Package", what paclets should I use? I am not really familiar with the paclet structure in Mathematica.

Your help would be very much appreciated.

Claudio

POSTED BY: Claudio Argento
POSTED BY: Martijn Froeling

Thank you!

POSTED BY: Claudio Argento
Posted 5 years ago
POSTED BY: Updating Name

Is there any reason, other than memory limitations, to limit the maximum input sizes to 256 for each dimension? Shouldn't it be enough with being multiple of 16?

I have overriden the definition of TrainUNET so as to allow that circunventing the size cap and am training on 400x304 images, and definitely training- time blows up, but hope the rest is OK. Maybe some hyper parameters would need to be adapted for the larger images?

Congratulations and many thanks for all your efforts, suggestions. Especially, I do really like the idea to illustrate and animate the training process.

For some applications, it might be interesting to use the segmented regions as boundaries for a partial differential equation system (e.g. to descrive a diffusion process or a wave or so)...

Frankly speaking, I have never seen these interesting loss layers, like SoftDiceLossLayer, BrierLossLayer.

Time to get closer to these network architectures! ;-)

POSTED BY: Wolfgang Hitzl
POSTED BY: Szabolcs Horvát
POSTED BY: Martijn Froeling
POSTED BY: Szabolcs Horvát
POSTED BY: Martijn Froeling

Be sure to put it on PackageData:

http://packagedata.net/

POSTED BY: Szabolcs Horvát

will do

POSTED BY: Martijn Froeling

enter image description here - Congratulations! This post is now a Staff Pick as distinguished by a badge on your profile! Thank you, keep it coming, and consider contributing your work to the The Notebook Archive!

POSTED BY: EDITORIAL BOARD

Really neat! I wish I understood how this works! I still don't fully understand how you can make a neural network that has a different amount of outputs. Is that easily explained or can i read about this somewhere?

Groetjes!

POSTED BY: Sander Huisman

Thanks! What do you mean with different amounts of outputs?

This is my understanding, but i might be mistaken. In my functions i layout the network architecture. Once the function is called you have to fill in the number of input classes, data dimensions, number of features and the number of output classes. From that moment everything is fixed. The UNET only has one output, an array with the binary segmentation.

The only place where there are multiple output ports is in the loss function, which is well explained in the help of mathematica LossFunction. But these are only used in training.

My approach was to create the neural net with only an Input, the data, and an Output, the segmentation, defined. Only when I start training the net I add the appropriate loss functions which have as input the Output of the net and the ground truth Target for comparison. The loss function it self just outputs a number. You can add as many loss functions as needed and you can even provide a different Target to each. As i understand the training tries to minimize the sum of all the loss functions.

Hope this helps.

POSTED BY: Martijn Froeling

I mean, how can the network 'decide' that there is one object detected, or two, or three, or four… (i know the output will be some matrix with indices). But I don't get how the network 'numbers' the output…

Thanks for the explanation!

POSTED BY: Sander Huisman

Hope this helps

We have one input channel Nchan = 1

Step 1: split the lables into classes, for this exmaple Nclass = 4 (background, sphere, rectangle and overlap), so the network looks for 4 output lables.
enter image description here

Step 2: The first encoding layer split our input channel into 32 channels 1->32
enter image description here

Step 3: by the time we arrive at the deepest level our channels are downsampled but we have a lot of them
enter image description here

Step 4: After decoding we go back to 32 channels again. Hopefully by now each channel contains unique information about the image.
enter image description here

Step 5: We are looking for 4 labels so the 32 channels are mapped to 4 channels
enter image description here

Step 6: The 4 channels are converted to probability maps.
enter image description here

Step 7: The probability map become our 4 labels. In this case the network fail to correctly segment our example. enter image description here

Our background and overlap are segmented whit a very high probability because they have a very distinct contrast which is easy to detect. However our circle and rectangle have the same contrast and have to be labeled based on their shape and not contrast. This is much more difficult and as such mistakes are made.

POSTED BY: Martijn Froeling
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard