Awesome
Codes for “Pretrain A Remote Sensing Foundation Model by Promoting Intra-instance Similarity"
This is a code demo for the paper: Pretrain A Remote Sensing Foundation Model by Promoting Intra-instance Similarity.
we have realsed our pre-trained PIS models and related materials:
- PIS-R50-IV16-E30-b128+SP & PIS-SwinB-IV16-E30-B48+SP. See Baidu Netdisk [Code: PIS1] & Google Drive
- Codes for pretraining
- Codes for downstream fine-tuning
- Scene classification
- Semantic segmentation
- Change detection
Dataset
- Pretraining dataset: the compressed 8-bit RGB-version SSL4EO-S12 dataset. The CSV files used for codes of pretraining are available in above netdisk links.
- Downstream datasets:
- Scene classification: UC Merced (UCM), Aerial image dataset (AID), PatternNet, NWPU-RESISC45 (NR) and EuroSAT (RGB version).
- Semantic segmentation: DLRSD, ISPRS Potsdam, LoveDA.
- Change detection: CDD.
Pretraining
- Pretrain with ResNet-50 backbone.
OMP_NUM_THREADS=1 CUDA_VISIBLE_DEVICES='0,1,2,3,4,5' python pretrain.py --arch resnet50 --bs 128 --lr 0.3 --epoch 30 --data SSL4EO_RGB_MIX --num_var 16 --tcr 1 --var_sim 400
- Pretrain with Swin Transforemr-Base backbone.
OMP_NUM_THREADS=1 CUDA_VISIBLE_DEVICES='0,1,2,3,4,5' python pretrain.py --arch swin_b --bs 48 --lr 3e-4 --epoch 30 --data SSL4EO_RGB_MIX --num_var 16 --tcr 4 --var_sim 200
Fine-tuning
- Scene classification, e.g.,
cd transfer_classification
OMP_NUM_THREADS=1 CUDA_VISIBLE_DEVICES='0' python finetune.py --arch resnet50 --bs 12 --lr 5e-4 --epoch 100 --data ucm --num_var 16 --num_sampels 5 --model_path <your pretrained model path>
- Semantic segmentation, e.g.,
cd transfer_segmentation
OMP_NUM_THREADS=1 CUDA_VISIBLE_DEVICES='0' python seg_upernet.py --arch swin_b --bs 8 --lr 2e-4 --epoch 100 --data potsdam --tr 0.01 --model_path <your pretrained model path>
- Change detection, e.g.,
cd transfer_detection
python train.py --backbone resnet --dataset cdd --mode pis-r50