I am trying to train a fully convolutional net from scratch for a semantic segmentation task, but the training set I have is sparse, meaning that I have to ignore pixels that do not contain information (label=0) while training.
Otherwise, I have 5 classes I am interested to retrieve.
To achieve that, I just added the argument ignore_index to the cross entropy loss function to drop the 0-labeled pixels.
However, I am confused because I would expect the net to output 5 scores (for the 5 classes of interest), although it also gives me a score for the class 0.
Does anyone have any ideas on why I get 6 class scores, expecting only 5 ?