TTAC++ on ImageNet under common corruptions.
-
To install requirements:
pip install -r requirements.txt
-
To download dataset:
We need to firstly download the validation set and the development kit (Task 1 & 2) of ImageNet-1k on here, and put them under
data
folder.The structure of the
data
folder should be likedata |_ ILSVRC2012_devkit_t12.tar |_ ILSVRC2012_img_val.tar
-
To create the corruption dataset
python utils/create_corruption_dataset.py
The issue
Frost missing after pip install
can be solved following here.Finally, the structure of the
data
folder should be likedata |_ ILSVRC2012_devkit_t12.tar |_ ILSVRC2012_img_val.tar |_ val |_ n01440764 |_ ... |_ corruption |_ brightness.pth |_ contrast.pth |_ ... |_ meta.bin
Here, we use the pretrain model provided by torchvision.
We mainly conduct our experiments under the sTTT (N-O) protocol, which is more realistic and challenging.
-
run TTAC++ on ImageNet-C under the sTTT (N-O) protocol.
bash scripts/run_ttac2_no.sh
The following results are yielded by the above script (classification errors) under the snow corruption:
Method ImageNet-C (Level 5) Test 82.22 TTAC 44.56 TTAC++ 43.40 -
run TTAC on ImageNet-C under the N-O-SF without any source information including source statistics collected from training set.
Note: In this work, we endeavor to mitigate the dependence of previous work on source statistics from training set. We derive the approximated source domain distribution via gradient descent as implemented in
utils/find_prototypes.py
.bash scripts/run_ttac2_no_sf.sh
The following results are yielded by the above script (classification errors) under the snow corruption:
Method ImageNet-C (Level 5) Test 82.22 TTAC++ 43.60