Bridging the Gap between Continual Learning and Test-Time Adaptation with Domain Preview
Abstract
Domain shift is a major problem for training machine learning models. While Continual Learning (CL) assumes distribution shift during training and Continual Test-Time Adaptation (CTTA) considers new domains at test time, setups that require explicit online adaptation to domain shift during both phases remain under-explored. We propose continual learning with domain preview (CL-P), a new combination of CL and TTA where both train and test data suffer from distribution shift. The training phase of CL-P is analogous to domain-incremental learning while the testing phase consists of a TTA phase on a future domain (which we call preview), and an evaluation phase on all seen domains. The model must then adapt to new domains at train and test time. In this paper, we evaluate mainstream CL and TTA methods that adapt only at train or test time, as well as their naive combination. Experimentally, TTA heavily damages the domain on which the CL method has just trained and increases forgetting. Notably, this damage mostly comes from the BatchNorm statistics shared by all domains. In that sense, we propose DOSE (Dosing by Online Statistics of Each domain), which allows a seamless combination of any CL and TTA methods by adaptive domain inference at test time, where the adaptation is applied to each image in proportion to the probability that it comes from the preview domain. Through extensive experiments with ResNet and ViT backbones, various combinations of CL and TTA baseline methods and datasets considering diverse domains, we show that DOSE matches or improves on CL methods alone in all 24 settings and on the naive combination in all but one. The code can be found in appendix.
- Comment
- 37 pages, 4 figures