VikasRajashekar:

BCE_loss = nn.CrossEntropyLoss()(inputs, targets, reduce=False)


This doesn’t look right.

You probably just want the functional version (see above) and pass reduction='none' to be modern.
I’d not call it BCE_loss.

My impression is that focal loss may help, but there are quite a few ways to do this, the most simple one is balanced sampling during training and a recent one is the weighted loss function from https://arxiv.org/abs/1901.05555 321 .
Best regards
Thomas