Hello, I’m doing a project about semantic segmentation with 2 class using U-net , but my data was unbalanced, so I think maybe use focalloss is a good idea for my project, and I was use BCEloss, so changed the final layer from 1 channel to 2 channels, and use this code focalloss2d 30,but the loss was unchanged during trainning,  I’m so confused ,I give the label 0 or 1 to the mask, I don’t know where it is wrong. Thanks!
here is part of my Dataset
normalize = T.Normalize(mean=[0.4, 0.4, 0.4], std=[0.4, 0.4, 0.4])
            self.transforms4imgs = T.Compose([
                T.ToTensor(),
                normalize
            ])
            self.transforms4label = T.Compose([
                T.ToTensor(),
            ])

data = cv2.imread(img_path)
label = cv2.imread(label_path, 0)
_, label = cv2.threshold(label, 100, 255, cv2.THRESH_BINARY)
label = label / 255
label = label[:, :, np.newaxis]
data = self.transforms4imgs(data)
label = self.transforms4label(label)