Skip to content

how to use AC loss or ACE loss #6

@guava1427

Description

@guava1427

Hello,

I tried to use AC or ACE losses instead of CE loss for the binary segmentation. Though I have used a certain network for the CE loss many times, the network does not work for AC/ACE losses.

In the meantime, I used a label array whose shape is equal to the prediction. Also, its channels have zero or one values like the code below.

from aceloss import ACLossV2
criterion = ACLossV2(classes=2)
outputs = model(inputs)
masks2 = torch.zeros_like(outputs)
masks2[:, 0, :, :] = (masks == 0).squeeze(1) # shape: [batch size, channel size, width, height]
masks2[:, 1, :, :] = (masks == 1).squeeze(1)
loss = criterion(outputs, masks2)

The loss value is larger than 1e4, and the output for the prediction looks meaningless. Did I miss something? I didn't change any code for the ACELoss class. Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions