focal Loss Layer evaluation

6 ビュー (過去 30 日間)
Raza Ali
Raza Ali 2020 年 6 月 19 日
コメント済み: Bhargavi Maganuru 2020 年 7 月 6 日
I have created simple CNN for semantic segmentation and repalced last layer with focal loss layer to use focal loss fucntion instead of pixel classification function.
Network = [
imageInputLayer([256 256 3],"Name","imageinput")
convolution2dLayer([3 3],128,"Name","conv_1","BiasLearnRateFactor",2,"Padding","same")
reluLayer("Name","relu_1")
batchNormalizationLayer("Name","batchnorm")
transposedConv2dLayer([3 3],2,"Name","transposed-conv","Cropping","same")
reluLayer("Name","relu_3")
softmaxLayer("Name","softmax")
focalLossLayer(2,0.25,"Name","focal-loss")];
after training the network, I used,
pxdsResults = semanticseg(imdsTest,Trained_network, ...
'MiniBatchSize',5, ...
'WriteLocation',tempdir, ...
'Verbose',false);
for test images but I got error the following error;
Error using semanticseg>iFindAndAssertNetworkHasOnePixelClassificationLayer (line 584)
The network must have a pixel classification layer.
Error in semanticseg>iParseInputs (line 377)
pxLayerID = iFindAndAssertNetworkHasOnePixelClassificationLayer(net);
Error in semanticseg (line 216)
params = iParseInputs(I, net, varargin{:});
Now its obvious that last layer must be pixel classification layer. but if I am using focal loss layer how to evaluate this?

採用された回答

Bhargavi Maganuru
Bhargavi Maganuru 2020 年 7 月 6 日
Hi,
Focal loss layer to a semantic segmentation or object classification deep learning network has been added in future release 2020b. In the earlier versions, you can use either PixelClassificationLayer or DicePixelClassificationLayer or a ClassificationLayer as the last layer in the network.
  3 件のコメント
Raza Ali
Raza Ali 2020 年 7 月 6 日
Can we use ClassificationLayer for semantic segmentation? please share any example link if you know.
Bhargavi Maganuru
Bhargavi Maganuru 2020 年 7 月 6 日
You can use ClassficationLayer as the last layer in the network. For more information about ClassficationLayer, refer https://www.mathworks.com/help/deeplearning/ref/classificationlayer.html#responsive_offcanvas

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRecognition, Object Detection, and Semantic Segmentation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by