Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 1.25 KB

README.md

File metadata and controls

23 lines (17 loc) · 1.25 KB

Focal Loss

This is the keras implementation of focal loss with the backend of tensorflow. The Focal Loss is proposed for dealing with foreground-backgrou class imbalance. 论文中的结果图Fig1

Usage

Compile your model with focal loss as sample:

model.compile(optimizer = Adam(lr = 1e-4), loss = [focal_loss(gamma=2,alpha=0.6)], metrics = ['accuracy'])

Experiments

We implement U-Net: Convolutional Networks for Biomedical Image Segmentation with Focal Loss and get the results of different parameters as follows: 不同的图像fig2 fig1

曲线图fig3

fig2

From fig2, we found the improvement of focal is not ideal. And different parameters have a greater impact.

Breaks

We found that the Focal Loss is not stable and I think the main reason is parameters initialization. I wil try to fix it.

Others

The implemented code is based @zhixuhao' code