AWS Certified Machine Learning – SpecialtyModelingMedium

A machine learning engineer is training a deep neural network for a multi-class image classification task with 100 classes. During training, they notice that the model's confidence scores for correct predictions are often very high (close to 1), but the model sometimes makes confident wrong predictions. This behavior indicates that the model is overconfident and poorly calibrated. Which technique can directly address this issue by encouraging the model to produce more realistic probability estimates?

  1. AUsing Label Smoothing in the loss function.
  2. BApplying L1 regularization to the model weights.
  3. CIncreasing the learning rate during training.
  4. DReducing the number of training epochs.
Show answer & explanation

Correct answer: A. Using Label Smoothing in the loss function.

The problem describes a model that is overconfident, making confident wrong predictions, indicating poor calibration. Label Smoothing is a regularization technique that replaces hard one-hot encoded labels with a mixture of the hard labels and a small uniform distribution. This encourages the model to be less confident in its predictions, improving calibration and generalization.

Why the other options are wrong

  • B. L1 regularization encourages sparsity in weights but doesn't specifically target model calibration or overconfidence in predictions.
  • C. Increasing the learning rate might destabilize training and doesn't directly address overconfidence or calibration.
  • D. Reducing training epochs (early stopping) can prevent overfitting, but it doesn't directly calibrate the model's confidence scores in the way Label Smoothing does.

Label Smoothing

A regularization technique used in classification tasks that introduces noise into the labels by replacing hard one-hot encoded targets with a weighted average of the hard target and a small uniform distribution, encouraging the model to be less overconfident.

  • Reduces model overconfidence.
  • Improves model calibration.
  • Acts as a form of regularization, improving generalization.
  • Commonly used in deep learning for image classification.

Memory trick: Smooth the Labels, Calibrate the Confidence.

More Modeling questions