フィルターのクリア

How to make the layer automatically ignores a given pixel label during network training?

5 ビュー (過去 30 日間)
I would like to train a semantic segmentation network without considering a given class label during training. I want that pixels from that class do not propagate the loss.
I want to implement a cross-entropy loss function similar to this Python example. The function ignores the last label during loss computation so the network does not "learn" to classify a given class, although this class is present in the training patch.
I know about the dicePixelClassificationLayer function that says "The layer automatically ignores undefined pixel labels during training.", but how to set a given class label to "undefined" so that the layer automatically ignores it?
Please help!

採用された回答

Matheus Ferreira
Matheus Ferreira 2020 年 6 月 24 日
Already solved: Just use the standardizeMissing function to substitut the ID of a given class by NaN. For example, if the class label to ignore is 99 run the following:
img = standardizeMissing(img,99);
Save variable img to the TIFF format and create a pixelLabelDatastore with the class names and label IDs without the class 99, for example. The pixels os the class 99 will be converted to <undefined> and the pixelClassificationLayer ignores undefined pixel labels during training.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by