Home

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:

Dataset

Pretraining

  1. 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
  1. 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

  1. 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>
  1. 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>
  1. Change detection, e.g.,
cd transfer_detection
python train.py --backbone resnet --dataset cdd --mode pis-r50