Reputation: 1287
I'm using fully convolutional networks for semantic segmentation in Caffe, using the Cityscapes dataset.
This script allows to convert IDs of classes, and says to set IDs of classes to ignore at 255, and "ignore these labels during training". How do we do that in practice ? I mean, how do I 'tell' my network that 255 is not a true class as the other integers ?
Thanks for giving me an intuition behind it.
Upvotes: 2
Views: 1492
Reputation: 114786
Using, e.g. "SoftmaxWithLoss"
layer, you can add a loss_param { ignore_label: 255 }
to tell caffe to ignore this label:
layer {
name: "loss"
type: "SoftmaxWithLoss"
bottom: "prediction"
bottom: "labels_with_255_as_ignore"
loss_weight: 1
loss_param: { ignore_label: 255 }
}
I did not check it, but I believe ignore_label
is also used by InfogainLoss
loss and some other loss layer.
Upvotes: 3