/cvprw2020-soft-pseudo-label-teaching

Soft Pseudo-Label Teaching for Cross-Domain Few-shot Learning (CD-FSL)

Primary LanguagePython

Soft Pseudo-Label Teaching for Cross-Domain Few-shot Learning

Datasets

The following datasets are used for evaluation in this challenge

Source domain:

  • miniImageNet

Target domains:

Enviroment

Python 3.6

Pytorch 1.3

Steps

  1. Download the datasets for evaluation (EuroSAT, ISIC2018, Plant Disease, ChestX-Ray8) using the above links.

  2. Download miniImageNet using https://drive.google.com/file/d/1uxpnJ3Pmmwl-6779qiVJ5JpWwOGl48xt/view?usp=sharing

  3. Unzip all dataset file and move them to the same directory DATA_PATH. Change configuration file ./datasets/configs.py to set the correct DATA_PATH.

  4. Resize images and package them into tensors.

    python ./datasets/process.py 
  5. Train base models on miniImageNet. In order to reproduce the results of the paper, you need to train all backbones (ResNet10, ResNest101s1N, ResNest102s1N, ResNest102s2N) with four different data augmentation (DefaultAug, HardAug, DefaultAug+RandomGrayScale, HardAug+RandomGrayScale). Name the last checkpoint in a specific way and move it to the MODEL_DIR folder. Or you can download our pre-trained models using https://drive.google.com/file/d/1qWP_iApavc35XK4q3uyAZS9h3_d2_ooc/view?usp=sharing.

    ResNet10 + DefaultAug, name last checkpoint ResNet10_399.tar

        python ./train.py --model ResNet10 --save_dir SAVE_DIR

    ResNes101s1N + HardAug, name last checkpoint ResNest101s1NCJ_399.tar

        python ./train.py --model ResNest101s1N --imagejitter 0.8 --save_dir SAVE_DIR

    ResNes102s2N + HardAug + GrayScale, name last checkpoint ResNest102s2NCJG50_399.tar

        python ./train.py --model ResNest102s1N --imagejitter 0.8 --grayscale --save_dir SAVE_DIR
  6. Test on different datasets (ISIC: 0, EuroSAT: 1, CropDiseases: 2, ChestX: 3).

    Finetune “SPLT-1Model” on the ISIC dataset:

        python ./finetune.py --n_shot 5 --dataset_names 0 --model_list 0 --model_dir MODEL_DIR

    Finetune “SPLT-4Model” on the ChestX dataset:

        python ./finetune.py --n_shot 5 --dataset_names 3 --model_list 0 1 2 3 --model_dir MODEL_DIR

    Finetune “SPLT-8Model” on the EuroSAT dataset:

        python ./finetune.py --n_shot 5 --dataset_names 1 --model_list 0 1 2 3 4 5 6 7 --model_dir MODEL_DIR

    In our default setting, the number of GPUs should not be less than the number of models. You may be able to avoid this problem by setting params.device_list, but we haven't verified it.

References