ViT-Adapter
ViT-Adapter copied to clipboard
About num_classes for binary semantic segmentation in loss config
I'm still working for binary semantic segmentation that has two classes(background:0 / foreground:1 == building)
I have some questions about config of loss.
num_classes=2
loss_cls=dict(
type='CrossEntropyLoss',
use_sigmoid=False,
loss_weight=2.0,
reduction='mean',
class_weight=[1.0] * num_classes + [0.1]),
loss_mask=dict(
type='CrossEntropyLoss',
use_sigmoid=True,
reduction='mean',
loss_weight=5.0),
loss_dice=dict(
type='DiceLoss',
use_sigmoid=True,
activate=True,
reduction='mean',
naive_dice=True,
eps=1.0,
loss_weight=5.0)
- Should i use
use_sigmoid=
inloss_cls
toTrue
if binary segmentation? - In
loss_cls
, why 'class_weight' has one more class?[1.0]*num_class
and extra[0.1]
Thanks
I also meet the same problem. Have you successfully trained on the binary semantic segmentation? @gjustin40