Following the "3-D Brain Tumor Segmentation Using Deep Learning" example results in a network with incorrect structure
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 10 Okt. 2023
Beantwortet: MathWorks Support Team
am 13 Okt. 2023
When following the "3-D Brain Tumor Segmentation Using Deep Learning" example, I built and trained the network as instructed, via the "unet3dlayers" function. The referred-to example can be found at the link below:
https://uk.mathworks.com/help/releases/R2023b/images/segment-3d-brain-tumor-using-deep-learning.html
This is meant to create a network that matches the one that you are instructed to download at the start of the example. However, the final four layers of the created network differ from the final four layers of the downloaded network.
In particular, the "DicePixelClassificationLayer" appears in the last (58th) position in the downloaded network's layers, after the 3 cropping layers. However, in the network resulting from the "unet3dlayers" function, the "DicePixelClassificationLayer" appears in the 55th position, before the 3 cropping layers.
Why is this the case?
Additionally, how can I access the size of the output layer if I don't know which element the output layer is?
Akzeptierte Antwort
MathWorks Support Team
am 10 Okt. 2023
1. Addressing Concerns Regarding Structure and Layer Order
It is counter-intuitive for the "DicePixelClassificationLayer" to appear in the 55th position, since this acts as the output layer for the Network, and hence, one would assume that it appears in the final (58th) position. The Development team has been made aware of this and will consider changing this positioning behavior in future releases.
For a network, "net", the order of the layers in "net.Layers" does not determine the structure of the network or the flow of data through it, it is simply a list of the layers in the network. Typically the order in the "Layers" array will correspond to the order of the layers in the network's architecture. However, in the case of a U-Net, the flow of the network is non-sequential and hence there is no "natural" ordering of the layers. In particular, this non-sequentiality occurs around the cropping and concatenation layers.
The structure of a network is determined by the input and output specification and the "Connections" table. Hence, in the case of the example here, the network created from the layer graph, "lgraph", is the same as that of the downloaded "net" network. You can observe this by opening the networks in the network designer, by entering the following commands into the MATLAB Command Window:
>> deepNetworkDesigner(lgraph)
>> deepNetworkDesigner(net)
You can also notice that the networks have the same structure by looking at "lgraph.Connections" and "net.Connections". In particular, the cropping layers in both networks lead to the same concatenation layers further up in the network in both "lgraph" and "net".
2. How to Access the Output Size of the Network
Upon creation of the layer graph, you can also record the output size by doing the following:
[lgraph,outPatchSize] = unet3dLayers(inputPatchSize, ...
numClasses,ConvolutionPadding="valid");
In this case "outPatchSize" will be the output size of the network.
Additionally, if you would like to know which layer is going to be the output layer, you can find this out by looking at the "lgraph.OutputNames" property, which you could then use to search through "lgraph.Layers" to find the output layer itself.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Deep Learning Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!