U-net lost connections during training (using unetLayers function)

1 view (last 30 days)
I am trying to train a simple u-net (for an image of size 128x128 and encoder depth 4) using unetLayers:
lgraph = unetLayers([128,128],3,'FilterSize',3,'EncoderDepth',4);
The network graph seems reasonable before training, and so is the training process using a small data set.
After the training the new network is missing the 'bridge connections' between the encoding section and the decoding section.
Any ideas what is causing this?
(I've tried different training options and my database seems valid).
Has anyone encountered any issues with matlab's new u-net network?
Thank you!
  2 Comments
Prajith Chilummula
Prajith Chilummula on 10 Jan 2019
Are you following the similar steps as shown in the link https://www.mathworks.com/help/vision/ref/unetlayers.html?
Please provide the code you are using to traing the unet network.
Nili Karmon
Nili Karmon on 10 Jan 2019
Thank you for your answer.
Yes, i am following the example:
%Creating the network:
numClasses = 3;
encoderDepth = 4;
imageSize = [128 128];
filtersize = 3;
lgraph = unetLayers(imageSize,numClasses,'FilterSize',filtersize,'EncoderDepth',encoderDepth);
%training:
imdsTrain = imageDatastore(imageTrainDir);
pxdsTrain = pixelLabelDatastore(labelTrainDir,classNames,labelIDs);
dsTrain = pixelLabelImageDatastore(imdsTrain,pxdsTrain);
options = trainingOptions('sgdm','InitialLearnRate',1e-3, 'MaxEpochs',20,'VerboseFrequency',10);
[net,traininfo] = trainNetwork(dsTrain,lgraph,options);
I've also tried different training options and am getting the same results. The database is a valid database with images and labels.
Do you see anything wrong with my training?
Thank you,
Nili

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!