
# Adapting ImageNet-scale models to complex distribution shifts with self-learning

Evgenia Rusak*
University of Tübingen & IMPRS-IS
Steffen Schneider*
University of Tübingen & IMPRS-IS & Amazon (internship)
Peter Gehler
Amazon Tübingen
Oliver Bringmann
University of Tübingen
Wieland Brendel
University of Tübingen
Matthias Bethge
University of Tübingen

#### Code

tl;dr: Test-time adaptation with self-learning improves robustness of large-scale computer vision models on ImageNet-C, -R, and -A.

### News

 May '21 We released a first reference implementation of robust pseudo-labeling. Stay tuned for the full code release. April '21 The pre-print is now available on arXiv: arxiv.org/abs/2104.12928 April '21 A preliminary version of the paper was selected for a contributed talk at the ICLR Workshop on Weakly Supervised Learning. The talk titled "Better adaptation to distribution shifts with Robust Pseudo-Labeling" along with a Q&A on Zoom is scheduled for May 7, 2021, 12:30 PDT/21:30 CEST. Tune in!

### Abstract

While self-learning methods are an important component in many recent domain adaptation techniques, they are not yet comprehensively evaluated on ImageNet-scale datasets common in robustness research. In extensive experiments on ResNet and EfficientNet models, we find that three components are crucial for increasing performance with self-learning: (i) using short update times between the teacher and the student network, (ii) fine-tuning only few affine parameters distributed across the network, and (iii) leveraging methods from robust classification to counteract the effect of label noise. We use these insights to obtain drastically improved state-of-the-art results on ImageNet-C (22.0% mCE), ImageNet-R (17.4% top1 error) and ImageNet-A (14.8% error). Our techniques yield further improvements in combination with previously proposed robustification methods. Self-learning is able to reduce the top-1 error to a point where no substantial further progress can be expected. We therefore re-purpose the dataset from the Visual Domain Adaptation Challenge 2019 and use a subset of it as a new robustness benchmark (ImageNet-D) which proves to be a more challenging dataset for all current state-of-the-art models (58.2% error) to guide future research efforts at the intersection of robustness and domain adaptation on ImageNet scale.

Robust pseudo labeling (RPL) achieves a new state of the art on ImageNet-C, ImageNet-A and ImageNet-P across various model architectures.

### Contributions

1. We obtain state-of-the-art adaptation performance on all common robustness datasets (IN-C: 22.0% mCE, IN-A: 14.8% top-1 error, IN-R: 17.4% top-1 error) and improve upon existing strategies for increasing model robustness for all tested model types.
2. We find that self-learning with short update intervals and a limited number of both adaptable and distributed parameters is crucial for success. We leverage label noise robustness methods to enable adaptation with hard labels and a limited number of images, a problem not typically present in smaller scale domain adaptation.
3. Given the huge performance boost on all robustness datasets, we re-purpose the closest candidate to an ImageNet-scale domain adaptation dataset---the dataset used in the Visual Domain Adaptation Challenge 2019---and propose a subset of it as an additional robustness benchmark for the robustness community. We refer to it as ImageNet-D.

### Key Experiments

We build on the paradigm for robustness evaluation considered in our previous work: Assuming access to unlabeled test samples for adapting ImageNet-trained computer vision models. In this work, we use various forms of self-learning for adapting the models. We test pseudo labeling approaches with "hard" and "soft" labels, along with entropy minimization and a variant of hard-pseudolabling which uses the generalized cross entropy loss. Model selection is entirely done on the development (or holdout) corruptions in ImageNet-C:
Model selection is done on the four dev corruptions in ImageNet-C (left). We use the resulting hyperparameters to evaluate models on the ImageNet-C test set, ImageNet-A and ImageNet-R.
Self-learning enables further improvements across various model architectures. Notably, in contrast to test-time adaptation of batch norm parameters, the technique works for large scale models pre-trained on datasets like IG-3.5 and JFT300M.
mCE (lower is better) ImageNet-C in %. Entropy minimization (ENT) and pseudo-labeling paired with a robust loss function (RPL) reduce the mean Corruption Error (mCE) on IN-C for different models. We report the dev score on the holdout corruptions that were used for hyper-parameter tuning and the "test" score on the 15 test corruptions, evaluated with the best hyper-parameters found on the dev set. We compare vanilla trained (Baseline) and the best known robust variants of different architectures. *) For the EfficientNet-L2 model, we evaluate the mCE on dev on the severities [1,3,5] to save computational resources. For the ResNet50 model, we show results averaged over three seeds as "mean (unbiased std)".
Refer to the table in the intro as well as the full papers for results on ImageNet-A and ImageNet-R.

### ImageNet-D: A new challenging robustness benchmark

We propose a subset of the dataset from the Visual Domain Adaptation Challenge 2019 as an additional robustness benchmark. We only consider the subset of the original dataset whose classes can be mapped to ImageNet classes to enable an off-the-shelf evaluation of ImageNet trained models.

Overview of six domains in ImageNet-D. The dataset is a filtered version of the VisDa dataset common in domain adaptation research. To make the dataset easy to use in a context similar to other robustness datasets, we filtered and remapped the original VisDa dataset onto ImageNet labels.

Our best model the Noisy Student EfficientNet-L2 model performs considerably worse on this dataset compared to the other robustness benchmarks, making this dataset an interesting future benchmark for the robustness community!

### Implementation

Robust pseudo-labeling is conceptually easy to implement. Notably, the best performing variant does not require to cache any values and computes the pseudo-labels on the fly. Have a look at our reference implementation.

### BibTeX

@article{rusak2021selflearning,
author = {
Rusak, Evgenia. and
Schneider, Steffen and
Gehler, Peter and
Bringmann, Oliver and
Brendel, Wieland and
Bethge, Matthias
},
title = {