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.
- python 3.9
- pytorch 2.3.1+cu121
- torchvision 0.18.1
- others:opencv-python, tqdm, scipy, sklearn, matplotlib, seaborn
-
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.
- Replace the folder path in
readfile_LCZ.pywith the path where you placed the dataset. - then run the script:
python readfile_LCZ.py
- Copy the generated .txt files to
/SFMTDA/Stage1/code/data/{dataset_name}.
- Replace the folder path in
-
For Stage 1
- Change the current directory to
SFMTDA/Stage1/code/uda. - Run the main script using:
sh run.sh
- Change the current directory to
-
For Stage 2,
-
Prepare pseudo labels for Stage 2
- Copy
SFMTDA/Stage1/code/uda/ckps/target/uda/{dataset_name}to the/SFMTDA/Stage2/STDA_weights/STDAfolder - Change the current directory to
/SFMTDA/Stage2 - Run the script:
sh ./brige.sh
- The generated
.csvis in./csv_pseudo_labels
- Copy
-
Run the main script using:
sh ./MH_MTDA.sh
-
-
LCZ Mapping
- Run the script:
sh ./mapping.sh
- Run the script:
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.
-
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.
-
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.
Based on these labels, we extracted 5,667 RGB image patches, each measuring 640 × 640 pixels.
- [2025/03/07]: Uploaded a batch of code, including the implementation of SFMT-UDA.
- [2025/07/03]: Uploaded some checkpoints. Please refer to link.
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}}
This project is inspired by and builds upon the work from:
We sincerely appreciate their contributions to this research area.
For any inquiries or further information, please contact me.
There are some other works in our group:
