Rethinking Importance Weighting for Deep Learning under Distribution Shift

Tongtong Fang, Nan Lu, Gang Niu, Masashi Sugiyama

Introduction

Standard importance weighting (IW) is a cornerstone technique for addressing distribution shift, where training data differs from test data. However, its application in deep learning is hindered by a fundamental "circular dependency": accurate weight estimation requires high-quality features, yet training a high-quality feature extractor under shift requires accurate weights. This paper introduces Dynamic Importance Weighting (DIW), an end-to-end framework that breaks this loop by co-evolving weights and features.

The Circular Dependency Problem

In distribution shift scenarios, IW assigns weights to training samples based on their relevance to the test distribution. While effective for linear models, deep learning faces a challenge:

  1. Feature Extraction for Weighting: To estimate weights for complex data (e.g., images), one must map inputs to a feature space.
  2. Weighting for Feature Extraction: To train a robust feature extractor on shifted data, one needs weights to mitigate bias.

Pre-training a feature extractor on unweighted, shifted data often results in a biased representation, which subsequently leads to poor weight estimation. This creates a "chicken-and-egg" problem that limits the effectiveness of static weighting methods.

Dynamic Importance Weighting (DIW)

DIW addresses this by integrating weight estimation (WE) and weighted classification (WC) into a unified, iterative loop. Instead of a sequential pipeline, DIW updates the model and the weights simultaneously.

The DIW framework compared to static importance weighting (SIW). DIW utilizes a circular update loop where the feature extractor and importance weights co-evolve.

Key Components

  • Deep Feature Transformation: DIW uses the network's own hidden layers or loss values as features for weight estimation. Using loss values is particularly efficient as it reduces high-dimensional data to a single scalar that encapsulates model performance.
  • Kernel Mean Matching (KMM): A distribution-matching technique used to find weights that align the training and test distributions in a high-dimensional feature space.
  • The Iterative Loop: In each training step, the algorithm fixes the model to compute weights via a small validation set, then fixes the weights to update the model parameters (both the classifier and the feature extractor).

Experimental Evaluation

The framework was tested on Fashion-MNIST, CIFAR-10, and CIFAR-100 under two shift conditions: label noise (corrupting training labels) and class-prior shift (altering class proportions between training and test sets).

DIW demonstrated a unique "denoising" capability. By matching training data to a clean validation set, it naturally assigns near-zero weights to mislabeled samples, effectively filtering out noise during training. This allows the model to ignore corrupted data that does not match the target distribution.

Results and Discussion

DIW consistently outperformed baseline methods, including standard IW and modern reweighting schemes, across all datasets and shift types.

Test accuracy curves over 400 epochs for three datasets under varying noise levels. DIW (blue line) shows superior stability and final accuracy compared to baselines.

On CIFAR-10 with 40% symmetric noise, DIW achieved 80.40% accuracy, compared to 44.31% for standard IW. In class-prior shift experiments on Fashion-MNIST, DIW reached 84.02% accuracy, nearly matching the theoretical "Truth" baseline of 83.29% which uses actual distribution ratios.

Conclusion

Dynamic Importance Weighting provides a robust solution for deep learning under distribution shift by breaking the circular dependency between feature learning and weight estimation. While it requires a small amount of clean validation data and introduces minor computational overhead, its ability to co-evolve weights and features leads to significantly improved generalization and noise robustness.

Summary updated

BibTeX
@inproceedings{fang2020rethinking,
  author = {Tongtong Fang and Nan Lu and Gang Niu and Masashi Sugiyama},
  title = {{Rethinking Importance Weighting for Deep Learning under Distribution Shift}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=rEcwWjg7U_4},
}
Figure