I am performing segmentation using segmentation_models, which is a wrapper for keras. This is the blurb that defines my UNet:
jaccard_loss = sm.losses.JaccardLoss(class_weights=class_weights)
focal_loss = sm.losses.CategoricalFocalLoss()
total_loss = jaccard_loss + (1 * focal_loss)
metrics = [sm.metrics.IOUScore()]
model = sm.Unet(BACKBONE1, encoder_weights=None,classes=n_classes, activation='softmax',input_shape=(None, None, num_channels))
model.compile(opt, total_loss, metrics=metrics)
My question is relatively simple, I'm feeding in a stack of slices into the UNet, but there's a lot of spatial information that's missing (i.e., just the physical location of the slice). I would like to feed this into the model to see if this helps improve segmentation. The easiest thing to do would be to just have another channel which has an image that is all the same value (i.e., a uniform image of 0 to 1 depending on physical location). I have a feeling this is not the best way though, so I was wondering if anyone had any good ideas or has done something similar before? Thank you very much in advance for your help.