ctlearn-project/ctlearn

Enable the usage of the focal loss function

Opened this issue · 1 comments

Focal loss may be useful to our classification use case, where there is a significant imbalance between classes. We should try to implement it as a selectable loss function and benchmark its impact on classification.

I just came across this lately. In the keras loss API, this focal loss is available under CategoricalFocalCrossentropy. Also for the regression tasks we might want to explore different loss functions. I think quite promising is the LogCosh. That one is more robust to outliers than mean absolute error, which might be very helpful during training. I guess our outliers are proton-like (diffuse) gammas which we later discard anyway for the (high-level) analysis. So we probably want our loss function to ignore those predictions which should disturb the learning. Just food for thoughts but we should move back to allow the user to pass different keras built-in loss functions and run some experiments.