/BuildingExtraction

SDSC-UNet and DSAT-Net (IEEE GRSL 2023)

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

BuildingExtraction

Introduction

This is the code for our papers:

R. Zhang, Q. Zhang and G. Zhang, "SDSC-UNet: Dual Skip Connection ViT-Based U-Shaped Model for Building Extraction," in IEEE Geoscience and Remote Sensing Letters, vol. 20, pp. 1-5, 2023, Art no. 6005005, doi: 10.1109/LGRS.2023.3270303.

PWC

PWC

R. Zhang, Z. Wan, Q. Zhang and G. Zhang, "DSAT-Net: Dual Spatial Attention Transformer for Building Extraction From Aerial Images," in IEEE Geoscience and Remote Sensing Letters, vol. 20, pp. 1-5, 2023, Art no. 6008405, doi: 10.1109/LGRS.2023.3304377.

PWC

PWC

Install

Open the folder airs using Linux Terminal and create python environment:

conda create -n airs python=3.8
conda activate airs

conda install pytorch==1.10.0 torchvision==0.11.0 torchaudio==0.10.0 cudatoolkit=11.3 -c pytorch -c conda-forge
pip install -r requirements.txt

DataPreprocess

We follow the BuildFormer to pre-process all the datasets.

❗❗❗ It should be noted that for the Massachusetts dataset (please download from here:Kaggle , there are actually two formats available after downloading: png and tif. The format used here is png! In addition, the generated images from BuildFormer are 1500x1500. As some of our model codes currently only support input sizes of 512x512, we need to use split_1500_to_512.py to process the images into 512x512.

Training

SDSCUNet:

python train_supervision.py -c ./config/inria/sdscunet.py
python train_supervision.py -c ./config/mass/sdscunet.py

DSATNet:

python train_supervision.py -c ./config/inria/dsatnet.py
python train_supervision.py -c ./config/mass/dsatnet.py

Testing

SDSCUNet:

python building_seg_test.py -c ./config/inria/sdscunet.py -o /home/results/inria/sdscunet --rgb -t 'lr'
python building_seg_test.py -c ./config/mass/sdscunet.py -o /home/results/mass/sdscunet --rgb -t 'lr'

DSATNet:

python building_seg_test.py -c ./config/inria/sdscunet.py -o /home/results/inria/dsatnet --rgb -t 'lr'
python building_seg_test.py -c ./config/mass/sdscunet.py -o /home/results/mass/dsatnet --rgb -t 'lr'

Citation

If you find this project useful in your research, please consider citing our papers:

  • R. Zhang, Q. Zhang and G. Zhang, "SDSC-UNet: Dual Skip Connection ViT-Based U-Shaped Model for Building Extraction," in IEEE Geoscience and Remote Sensing Letters, vol. 20, pp. 1-5, 2023, Art no. 6005005, doi: 10.1109/LGRS.2023.3270303.
@ARTICLE{10108049,
  author={Zhang, Renhe and Zhang, Qian and Zhang, Guixu},
  journal={IEEE Geoscience and Remote Sensing Letters}, 
  title={SDSC-UNet: Dual Skip Connection ViT-Based U-Shaped Model for Building Extraction}, 
  year={2023},
  volume={20},
  number={},
  pages={1-5},
  doi={10.1109/LGRS.2023.3270303}}

and:

  • R. Zhang, Z. Wan, Q. Zhang and G. Zhang, "DSAT-Net: Dual Spatial Attention Transformer for Building Extraction From Aerial Images," in IEEE Geoscience and Remote Sensing Letters, vol. 20, pp. 1-5, 2023, Art no. 6008405, doi: 10.1109/LGRS.2023.3304377.
@ARTICLE{10221771,
  author={Zhang, Renhe and Wan, Zhechun and Zhang, Qian and Zhang, Guixu},
  journal={IEEE Geoscience and Remote Sensing Letters}, 
  title={DSAT-Net: Dual Spatial Attention Transformer for Building Extraction From Aerial Images}, 
  year={2023},
  volume={20},
  number={},
  pages={1-5},
  doi={10.1109/LGRS.2023.3304377}}

Acknowledgement