CONTRAST: Continual Multi-source Adaptation to Dynamic Distributions

Sk Miraj Ahmed, Fahim Faisal Niloy, Xiangyu Chang, Dripta S. Raychaudhuri, Samet Oymak, Amit K. Roy-Chowdhury

TL;DR

This paper introduces CONTRAST, a novel method for adapting multiple pre-trained models to continuously changing data distributions during test time, even with limited data batches and no access to original training data. CONTRAST intelligently combines these models and selectively updates only the most relevant ones, achieving robust performance and mitigating "catastrophic forgetting."

What Problem Does This Paper Address?

In real-world applications like autonomous navigation, machine learning models often encounter data distributions that shift over time. Traditional methods struggle when this dynamic test data arrives in small, sequential batches and the original source data is unavailable (due to privacy or storage constraints). This scenario makes it difficult to adapt a single model effectively without forgetting previously learned information. Existing domain adaptation techniques often require access to source data or large amounts of target data for offline training, which isn't feasible in these dynamic, streaming scenarios.

Methods

CONTRAST tackles this by employing a multi-source ensemble approach. Its core innovations are:

  1. Optimal Combination Weights: It dynamically learns the best weights to combine multiple pre-trained source models for each incoming test batch. This is achieved by minimizing the expected Shannon entropy of the pseudo-labels generated by the weighted ensemble.
  2. Selective Model Update: Instead of updating all source models, CONTRAST identifies the single source model that is most correlated with the current test batch (based on the learned combination weights) and updates only that model. This selective update strategy is crucial for preventing "catastrophic forgetting" of source knowledge.

The method also incorporates theoretical insights and practical optimizations, such as using batch statistics for initialization and an approximate Newton's method for efficient step-size selection.

Datasets

The authors evaluate CONTRAST on several benchmark datasets:

  • Static Target Distribution:
    • Digits (MNIST-M, MNIST, USPS, SVHN, Synthetic Digits)
    • Office-Home (Art, Clipart, Product, Real-World)
  • Dynamic Target Distribution:
    • CIFAR-100C (using Snow, Fog, Frost corruptions)
    • CIFAR-10C (similar to CIFAR-100C)
    • ACDC (for semantic segmentation, using Fog, Rain, Snow, Night conditions)

Key Insights and Ideas

  • Ensembling is Powerful, but Needs Intelligence: Simply averaging models (like Model Soups) or using fixed weights doesn't work well when source domains are diverse. CONTRAST shows that dynamically learning optimal weights is key.
  • Targeted Updates Prevent Forgetting: The most surprising and impactful finding is that updating only the most relevant source model (based on its correlation to the current test data) is more effective at preventing catastrophic forgetting than updating all models or even a subset. This is a counter-intuitive but empirically validated insight.
  • Leveraging Source Diversity: By combining multiple diverse source models, CONTRAST can adapt to a wider range of unseen distributions than any single source model could alone.
  • Practicality Matters: The method is designed for streaming data and no source data access, making it highly relevant for real-world applications.

Key Results

  • Superior Performance: CONTRAST consistently outperforms individual "best source" models (even with hindsight) and single-source adaptation baselines (Tent, CoTTA, EaTA) across various datasets and tasks. For example, on CIFAR-100C, CONTRAST achieved error rates around 37.1% (Tent+CONTRAST) compared to Tent-Best at 68.2%.
  • Robustness to Forgetting: The method demonstrates significantly less performance degradation on source test sets after adaptation compared to single-source methods. Figure 3 shows CONTRAST maintaining high accuracy, while baselines decline sharply.
  • Efficiency: The selective update strategy and optimized weight learning contribute to efficient adaptation.

Limitations and Future Work

  • Batch Assumption: The current method assumes that data within a single batch comes from the same distribution.
  • Future Work: The authors suggest exploring scenarios where batches might contain mixed data samples from different target domains. They also plan to investigate further into optimizing the combination weights and model updates.

Summary updated

BibTeX
@inproceedings{ahmed2024contrast,
  author = {Sk Miraj Ahmed and Fahim Faisal Niloy and Xiangyu Chang and Dripta S. Raychaudhuri and Samet Oymak and Amit K. Roy-Chowdhury},
  title = {{CONTRAST: Continual Multi-source Adaptation to Dynamic Distributions}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=0Ym37ElozF},
}
Figure