Generalized DataWeighting via Class-Level Gradient Manipulation

Can Chen, Shuhao Zheng, Xi Chen, Erqun Dong, Xue Liu, Hao Liu, Dejing Dou

TL;DR

Generalized Data Weighting (GDW) moves beyond traditional instance-level reweighting by manipulating gradients at the class level. By unrolling the loss gradient and weighting individual class components separately, GDW simultaneously mitigates label noise and class imbalance more effectively than previous meta-learning approaches, achieving state-of-the-art results on benchmarks like CIFAR and Clothing1M.

The Problem: Coarse Instance Weighting

Deep learning models are notoriously sensitive to two pervasive data quality issues: label noise (incorrect labels) and class imbalance (some classes having far more samples than others). In real-world datasets, these problems often coexist.

Current state-of-the-art solutions frequently use meta-learning to "reweight" data. They rely on a small, clean "meta-set" to learn which training instances are trustworthy. However, these methods typically assign a single scalar weight to an entire image (instance-level weighting).

Comparison of instance-level vs. class-level weighting for a mislabeled image.

The authors argue this approach is too coarse. For example, if an image of a "cat" is mislabeled as a "dog," an instance-level method simply downweights the whole image to minimize the impact of the bad label. But that image still contains valuable information—specifically, the visual evidence that it is not a bird, a car, or a plane. By discarding the entire instance, models lose useful "negative" signals that could improve generalization.

Methods: Class-Level Gradient Manipulation

The core innovation of this paper is Class-level Gradient Manipulation, which breaks down the penalty of a bad label into its constituent parts.

The meta-learning framework for Generalized Data Weighting, showing the bi-level optimization process.
  1. Gradient Unrolling: Using the chain rule, the authors decompose the gradient of the loss function into two parts: the derivative of the loss with respect to the logits (class predictions) and the derivative of the logits with respect to the model parameters.
  2. Class-level Weights: Instead of one weight per image, GDW learns a weight vector $\omega$ where each element corresponds to a specific class. This allows the model to selectively "mute" the noisy label signal (e.g., the "dog" gradient) while "amplifying" signals for other classes that might be useful (e.g., the "not bird" gradient).
  3. Zero-mean Constraint: To prevent the training from becoming unstable or deviating from the fundamental structure of the Softmax-CrossEntropy loss, the authors introduce a mathematical constraint. This ensures the modified gradients still behave like valid probability-based updates.
  4. Efficient Bi-level Optimization: GDW uses a meta-learning framework. It performs a "look-ahead" step: it updates the model, checks the performance on a clean meta-set, and then uses the resulting gradients to update the weighting network. Crucially, they do this using intermediate gradients stored during backpropagation, meaning it adds virtually no extra computational cost compared to standard instance-weighting methods.

Key Insights

  • Don't Throw the Baby Out with the Bathwater: Even a noisy sample has valuable "class-level information." GDW's ability to weight "not-target" classes separately is its primary advantage over prior work.
  • Implicit Balancing: In imbalanced scenarios, GDW naturally learns to upweight the gradients of minority classes. The paper shows that for minority classes, the model learns to strike a balance between the specific class signal and the "not-that-class" signal to prevent overfitting.
  • Gradient Alignment: The method works by forcing the training gradients to align with the gradients of a clean validation set. If a specific class-level gradient helps the model perform better on the clean data, its weight is increased.

Experimental Results

The authors evaluated GDW on several standard and real-world benchmarks, utilizing a tiny clean subset (e.g., 1,000 images for CIFAR) to guide the weighting process:

  • Superior Noise Handling: On CIFAR-10 with 60% uniform noise, GDW outperformed the previous best method (MWNet) by 2.56%.
  • Robustness to Imbalance: In extreme long-tailed settings (imbalance factor of 0.01) on CIFAR-10, GDW outperformed MWNet by a massive 8.6%.
  • Real-world Performance: On the Clothing1M dataset (1 million images from 14 classes with inherent web-crawled label noise), GDW achieved 69.39% accuracy, setting a new high bar among comparable meta-learning and traditional reweighting methods.
  • Efficiency: GDW scales effectively to large datasets because it only introduces a small MLP as a weighting network and reuses intermediate gradients.

Limitations and Future Work

While highly effective, GDW is currently formulated specifically for single-label classification tasks. Applying this to multi-label tasks (where one image has many tags) would require a different mathematical formulation. Additionally, like all meta-learning weighting methods, GDW requires a small amount of clean, unbiased data. While 1,000 images is a relatively small requirement, obtaining a perfectly clean meta-set can still be challenging in certain niche domains.

Summary updated

BibTeX
@inproceedings{chen2021generalized,
  author = {Can Chen and Shuhao Zheng and Xi Chen and Erqun Dong and Xue Liu and Hao Liu and Dejing Dou},
  title = {{Generalized DataWeighting via Class-Level Gradient Manipulation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=xRrdX_wV1JI},
}
Figure