I am currently working on binary segmentation.
When using unbalance data, overfitting occurs.
Below is a loss curve.

I am using BCEWithLogitsLoss, and pos_weight is applied by calculating neg/positive.
The distribution of data has a ratio [data without segments: data with segments] = about 20:1
The learning rate varied from 1e-3 to 1e-7, and weight_decay applied 1e-4 and dropout.
I tried applying the various methods found on the pytorch forum, but the result is not improved.
I think it’s because the data is too unbalanced,
How can I solve it?
Thanks for reading!