Home

Awesome

DUA: Dynamic Unsupervised Adaptation (CVPR 2022)

This is the official repository for our paper: The Norm Must Go On: Dynamic Unsupervised Domain Adaptation by Normalization

DUA is an extremely simple method which only adapts the (1st and 2nd order) statistics of the Batch Normalization layer in an online manner to adapt to the out-of-distribution test data at test-time. Adapting only the statistics for Unsupervised Domain Adaptation makes DUA extremely fast and computation efficient. Moreover, DUA requires less than 1% of data from the target domain and no back propagation to achieve competitive (and often state-of-the-art) results when compared to strong baselines.

Short explanatory video about DUA is hosted here.

Installation

  1. git clone this repository.
  2. pip install -r requirements.txt to install required packages

Running Experiments

Before starting with running the experiments, please prepare the datasets through the instructions listed here.

We provide code for reproducing CIFAR-10C / ImageNet-C / KITTI results. These experiments can be run through the following example commands.

CIFAR-10C (WRN-40-2)

For running this experiment first download the AugMix pre-trained WRN-40-2 Checkpoint.

python main.py --dataset cifar10 --model wrn --ckpt_path path/to/checkpoint.pt --dataroot root/path/for/cifar-10C

WRN - Results Cifar10C (Level-5 Severity)

data samples usedmean errorgauss_noiseshot_noiseimpulse_noisedefocus_blurglass_blurmotion_blurzoom_blursnowfrostfogbrightnesscontrastelastic_transpixelatejpeg
source1000018.328.822.926.29.520.610.69.314.215.317.57.620.914.741.314.7
tent1000012.315.813.518.78.118.79.18.010.310.811.76.711.614.111.715.2
dua8012.115.413.417.38.018.09.17.710.810.812.16.610.913.613.014.3

ImageNet-C (ResNet-18)

python main.py --dataset imagenet --model res18 --dataroot root/path/for/imagenet-C

KITTI (YOLOv3)

python main.py --dataset kitti --dataroot root/path/for/kitti

This will first train the network on the original KITTI dataset and then adapt separately to Fog and Rain. The current hyper-parameters are set to the default values used in the DUA paper, to experiment with other settings please refer to main.py.

To cite us:

@InProceedings{mirza2022dua,
    author    = {Mirza, M. Jehanzeb and Micorek, Jakub and Possegger, Horst and Bischof, Horst},
    title     = {The Norm Must Go On: Dynamic Unsupervised Domain Adaptation by Normalization},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    year      = {2022}
}

Also read DISC, an extension of DUA - accepted at CVPR workshops.

@InProceedings{mirza2022disc,
    author    = {Mirza, M. Jehanzeb and Masana, Marc and Possegger, Horst and Bischof, Horst},
    title     = {An Efficient Domain-Incremental Learning Approach To Drive in All Weather Conditions},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops},
    year      = {2022}
}