Skip to content
woldierPublic

About

[Official Repo] Geoad: Towards Geospatial Foundation Models via Efficient Continual Pre-Training

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Geoad: Efficient Continual Pre-Training of Vision Foundation Models

for Optical Remote Sensing


Static Badge Static Badge Static Badge Static Badge
GitHub Issues or Pull Requests GitHub Issues or Pull Requests GitHub forks GitHub Repo stars


Geoad
Network Overview

πŸ”οΈπŸ”οΈ NEWS

  • [2025/11/05] ✨✨ Update Pre-Training && Classification Code.
  • [2025/11/17] ✨✨ Init Repo.

πŸ“„πŸ“„ TODO

  • ❎ submit to arxiv
  • ❎ upload training code
  • ❎ upload model weights

Clone Repo


We add mmpretrain, mmsegmentation, and open-cd as our repository submodule .

So, one should clone this repository use the script as follows:

clone repository
git clone --recurse-submodules https://github.com/woldier/Geoad

Tips

If one already cloned the project and forgot --recurse-submodules,

 # cloned the project and forgot clone submodules πŸ₯²πŸ₯²
 git clone https://github.com/woldier/Geoad 

 # initialize and update each submodule in the repository πŸ₯°πŸ₯°
 git submodule update --init

after that, we link

submodules/mmpretrain/mmpretrain $\to$ mmpretrain

submodules/mmsegmentation/mmseg $\to$ mmseg

submodules/open-cd/opencd $\to$ opencd :

soft link
ln -s sumodules/mmpretrain/mmpretrain/ mmpretrain
ln -s sumodules/mmsegmentation/mmseg/ mmseg
ln -s sumodules/open-cd/opencd/ opencd

1. Creating Virtual Environment


This repo use python-3.8, for nvcc -v with cuda >= 11.6.

torch 2.1.1, cuda 12.1, mmcv 2.1.0, mmengine 0.9.1

Install script
conda create -n  peft-mmpretrain  python==3.8 -y
conda activate peft-mmpretrain


pip install torch==2.1.2+cu121  torchvision==0.16.2+cu121 -f https://download.pytorch.org/whl/torch_stable.html
# for CN user use follow script
pip install torch==2.1.2+cu121  torchvision==0.16.2+cu121 -f https://mirrors.aliyun.com/pytorch-wheels/cu121/  

pip install mmcv==2.1.0 mmengine==0.9.1 -f https://download.openmmlab.com/mmcv/dist/cu121/torch2.1/index.html

pip install -r submodules/mmpretrain/mmpretrain/requirements/runtime.txt
pip install -r submodules/mmsegmentation/mmseg/requirements/runtime.txt
pip install -r submodules/open-cd/opencd/requirements/runtime.txt

Installation of the reference document refer:

Torch and torchvision versions relationship.

Official Repo CSDN

2. Initialization Checkpoints

Geoad relies on model weights from DINOv2 and MAE as an initialization to begin continual pre-training. We have organized them here for your convenience.

Model ViT-L
DINOv2 ViT-L/14
MAE ViT-L/16

3. Continual Pre-Training

3.1 Pre-training Dataset Preparation

Download the MillionAID dataset. The data structure should be as follows:

file structure
β”œβ”€β”€ data/MillionAID
β”‚   β”œβ”€β”€ train
β”‚   β”‚   β”œβ”€β”€ agriculture
β”‚   β”‚   β”‚   β”œβ”€β”€ arable_land
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ dry_field
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ P0011232.jpg
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ...
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ...
β”‚   β”‚   β”‚   β”œβ”€β”€ ...
β”‚   β”‚   β”œβ”€β”€ ...
β”‚   β”œβ”€β”€ test
β”‚   β”‚   β”œβ”€β”€ xxx.jpg
β”‚   β”‚   β”œβ”€β”€ xxx.jpg
β”‚   β”‚   β”œβ”€β”€ ...
β”‚   β”œβ”€β”€ ...

We use all the images in the training and test sets for pretraining.

3.2 Geoad Pre-training

To pre-train Geoad with multi-gpu distributed training, run the following on 1 nodes with 8 GPUs each:

pretraining script
# Geoad-DINOv2
tools/dist_train.sh config/geoad/frms_dinov2_vit-large-p14_8xb512-amp-coslr-100k_million-aid.py 8\
--launcher pytorch --auto-scale-lr

# Geoad-MAE
tools/dist_train.sh config/geoad/frms_mae_vit-large-p16_8xb128-amp-coslr-300e_million-aid.py 8\
--launcher pytorch --auto-scale-lr

4. Downstream Tasks

4.1 Sense Classification

4.1.1 Dataset Preparation

Dataset Link Split
NWPU-RESISC45 Link resisc45.zip
EuroSat (RGB) Link eurosat-split.zip
file structure
β”œβ”€β”€ data/NWPU-RESISC45
β”‚   β”œβ”€β”€ airplane
β”‚   β”‚   β”œβ”€β”€ airplane_001.jpg
β”‚   β”‚   β”œβ”€β”€ airplane_002.jpg
β”‚   β”‚   β”œβ”€β”€ ...
β”‚   β”œβ”€β”€ airport
β”‚   β”œβ”€β”€ ...
β”‚   β”œβ”€β”€ ratio_0.5_train.txt
β”‚   β”œβ”€β”€ ratio_0.5_test.txt
β”œβ”€β”€ data/EuroSAT_RGB
β”‚   β”œβ”€β”€ AnnualCrop
β”‚   β”‚   β”œβ”€β”€ AnnualCrop_1.jpg
β”‚   β”‚   β”œβ”€β”€ AnnualCrop_2.jpg
β”‚   β”‚   β”œβ”€β”€ ...
β”‚   β”œβ”€β”€ Forest
β”‚   β”œβ”€β”€ HerbaceousVegetation
β”‚   β”œβ”€β”€ ...
β”‚   β”œβ”€β”€ eurosat-train.txt
β”‚   β”œβ”€β”€ eurosat-test.txt
β”‚   β”œβ”€β”€ eurosat-val.txt

4.1.2 RESISC45

classification script
# 1. fine-tune
# Geoad-DINOv2
tools/dist_train.sh config/classification/resisc45/frms_dinov2_vit-large-p16_8xb128-coslr-100e_resics45.py 8\
--launcher pytorch --auto-scale-lr

# Geoad-MAE
tools/dist_train.sh config/classification/resisc45/frms_mae_vit-large-p16_8xb128-coslr-100e_resics45.py 8\
--launcher pytorch --auto-scale-lr


# 2. linear prob
# Geoad-DINOv2
tools/dist_train.sh config/classification/resisc45/frms_dinov2_vit-large-p16_8xb1024--linear-coslr-100e_resics45.py 8\
--launcher pytorch --auto-scale-lr

# Geoad-MAE
tools/dist_train.sh config/classification/resisc45/frms_mae_vit-large-p16_8xb1024--linear-coslr-100e_resics45.py 8\
--launcher pytorch --auto-scale-lr

4.1.2 EuroSat

classification script
# 1. fine-tune
# Geoad-DINOv2
tools/dist_train.sh config/classification/eurosat/frms_dinov2_vit-large-p16_8xb128-coslr-100e_eurosat.py 8\
--launcher pytorch --auto-scale-lr

# 2. linear prob
# Geoad-DINOv2
tools/dist_train.sh config/classification/eurosat/frms_dinov2_vit-large-p16_8xb1024-linear-coslr-100e_eurosat.py 8\
--launcher pytorch --auto-scale-lr

4.2 Semantic Segmentation

Coming Soon ...

4.3 Change Detection

Coming Soon ...

Acknowledgements

This project is built upon OpenMMLab. We thank the OpenMMLab developers.

Citation

If you use Geoad in your research, please cite:

@article{,
  title={},
  author={},
  journal={},
  year={}
}

About

[Official Repo] Geoad: Towards Geospatial Foundation Models via Efficient Continual Pre-Training

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages