Skip to content

ctrlovefly/SFMT-UDA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

SFMT-UDA

This repository hosts the code for the SFMT-UDA model which is a novel two-stage Source-free Multi-target Unsupervised Domain Adaptation framework for cross-city LCZ classification.

Usage

Install

  • python 3.9
  • pytorch 2.3.1+cu121
  • torchvision 0.18.1
  • others:opencv-python, tqdm, scipy, sklearn, matplotlib, seaborn

Train and test

  • Prepare dataset

    • Download VHRLCZ. Samples in VHRLCZ are organized in the ImageNet format (The data is stored in a root directory, with each category having a separate folder).
    • We generate some .txt files containing paths and labels using /SFMTDA/Stage1/Generate_list/readfile_LCZ.py.
      1. Replace the folder path in readfile_LCZ.py with the path where you placed the dataset.
      2. then run the script:
      python readfile_LCZ.py
      1. Copy the generated .txt files to /SFMTDA/Stage1/code/data/{dataset_name}.
  • For Stage 1

    1. Change the current directory to SFMTDA/Stage1/code/uda.
    2. Run the main script using:
    sh run.sh
  • For Stage 2,

    • Prepare pseudo labels for Stage 2

      1. Copy SFMTDA/Stage1/code/uda/ckps/target/uda/{dataset_name} to the /SFMTDA/Stage2/STDA_weights/STDA folder
      2. Change the current directory to /SFMTDA/Stage2
      3. Run the script:
      sh ./brige.sh
      1. The generated .csv is in ./csv_pseudo_labels
    • Run the main script using:

      sh ./MH_MTDA.sh
  • LCZ Mapping

    • Run the script:
      sh ./mapping.sh

VHRLCZ DATASET

The VHRLCZ dataset consists of two components: Jilin-1 satellite imagery and Google Earth imagery. It is primarily designed for fine-grained LCZ classification and cross-city domain adaptation research. The dataset can be accessed via Google Drive files.

  1. Google Earth Imagery: The Google Earth imagery in VHRLCZ is sourced from the LCZC-GES2 dataset (refer to our previous work). We selected Google Earth RGB images from LCZC-GES2 that cover seven cities in southeastern China: Guangzhou, Hefei, Hong Kong, Nanchang, Nanjing, Shanghai, and Wuhan. In total, there are 18,936 image patches, each measuring 320 × 320 pixels with a spatial resolution of 1 meter.

  2. Jilin-1 Imagery: We acquired Jilin-1 scene-framed products from Chang Guang Satellite Technology Co., Ltd. These images have a spatial resolution of 0.5 meters and cover areas in two Chinese cities: Guangzhou and Changsha. The imagery was manually labeled using digital polygons, following the detailed decision-rule workflow proposed by Kim et al. (2021) and our newly developed workflow.

    Our workflow is:
    My Image

    Based on these labels, we extracted 5,667 RGB image patches, each measuring 640 × 640 pixels.

Latest Updates

  • [2025/03/07]: Uploaded a batch of code, including the implementation of SFMT-UDA.
  • [2025/07/03]: Uploaded some checkpoints. Please refer to link.

Citation

If you use this code in your research, please consider citing the following paper:

@ARTICLE{11185121,
  author={Wu, Qianqian and Liu, Yinhe and Zhong, Yanfei and Lin, Kexin and Ma, Xianping and Pun, Man-On},
  journal={IEEE Transactions on Geoscience and Remote Sensing}, 
  title={Source-free Multi-target Unsupervised Domain Adaptation for Cross-City Local Climate Zone Classification}, 
  year={2025},
  volume={},
  number={},
  pages={1-1},
  keywords={Adaptation models;Urban areas;Data models;Remote sensing;Meteorology;Training;Labeling;Supervised learning;Feature extraction;Land surface;Local Climate Zone classification;multi-target domain adaptation;source-free domain adaptation;Very High Resolution imagery},
  doi={10.1109/TGRS.2025.3615979}}

Acknowledgments

This project is inspired by and builds upon the work from:

We sincerely appreciate their contributions to this research area.

Contact

For any inquiries or further information, please contact me.

Other Works

There are some other works in our group:

SSRS

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages