Hi, due to the high imbalance of the class distribution of my own dataset, I want to use focal loss to solve it. I tried change all the 'loss_cls' in cascade rcnn to
loss_cls=dict(
type='FocalLoss',
use_sigmoid=True,
gamma=2.0,
alpha=0.25,
loss_weight=0.005),
but the loss gets bigger and bigger. I wonder how to change the config file of cascade RCNN to use focal loss, or do you have any advice to help with the imbalance problem? Thanks!
It is not surprised. FocalLoss may not work well on two-stage detectors. For the imbalanced problem, it is beyond the scope of the codebase usage. My personal suggestion is that you may read some related papers, to name a few, OHEM, GHM, Libra R-CNN, etc.
Most helpful comment
It is not surprised. FocalLoss may not work well on two-stage detectors. For the imbalanced problem, it is beyond the scope of the codebase usage. My personal suggestion is that you may read some related papers, to name a few, OHEM, GHM, Libra R-CNN, etc.