Create focal loss layer using focal loss function
A focal loss layer predicts object classes using focal loss. Add the focal loss layer to train an object detection, semantic segmentation, or a classification network when imbalance exists between foreground and background classes. To compensate for class imbalance, the focal loss function multiplies the cross entropy function with a modulating factor that increases the sensitivity of the network to misclassified observations.
creates a focal loss
layer for deep learning networks. For information on how to use focal loss layer in an
object detection network, see Create SSD Object Detection Network.layer
= focalLossLayer
sets properties of the focal loss layer by using one or more name-value pair arguments.
Enclose each property name in quotes.layer
= focalLossLayer(Name,Value
)
For example, focalLossLayer('Name','focalloss')
creates a focal
loss layer with the name 'focalloss'
and the specified balancing and
focusing parameters.
[1] Lin, Tsung-Yi, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollar. "Focal Loss for Dense Object Detection." In 2017 IEEE® International Conference on Computer Vision (ICCV), 2999–3007. Venice: IEEE, 2017. https://doi.org/10.1109/ICCV.2017.324.
focalCrossEntropy
| trainSSDObjectDetector
| trainNetwork
(Deep Learning Toolbox)