Take Me Home: Reversing Distribution Shifts using Reinforcement Learning

Vivian Lin, Kuk Jin Jang, Souradeep Dutta, Michele Caprio, Oleg Sokolsky, Insup Lee · OpenReview

Abstract

Deep neural networks have repeatedly been shown to be non-robust to the uncertainties of the real world. Even subtle adversarial attacks and naturally occurring distribution shifts wreak havoc on systems relying on deep neural networks. In response to this, current state-of-the-art techniques use data-augmentation to enrich the training distribution of the model and consequently improve robustness to natural distribution shifts. We propose an alternative approach that allows the system to recover from distribution shifts online. Specifically, our method applies a sequence of semantic-preserving transformations to bring the shifted data closer in distribution to the training set, as measured by the Wasserstein distance. We formulate the problem of sequence selection as an MDP, which we solve using reinforcement learning. To aid in our estimates of Wasserstein distance, we employ dimensionality reduction through orthonormal projection. We provide both theoretical and empirical evidence that orthonormal projection preserves characteristics of the data at the distributional level. Finally, we apply our distribution shift recovery approach to the ImageNet-C benchmark for distribution shifts, targeting shifts due to additive noise and image histogram modifications. We demonstrate an improvement in average accuracy up to 14.21% across a variety of state-of-the-art ImageNet classifiers.

Introduction

Deep Neural Networks (DNNs) are notoriously brittle. A model trained on clear daytime photos might fail significantly when faced with environmental changes like snow, fog, or digital noise—phenomena known as distribution shifts. Traditionally, researchers address this during training via data augmentation, exposing the model to various corruptions. However, predicting every possible real-world corruption is impossible.

This paper introduces SuperStAR (Supervisory system for Shift Adaptation and Recovery), which shifts the focus from making the model "invincible" to making the data "cleaner." SuperStAR acts as a supervisor that identifies when data has drifted and applies a sequence of fixes to push that data back toward the distribution the model was originally trained on—its "comfort zone."

SuperStAR architecture and recovery process

Methods

The authors frame distribution recovery as a Markov Decision Process (MDP) solved using Reinforcement Learning. The system consists of several key components:

  1. Reinforcement Learning Policy: An RL agent observes the state of a batch of images (using features like brightness, entropy, and wavelet transforms) and selects actions from a library of semantic-preserving transforms, such as denoising or histogram equalization.
  2. Wasserstein Distance & Dimensionality Reduction: To evaluate the effectiveness of an action, the system measures the "distance" between the corrupted data and the original training data. To handle high-dimensional image space efficiently, they employ orthonormal projection (Cai-Lim projection) to reduce dimensions while preserving distributional characteristics.
  3. Reward Function: The agent is rewarded for reducing the Wasserstein distance while maintaining Structural Similarity (SSIM), ensuring the image's original meaning is preserved.
  4. Operability Check: A binary classifier determines if a shift is "operable." If the data is too corrupted to be fixed, the system refrains from acting to avoid further degradation.
Step-by-step image recovery using sequential transformations

Key Insights

  • Modular Supervision: SuperStAR sits in front of the classifier. This modularity allows it to be applied to existing state-of-the-art models without retraining them or accessing their internal weights.
  • Generalization via Surrogates: Although trained on simple "surrogate" corruptions, the RL policy successfully generalized to complex shifts in ImageNet-C, suggesting universal principles in reversing distribution shifts.
  • Distributional Preservation: Theoretical evidence shows that orthonormal projection preserves the relative ranking of distributions, ensuring that distance measurements in lower dimensions remain meaningful.

Results

The researchers evaluated SuperStAR on standard benchmarks including ImageNet-C and CIFAR-100-C:

  • Accuracy Gains: On ImageNet-C, SuperStAR improved the average accuracy of ResNet-50 classifiers by up to 14.21%.
  • Composite Shifts: For multi-layered corruptions (e.g., noise plus contrast shift), it achieved improvements of up to 9.81%.
  • Cross-Dataset Success: CIFAR-100-C saw boosts of up to 8.25%.
  • Synergy: The method provides additional performance gains even when paired with models already using advanced data augmentation like AugMix.

Conclusion and Future Work

While effective, SuperStAR's performance depends on its library of transformations. Future work includes expanding this "toolbox" to handle geometric distortions and optimizing for real-time, single-frame inference to reduce latency. Additionally, refining the operability classifier will enhance robustness against diverse real-world perturbations.

Summary updated

BibTeX
@inproceedings{lin2024take,
  author = {Vivian Lin and Kuk Jin Jang and Souradeep Dutta and Michele Caprio and Oleg Sokolsky and Insup Lee},
  title = {{Take Me Home: Reversing Distribution Shifts using Reinforcement Learning}},
  booktitle = {L4DC},
  year = {2024},
}
Figure