Label smooth: reduce extreme self-confidence while changing target distribution

Calculates the smooth label under a clear agreement, distinguishing between positive and true label probability.

• Step by stepCollate in 2 self-measured2 First-hand sources
Start Body
Learning objectives and first steps2 objectives . 1 first fix

Try to do it after reading

  • Calculate a smooth label under a clear agreement
  • Distinguishing regular preferences from real label probabilities

Suggested first

  • Classification and probabilities projections

Tabs are no longer given to all mass for one category

The smoothing of the label allocates part of the quality from hard to other categories, so that cross-enthon targets no longer require the prediction of training samples to be infinitely closer to single point distribution. It can express a positive or positive preference, but it does not mean that there are really even random errors in each label, nor does it guarantee a certain calibration of the final prediction. First, it must be stated how smooth quality is distributed, since common pacts are not identical.

Three fixed examples

Using a mixture with the uniform distribution, K=3 and ε=0.1 give true-class target 0.9+0.1/3=14/15 and each other class 1/30, summing to 1. Another convention distributes ε only among incorrect classes, giving [0.9,0.05,0.05]. Do not mix formulas and code across conventions. For prediction [0.8,0.1,0.1] with class one true, hard-label cross-entropy is approximately 0.223144. The current smoothed target gives −(14/15)log(0.8)−(1/15)log(0.1)≈0.361773. The larger loss reflects a different target distribution, not worse predictions.

How the gradient changes

For softmax scores, the cross entropy gradient in the form of a target probability is the projected reduction target. The model will not continue to push it in the same way as if the real target was to be reduced from 1 to the same level; The non-real category also receives non-zero targets. This mechanism is different from temperature scalding, post-check calibration, which can change the output scale or map after training and cannot be synonymous.

Structured labels versus uneven a priori

If there is a synonym or hierarchy of categories, even smoothness may not be reasonable. Distinguishing a very unlikely category of distance into the same quality is a clear assumption that mission-specific design may be required. In extreme long endings, even smoothing also changes the target relationship of the tail to the header, and the results should be independently checked.

Realization of the border

The label mask, the missing index and the sample weight may affect the actual loss denominator; A frame that receives both probability labels and internal smooth parameters is required to confirm whether there has been a repetition of smoothing. When a word sheet changes, the size of each uniform mass changes, and the training configuration should save the class pools. Model evaluations can retain hard-label logarithm, sorting and calibration indicators and should not draw direct horizontal conclusions on training losses that are different from smooth targets. The values in this paper are arithmeticals for given targets and do not represent any improvement in the parameters for any real task.

qk=(1−ε)I(k=y)+εK

Self-measurement and provocator

With three classes and ε=0.1, what is the true-class target under this convention?

is 0.9 + 0.1/3 = 14/15 instead of 0.9; The remaining two categories are 1/30 each.

Is smoothing loss greater than the hard label loss and can model degradation be judged directly?

No, because the distribution of targets has changed; A uniform independent evaluation calibre should be used to compare the projected quality.

Sources and reconciliations

Definitions, methods and interfaces are available.

  1. Szegedy et al. — Rethinking the Inception Architecture for Computer Vision
  2. PyTorch — CrossEntropyLoss

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.

← Back to the knowledge directory
Ask Max Ask about this site
Ask Max ↗

Opening the assistant…

Paper figure

Photo comments

LEAVE A NOTE

About this photograph

Connecting to the discussion board…

    Comments become public after moderation. You can delete your own comments from this browser.
    No email is required. Clearing cookies prevents this browser from claiming earlier comments.

    MAX WANG / INDEX

    Find something

    Enter a keyword, or explore the directory below.