Different network architectures between downloaded and script-created networks - Tutorial: 3-D Brain Tumor Segmentation Using Deep Learning

1 次查看(过去 30 天)
Hi,
In the tutorial 3-D Brain Tumor Segmentation Using Deep Learning, the network dowloaded directly from the MATLAB repository using the command
trained3DUnetURL = "https://www.mathworks.com/supportfiles/"+ ...
"vision/data/brainTumor3DUNetValid.mat";
downloadTrainedNetwork(trained3DUnetURL,dataDir);
is different than the network created following the tutorial instructions, in particular the commands
numChannels = 4;
inputPatchSize = [patchSize numChannels];
numClasses = 2;
[lgraph,outPatchSize] = unet3dLayers(inputPatchSize, ...
numClasses,ConvolutionPadding="valid");
outputLayer = dicePixelClassificationLayer(Name="Output");
lgraph = replaceLayer(lgraph,"Segmentation-Layer",outputLayer);
inputLayer = image3dInputLayer(inputPatchSize, ...
Normalization="none",Name="ImageInputLayer");
lgraph = replaceLayer(lgraph,"ImageInputLayer",inputLayer);
In the first case - downloaded network - the classification layer is at the end, while in the case of the created network this layer is before the cropping layers.
Does anybody have an explanation for this discrepancy?
Best,
Jacopo

采纳的回答

Ben
Ben 2023-9-20
Do you mean the order as described by lgraph.Layers? I can see that.
The order of lgraph.Layers is independent of the order the graph is executed in a network object. For example you can do the following:
lgraph = layerGraph();
lgraph = addLayers(lgraph,reluLayer(Name="addedFirst"));
lgraph = addLayers(lgraph,featureInputLayer(1,Name="addedSecond"));
lgraph = connectLayers(lgraph,"addedSecond","addedFirst");
This will have lgraph.Layers in the order that layers were added, but due to the input layer and connections data actually flows as "input -> addedSecond (input layer) -> addedFirst -> output". You can see this by calling analyzeNetwork(lgraph).
I suspect the reason is just that unet3dLayers constructs the graph in a different order than the saved .mat version of the network was created.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by