Skip to content
/ UemDA Public

The official PyTorch implementation of "Uncertain Example Mining Network for Domain Adaptive Remote Sening Image Segmentation."

Notifications You must be signed in to change notification settings

StuLiu/UemDA

Repository files navigation

Uncertain Example Mining Network for Domain Adaptive Segmentation of Remote Sensing Images

paper
by Wang Liu, Puhong Duan, Zhuojun Xie, Xudong Kang, and Shutao Li

Fig. 1 An overview of the proposed UemDA.

Getting Started

Environment:

  • conda create -n uemda python=3.8
  • source activate uemda
  • pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
  • conda install pytorch-scatter -c pyg
  • pip install ever-beta
  • pip install -r requirement.txt
  • pip install -e .

Prepare datasets

  • Download the raw datasets here.
  • Run the preprocess script in ./convert_datasets/ to crop train, val, test sets:
    python convert_datasets/convert_potsdam.py
    python convert_datasets/convert_vaihingen.py
  • The prepared data is formatted as follows:
    ./data
    ---- IsprsDA
         ---- Potsdam
              ---- ann_dir
              ---- img_dir
         ---- Vaihingen
              ---- ann_dir
              ---- img_dir\
  • Generate local regions by run
    python tools/generate_superpixels.py

Train the UemDA

bash runs/uemda/run_2potsdam.sh
bash runs/uemda/run_2vaihingen.sh

Evaluate the trained UemDA models.\

1. on Vaihingen (IRRG) -> Potsdam (IRRG) task

Run evaluating: python tools/eval.py --config-path st.uemda.2potsdam --ckpt-path log/uemda/2potsdam/ssl/Potsdam_best.pth --test 1

2. on Potsdam (IRRG) -> Vaihingen (IRRG) task

Run evaluating: python tools/eval.py --config-path st.uemda.2vaihingen --ckpt-path log/uemda/2vaihingen/ssl/Vaihingen_best.pth --test 1

Inference single file

python tools/infer_single.py st.uemda.2potsdam log/uemda/ssl/Potsdam_best.pth [image-path] --save-dir [save-dir-path]
@ARTICLE{10666777,
  author={Liu, Wang and Duan, Puhong and Xie, Zhuojun and Kang, Xudong and Li, Shutao},
  journal={IEEE Transactions on Geoscience and Remote Sensing}, 
  title={Uncertain Example Mining Network for Domain Adaptive Segmentation of Remote Sensing Images}, 
  year={2024},
  volume={62},
  pages={1-14},
  doi={10.1109/TGRS.2024.3443071}
}

About

The official PyTorch implementation of "Uncertain Example Mining Network for Domain Adaptive Remote Sening Image Segmentation."

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published