1

I have an image binary classification problem, with only 15% of the data from class 1, and 85% of it is from class 0.

I decided to work with focal loss to deal with the unbalanced dataset and noticed something. When I use a fairly simple cnn, I see the focal loss working, managing to classify more than just one class (with accuracy more than 85%).

The thing is, when I switch the cnn to be a 50 layer resnet, it doesn't work. It classifies every photo with class 0, keeping the accuracy locked at 85% with AUC of 0.5. Why is this happening? The images are 180x180x3.

Thanks.

toxin9
  • 81
  • 7
  • What if you don't use focal loss? How can you be sure that this is caused by it? – hkchengrex Jul 27 '20 at 04:04
  • it's the same when using binaryCrossEntropy... – toxin9 Jul 27 '20 at 20:44
  • Then it's clearly not a focal loss problem. You might want to change your title. But then it becomes a really generic question that is hard to solve with many possible causes. I would suggest 1. decreasing learning rate (by a factor of 10 or even 100) 2. test your resnet on some other tasks. – hkchengrex Jul 28 '20 at 04:18
  • Only found out later that BCE does the same thing. Thanks for the advice. I will say that the resnet i'm using is the default 50 layer one, and that I used it with the focal loss on some other task and it worked. But I can see what you mean by generic. Thanks – toxin9 Jul 28 '20 at 17:25

0 Answers0