Focal Loss : drop easily sample weights, not just category weights
The background locations in the dense tests are numerous and most of them easily classified.
Learning objectives and first steps2 objectives 2 first fixes
Try to do it after reading
- The impact of hand-held modems on losses
- Distinguishing category balance parameters and difficulty parameters
Suggested first
- Thrust and Matrix Operations
- Basic neural network
A simple and negative amount of money will take the money
The background locations in the dense tests are numerous and most of them easily classified. Focal Loss A factor that changes with the difficulty of current predictions before cross-enultanes contributes even less to the correct and highly trusted samples. It differs from the fixed weight given to positive or negative categories, since the same category also varies within the same category depending on the probabilities of predictions.
The probability of recording the correct category is p_t, while the loss is -(1-p_t) gamma log(p_t) when the category factor is ignored. Gamma = 0 returns to cross entropy; The gamma increases and the pressure on the easy samples is much lower. For negative cases, p_t should have the correct negative probabilities, not always positive probabilities.
At gamma = 2, the correct probabilities of 0.9 are about 0.105361 and the adjusted values are about 0.001054; The correct probability of 0.2 is approximately 1.609438 for cross entropy and about 1.030040 for modulation. Both samples were reduced, but the samples were more easily pressurized. This does not mean that the difficulty sample gradient is only equal to the cross-enthon gradient multiplied by the same constant, since factors themselves rely on projections.
The hard sample may contain noise
Mislabels, unusual images and holidays are often persistently difficult to learn. Bringing training to bear on the odds may also magnify the noise effects. If a small number of samples account for most of the losses in the long term, the markings and data should be checked instead of adding gamma.
The class coefficient is different for alpha and gamma: the alpha is balanced by labels and the gamma is modified by the current projected difficulty. Parameter extraction values and positive and negative definitions should be made clear, and you cannot only write " Use focal " to default all the equivalents. The candidate structure of the multiple categories softmax and stand-alone sigmoid is also different.
To achieve the desired acceptance of logits and to use a stable cross-enultanium core, avoiding numerical problems arising from the extreme probability of obtaining a manual log. It also determines how a large number of background locations enter the denominator, changing the scale by all locations, number of cases or number of samples.
This section refers to the current open interface between the original paper and Torchvision, the value of which is a synthetic probabilities manual. The loss should be selected simultaneously to check the marking quality, the conclusion and the mission assessment, and should not be replaced by a test of AP enhancement for the training loss.
Value recovery
import mathfocal=lambda p:-(1-p)**2*math.log(p)assert math.isclose(focal(0.9),0.0010536051565782623)assert math.isclose(focal(0.2),1.0300402639578243)Gamma = 0, ignore alpha Focal Loss What is it?
Go back to normal cross entropy, because the modem is 1.
Why is it difficult to weigh the noise in order to magnify it?
Mislabels often continue to be low on the right probabilities, are easy to obtain higher weights and require verification of hard-core sources.
Focusing only on the difficulty of classification while ignoring the locational branch may result in improved classification losses and no improvement in the frame position. Multi-task testing should record the classification and regression items separately, and then be evaluated under a complete matching agreement, without replacing the final result with a branch value.
Sources and reconciliations
Definitions, methods and interfaces are available.
Figures and calculations are reorganized according to this chapter. Mathematical measurements, framework operations and real business effects are described separately in the body of the text.