The following datasets are used for evaluation in this challenge
- miniImageNet
-
EuroSAT:
-
ISIC2018:
Home: http://challenge2018.isic-archive.com
Direct (must login): https://challenge.kitware.com/#phase/5abcbc6f56357d0139260e66
-
Plant Disease:
Home: https://www.kaggle.com/saroz014/plant-disease/
Direct: command line
kaggle datasets download -d plant-disease/data
-
ChestX-Ray8:
Home: https://www.kaggle.com/nih-chest-xrays/data
Direct: command line
kaggle datasets download -d nih-chest-xrays/data
Python 3.6
Pytorch 1.3
-
Download the datasets for evaluation (EuroSAT, ISIC2018, Plant Disease, ChestX-Ray8) using the above links.
-
Download miniImageNet using https://drive.google.com/file/d/1uxpnJ3Pmmwl-6779qiVJ5JpWwOGl48xt/view?usp=sharing
-
Unzip all dataset file and move them to the same directory
DATA_PATH
. Change configuration file./datasets/configs.py
to set the correctDATA_PATH
. -
Resize images and package them into tensors.
python ./datasets/process.py
-
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
-
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.