Label Smoothing Calculator
Calculate smoothed label values used to regularize classification training targets.
About Label Smoothing Calculator
Label smoothing replaces hard one-hot classification targets with a softened distribution: smoothed = (1 − α) × one_hot + α / K, where K is the number of classes and α is the smoothing factor. This means the correct class gets a target of (1 − α) + α/K instead of 1.0, and every incorrect class gets α/K instead of 0.0. This prevents the model from becoming overconfident, improves calibration, and can reduce overfitting, at the cost of the model never being 'encouraged' to output a perfect 100% probability for the correct class.
Formulas
Correct-class target
target_correct = (1 - alpha) + alpha / K
- alpha
- Smoothing factor (e.g. 0.1)
- K
- Number of classes
Other-class target
target_other = alpha / K
- alpha
- Smoothing factor
- K
- Number of classes
Worked example
With the default values below, Label Smoothing Calculator returns Correct-Class Target Value of 0.900100. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Number of Classesaccepts 2–1,000,000
- 1,000
- Smoothing Factor (α)accepts 0–99
- 10
Results
- Correct-Class Target Value
- 0.900100
- Other-Class Target Value
- 0.00010000
- Effective Max Confidence
- 90.01%
- Uniform Floor per Other Class
- 0.0100%
Step by step
- 1Correct-class target: (1 − α) + α/K= 0.900100
- 2Other-class target: α/K= 0.00010000
- 3Effective max confidence= 90.01%
Assumptions and limits
- The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 8 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
What's a typical smoothing factor?
α = 0.1 (10%) is the most common default, originating from the Inception-v3 paper and widely reused since; values between 0.05 and 0.2 are typical, with higher values applying stronger regularization at some cost to peak accuracy.
Why doesn't the model reach 100% confidence with label smoothing?
Because the training target itself caps out below 1.0 (specifically at (1−α)+α/K), the cross-entropy loss is minimized when the model's predicted probability matches that capped target, not 1.0 — this discourages overconfident predictions by design.
How does label smoothing affect calibration?
It generally improves calibration (how well predicted probabilities match actual accuracy) because it discourages the extreme, overconfident logits that come from training directly against hard 0/1 targets.
Does label smoothing help with noisy labels?
Yes — since it softens how much the model is penalized for not perfectly matching the given label, it can reduce the negative impact of occasional mislabeled training examples compared to hard-target training.
