/UNET

A package to generate and train a UNET deep convolutional network for 2D and 3D image segmentation

Primary LanguageMathematicaMIT LicenseMIT

UNET

DOI contributions welcome HitCount

A package to generate and train a UNET deep convolutional network for 2D and 3D image segmentation

Information

UNET is developed for Mathematica. It contains the following toolboxes:

  • UnetCore
  • UnetSupport

Documentation of all functions and their options is fully integrated in the Mathematica documentation. The toolbox always works within the latest version of Mathematica and does not support any backward compatibility.

All code and documentation is maintained and uploaded to github using Workbench.

Install toolbox

Install the toolbox in the Mathematica UserBaseDirectory > Applications.

FileNameJoin[{$UserBaseDirectory, "Applications"}]

Using the toolbox

The toolbox can be loaded by using <<UNET`

The notbook UNET.nb shows examples of how to use the toolbox on artificially generated 2D data. There are also examples how to visualize the layer of your trained network and how to visualize the training itself.

Functionality

The network supports multi channel inputs and multi class segmentation.

  • UNET generates a UNET convolutional network.

    • 2D UNET
      UNET 2D
    • 3D UNET
      UNET 3D
    • Loss Layers: Training the data is done using two loss layers: a SoftDiceLossLayer, BrierLossLayer and a CrossEntropyLossLayer.
      SoftDiceLossLayer, BrierLossLayer and a CrossEntropyLossLayer
  • Convuluation blocks: The toobox contains five different convolution blocks that build up the network: UNET, UResNet, RestNet, UDenseNet, DensNet. split data

  • SplitTrainData splits the data and labels into training, validation and test data.
    split data

  • TrainUNET trains the network.
    Train Unet

Visualization

  • Visualize the network and results
    • Visualize the layers
      Visualize the layers
    • Results
      Visualize hidden layers
    • Visualize the training
      Visualize hidden layers
      Visualize hidden layers

Example

*Example: 3D segmentation of lower leg muscles using MRI data.
Automated 3D muscle segmentation using UNET / RESNET using DIXON MRI data

License

https://opensource.org/licenses/MIT

Some code was based on https://github.com/alihashmiii/UNet-Segmentation-Wolfram