MATLAB Answers

Input for U-NET segmentation

17 views (last 30 days)
Hassan Ashraf
Hassan Ashraf on 26 Apr 2019
Answered: Binu on 5 Sep 2019
I am trying to implement U-NET segmentation on Kaggle 2018 Nuclei segmentation data. The training data set contains images with masks in such a way that each image has multiple masks(not a single mask). The example illustrated in MATLAB U-NET image segmentation has images with corresponding masks(Traing dataset has two folders train images which contain training images and train masks which contain training masks). And all images has same size.
The Kaggle training dataset has 670 folders(There are 670 images), each folder has training image folder which contain single image and training mask folder which contain multiple masks for corresponding image and every image has different size. My questions are
1) How to prepare input database to be fed to U-NET architecture?
2)How to transform different sizes of image to implement U-NET Segmentation?
3)How to implement U-NET Segmentation when we have multiple masks corresponding to a single image?

Accepted Answer

Binu on 5 Sep 2019
1) Look into imageDataStore, pixelLabelDataStore functions which can basically store your input image and corresponding masks
2) you'll need to resize all your images and masks to the same size. Eg. 256 x 256 (.png).
3) I am not sure how many classes you are looking at for this example. Essentially you'll be creating a mask per image. Intialize as zeros say uint8 class. Assign everything in class one as 1, class 2 as 2..etc.. or you could labels and make it a categorical array
MATLAB has some examples using Unet architecture that might be worth looking at.
Good luck!

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!