# Generalized Cross Entropy Loss for Training Deep Neural Networks with Noisy Labels

Lq loss lets deep networks train on noisy labels with less memorization

Zhilu Zhang, Mert R. Sabuncu · arXiv · 2018-5-20

- **Problem** Cross entropy loss makes deep networks memorize wrong labels and hurt clean test accuracy. MAE resists wrong labels but learns too slowly, so accuracy stays low.
- **Method** The Lq loss is a family that moves from cross entropy at q near 0 to MAE at q equals 1. Truncated Lq sets a floor on low-confidence samples so they stop affecting training.
- **Results** On CIFAR-100 with noisy labels, MAE peaked at 38.29 percent while cross entropy reached 39.92 percent on clean data. Truncated Lq scored 79.55 under open-set noise, against 79.28 for Wang et al.

## Why cross entropy and MAE both fall short

Cross entropy (CCE) is the default training loss, but a DNN has enough capacity to fit labels that are simply wrong. Once the network starts fitting wrong labels, its accuracy on clean test data suffers, so the training loss itself needs to be robust. Ghosh et al. showed that MAE can tolerate label noise under certain assumptions, which made it a natural candidate.

The catch is that MAE makes learning slow. On clean CIFAR-10, the test accuracy curve for MAE took much longer to converge than the curve for CCE, and the final accuracy was lower. On CIFAR-100 the gap was starker: MAE peaked at 38.29% after 2000 epochs, while CCE reached 39.92% after 7 epochs. So the property that makes MAE robust is the same property that makes it hard to train.

## A loss family that slides between CCE and MAE

The key idea is one loss with a knob q that moves between CCE at one end and MAE at the other. The authors base it on a negative Box-Cox transformation applied to the predicted probability of the labeled class. For a sample with label j, the softmax output for that class is raised to the power q, and the result is subtracted from 1. Dividing by q gives the loss \\(L\_q(f(x),e\_j)=(1-f\_j(x)^q)/q\\), defined for q in (0, 1\].

Using L'Hôpital's rule, the authors show that the limit of this loss as q goes to 0 is CCE. At q = 1 the loss becomes MAE, which is the unhinged loss up to a constant. Because it contains both methods as endpoints, the authors call it a generalization of CCE and MAE. For any input, the sum of the loss over all classes is bounded above by \\(c - 1/q\\), where c is the number of classes.

Under uniform noise with rate η at most 1 − 1/c, the clean-risk gap between the clean minimizer and the noisy minimizer lies between a negative constant A and zero. The authors note that A grows toward zero as q increases, so a larger q gives a tighter bound. At q = 1, A is zero, and the noisy minimizer matches the clean minimizer on the clean risk.

## Why q between 0 and 1 eases training

The gradients explain the difference between CCE and MAE. CCE's gradient carries a 1/f term, so samples with low softmax values for their label get extra weight. That helps on clean data, but it lets CCE fit the wrong labels. MAE's gradient has no such term, so every sample counts equally, which resists noise but slows learning.

For the Lq loss the gradient is \\(-f\_{y\_i}(x\_i;\\theta)^{q-1}\\nabla\_\\theta f\_{y\_i}(x\_i;\\theta)\\). Relative to CCE, each sample is multiplied by an extra \\(f\_{y\_i}^q\\), so samples the model already disagrees with count for less. Relative to MAE, the factor \\(f\_{y\_i}^{q-1}\\) still gives challenging samples more weight, which helps learning. A larger q is more noise-robust but makes optimization harder, so the authors settle on an intermediate value.

## Truncation and pruning

The truncated version sets a floor: when the softmax output for the labeled class is at most k, the loss is held at the constant \\(L\_q(k)\\). Since \\(L\_q(k)=(1-k^q)/q\\), that constant does not depend on the network output. A constant loss has zero gradient, so those samples stop affecting training. A larger k tightens the bound, but a k that is too large discards clean samples too.

The authors set k to 0.5 and treat it as a bounded hyperparameter. Starting with that threshold is a problem, because early in training most softmax outputs are below 0.5 for a 10-class problem, so most samples get dropped. The authors therefore rewrite the objective with binary weights \\(w\_i\\) that mark whether each sample is kept. They optimize it by alternating: they update the weights in a pruning step, then update the network with the weights fixed.

Pruning keeps a sample only if its softmax output for the label is at least k and its Lq loss is at most \\(L\_q(k)\\). The authors judge the extra computation from pruning to be negligible, since it needs one pass over the training samples. Algorithm 1 starts all weights at 1, trains, then alternates pruning and training for T iterations. In the experiments, pruning began after the first 40 epochs on CIFAR-10 or 80 on CIFAR-100, and ran every 10 epochs.

## Experimental setup

Noisy labels were made by corrupting the true training labels, and 10% of the training data was held out for validation. Only the training and validation labels were corrupted, and test accuracy was computed against the true labels. Each experiment was repeated five times, with new random initializations and new noisy labels each time. The baselines were CCE, MAE, and forward correction, which is the confusion matrix-corrected CCE.

The learning rate was divided by 10 at epochs 40 and 80 for CIFAR-10, and at epochs 80 and 120 for CIFAR-100. FASHION-MNIST used ResNet-18, with the same preprocessing and optimization as CIFAR-10. For the remaining experiments, the authors set q to 0.7.

Uniform noise replaced each true label with a random label drawn by uniform sampling. Class-dependent noise on CIFAR-10 mapped TRUCK to AUTOMOBILE, BIRD to AIRPLANE, DEER to HORSE, and swapped CAT and DOG, each with probability η. On FASHION-MNIST, the class pairs came from a t-SNE plot, so that similar classes were paired. Open-set noise used CIFAR-100 images given random CIFAR-10 labels, with training for 100 epochs.

## What q does during noisy training

Before the noisy runs, the authors checked q on clean CIFAR-10 with ResNet-34 trained by Adam. On clean data, a larger q slowed convergence and lowered accuracy. With noise the picture changes: a CCE-trained model first learns predictive patterns and then overfits the noisy labels.

Raising q delays overfitting and gives higher accuracy. The authors read this as the model having time to learn predictive features before it memorizes the noise.

There is a threshold: at η = 0.2, q = 0.8 gave training with no overfitting. The noisier the labels, the higher this threshold appeared. Too large a q hurts accuracy, so q is a hyperparameter to tune on validation. For the rest of the experiments, q = 0.7 gave no overfitting for η up to 0.5.

## Closed-set results under uniform and class-dependent noise

It also beat forward correction with the true confusion matrix, which scored 85.07 at that rate. MAE reached only 67.00 at that rate. So the loss alone, with no confusion matrix, outperformed a method that knew the true matrix under uniform noise.

Under class-dependent noise, forward correction with the true confusion matrix was usually strongest, since it used the true matrix. On FASHION-MNIST at rate 0.4, truncated Lq scored 91.62, compared to 88.53 for forward correction with the estimated matrix. Plain Lq did not improve on the baselines for FASHION-MNIST or CIFAR-10 in this setting.

The authors suspect that very similar classes were grouped in the confusion matrices, so the network became confident on wrong labels.

MAE performed poorly on every dataset and at every noise level tested. The authors attribute this to ResNet struggling to optimize with MAE, most visibly on CIFAR-100.

## Open-set noise on CIFAR-10

The open-set test followed the setup of Wang et al., with CIFAR-100 images that carry random CIFAR-10 labels. Truncated Lq scored 79.55 with open-set noise, compared to 79.28 for Wang et al. and 62.92 for CCE.

The authors report this as better than the prior state of the art, although the margin over Wang et al. is narrow. Plain Lq scored 71.10 in the same setting, and MAE scored 75.06. The authors say Lq noticeably prevented overfitting in this setting. On closed-set CIFAR-10 in the same setup, truncated Lq scored 79.12, compared to 78.15 for Wang et al.

Lq trailed MAE here, and the authors attribute this to reading test accuracy long after overfitting began. They note that a shallow CNN without data augmentation was used for this experiment.

## Limitations

Experiments cover only CIFAR-10, CIFAR-100 and FASHION-MNIST. The ImageNet remark in the discussion of MAE is not tested by any experiment in the paper. Noise is assumed to be conditionally independent of the inputs, given the true label.

The class-dependent bound needs the clean risk of the minimizer to be zero, and it also needs the off-diagonal confusion terms to be smaller than the diagonal ones. Most runs fixed q at 0.7 and k at 0.5, while the authors say both could be optimized for better accuracy. The open-set comparison ran only on CIFAR-10, for 100 epochs, with a shallow CNN and no augmentation.

## Paper info

- **Authors**: Zhilu Zhang, Mert R. Sabuncu
- **Venue**: arXiv · Preprint
- **First published**: 2018-5-20
- **Added**: 2026-11-12
- **Updated**: 2018-11-29
- **Version**: v4
- **arXiv**: 1805.07836
- **Category**: cs.LG · cs.CV · stat.ML
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1805.07836v4) · [PDF ↗](https://arxiv.org/pdf/1805.07836v4)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Zhilu Zhang, Mert R. Sabuncu (2018). Generalized Cross Entropy Loss for Training Deep Neural Networks with Noisy Labels. arXiv:1805.07836v4. https://arxiv.org/abs/1805.07836v4

**BibTeX**

```
@misc{zhang2018generalized,
  title = {{Generalized Cross Entropy Loss for Training Deep Neural Networks with Noisy Labels}},
  author = {Zhilu Zhang and Mert R. Sabuncu},
  year = {2018},
  eprint = {1805.07836},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1805.07836v4}
}
```

## Other paper commentary

- [Hypergraph Neural Networks](https://refivu.com/en/papers/cf9d7d35-b5ef-4472-b64e-4c332f808ace-hypergraph-neural-networks.md)
- [Deep Ordinal Regression Network for Monocular Depth Estimation](https://refivu.com/en/papers/e525192f-9651-4698-8525-b6cda281195b-deep-ordinal-regression-network-for-monocular-depth.md)
- [Stacked Attention Networks for Image Question Answering](https://refivu.com/en/papers/aa94a5f2-b4fb-441a-af4b-22eda9ad2985-stacked-attention-networks-for-image-question-answering.md)
- [A guide to convolution arithmetic for deep learning](https://refivu.com/en/papers/7690e8f8-368e-4a59-a827-7093c4415777-a-guide-to-convolution-arithmetic-for-deep-learning.md)
- [Explainable Artificial Intelligence: Understanding, Visualizing and Interpreting Deep Learning Models](https://refivu.com/en/papers/6bd22a78-4fb3-465f-b297-2113b18ee3f2-explainable-artificial-intelligence-understanding.md)
- [SCA-CNN: Spatial and Channel-wise Attention in Convolutional Networks for Image Captioning](https://refivu.com/en/papers/51e17bf0-d47d-4aca-8ce3-e07e4204a821-sca-cnn-spatial-and-channel-wise-attention-in.md)
- [RMPE: Regional Multi-person Pose Estimation](https://refivu.com/en/papers/a258675a-c286-4c65-9760-3d72305d7120-rmpe-regional-multi-person-pose-estimation.md)
- [Memorizing Normality to Detect Anomaly: Memory-augmented Deep Autoencoder for Unsupervised Anomaly Detection](https://refivu.com/en/papers/b6435fab-e010-4a4f-aeb8-b125ca06e94a-memorizing-normality-to-detect-anomaly-memory-augmented-deep.md)
- [Speech Commands: A Dataset for Limited-Vocabulary Speech Recognition](https://refivu.com/en/papers/4809d645-7dd0-42ce-ba15-4c5208cfa877-speech-commands-a-dataset-for-limited-vocabulary-speech.md)
- [LLNet: A Deep Autoencoder Approach to Natural Low-light Image Enhancement](https://refivu.com/en/papers/1b58b4f0-48b5-40db-be28-ecd8cf270c6f-llnet-a-deep-autoencoder-approach-to-natural-low.md)
- [RePaint: Inpainting using Denoising Diffusion Probabilistic Models](https://refivu.com/en/papers/3c0a622f-efc1-4d6c-bb30-bd253079ac9a-repaint-inpainting-using-denoising-diffusion-probabilistic.md)
- [RotatE: Knowledge Graph Embedding by Relational Rotation in Complex Space](https://refivu.com/en/papers/6cf7532c-a2b4-4553-a534-0482af8548e2-rotate-knowledge-graph-embedding-by-relational-rotation-in.md)

## Terms in this paper

- [MAE](https://refivu.com/en/terms/15fbae569b33-mae)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/41c59d55-611c-4abf-a4e2-459eb900711f-generalized-cross-entropy-loss-for-training-deep-neural)
