Focal Loss
A dynamically scaled loss function designed for classification tasks that automatically down-weights the importance of easy examples to focus on harder cases.
Think of It Like This
Like a teacher ignoring the simple math problems a student always gets right to spend all their tutoring time helping them master the most difficult concepts.
Focal loss was introduced to address extreme class imbalance, particularly in object detection where background bounding boxes vastly outnumber actual objects. By adding a modulating factor to standard cross-entropy, it prevents the overwhelming number of easy negatives from dominating the gradient. This allows the model to learn rare and difficult features effectively.