{"id":13785027,"url":"https://github.com/justchenhao/SaDL_CD","last_synced_at":"2025-05-11T20:31:50.362Z","repository":{"id":65720720,"uuid":"534939898","full_name":"justchenhao/SaDL_CD","owner":"justchenhao","description":"Semantic-Aware Dense Representation Learning for Remote Sensing Image Change Detection","archived":false,"fork":false,"pushed_at":"2023-04-07T04:52:20.000Z","size":2052,"stargazers_count":35,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-17T21:39:14.063Z","etag":null,"topics":["change-detection","pretraining","representation-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/justchenhao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-09-10T08:38:15.000Z","updated_at":"2024-08-29T02:22:22.000Z","dependencies_parsed_at":"2024-01-15T00:11:50.719Z","dependency_job_id":"d117bde3-f82a-46ea-b29b-1cb48eed7ac7","html_url":"https://github.com/justchenhao/SaDL_CD","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"d78945a94e06f079137bbe0f2dc3302e7315783e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justchenhao%2FSaDL_CD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justchenhao%2FSaDL_CD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justchenhao%2FSaDL_CD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justchenhao%2FSaDL_CD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justchenhao","download_url":"https://codeload.github.com/justchenhao/SaDL_CD/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253632045,"owners_count":21939370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["change-detection","pretraining","representation-learning"],"created_at":"2024-08-03T19:00:55.386Z","updated_at":"2025-05-11T20:31:49.395Z","avatar_url":"https://github.com/justchenhao.png","language":"Python","funding_links":[],"categories":["Multispectral"],"sub_categories":["Deep Learning"],"readme":"# SaDL_CD\nHere, we provide the pytorch implementation of the paper: Semantic-Aware Dense Representation Learning for Remote Sensing Image Change Detection.\n\nFor more ore information, please see our published paper at [IEEE TGRS](https://ieeexplore.ieee.org/document/9874899/) or [arxiv](https://arxiv.org/abs/2205.13769). \n\n![overview](images/overview.png)\n\n## Requirements\n\n```\nPython 3.7\npytorch 1.10.1\ntorchvision 0.11.2\neinops  0.3.0\nkornia 0.6.3\n```\n\n## logs\n\n20230407： update the download link of the cropped Inria data.\n\n## Installation\n\nClone this repo:\n\n```shell\ngit clone https://github.com/justchenhao/SaDL_CD.git\ncd SaDL_CD\n```\n\n## Quick Start\n\nYou can simply run `python main_ssl.py` to train our model (`sadl_fpn_m2_resnet18_sample16_syn1`) on the given small samples (in the folder `samples`).\n\n## Training\n\nYou can find the training script `train_ssl.sh` in the folder `scripts`. You can run the script file by `sh scripts/train_ssl.sh` in the command environment.\n\nThe detailed script file `train_ssl.sh` is as follows:\n\n```shell\n#!/usr/bin/env bash\n\ngpus=0\n\ncheckpoint_root=checkpoints\ndataset_type=SegDataset\nimg_size=256\nbatch_size=64\noptim_mode=sgd\nlr_policy=poly\n\nlr=0.01\nmax_epochs=200\nnet_G=sadl_fpn_m2_resnet18_sample16_syn1\n\n\ndata_name=inria256\n\nsplit=pos0.1_train\nsplit_val=pos0.1_val\n\nproject_name=SSLM_${net_G}_${data_name}_b${batch_size}_lr${lr}_${split}_${split_val}_${max_epochs}_${lr_policy}_${optim_mode}\n\npython main_ssl.py --dataset_type ${dataset_type} --img_size ${img_size} --optim_mode ${optim_mode}  --checkpoint_root ${checkpoint_root} --lr_policy ${lr_policy} --split ${split} --split_val ${split_val} --net_G ${net_G} --gpu_ids ${gpus} --max_epochs ${max_epochs} --project_name ${project_name} --batch_size ${batch_size} --data_name ${data_name}  --lr ${lr}\n```\n\n## Dataset Preparation\n\n### Pretraining dataset\n\nWe leverage image-mask pairs from the existing Inria building segmentation dataset. We cut the original samples into small patches of size 256 × 256.  We additionally obtain the coregistered image patch of the corresponding geospatial region.\n\nThe original Inria building segmentation dataset can be found at: https://project.inria.fr/aerialimagelabeling/\n\nOur processed pretraining dataset can be accessed by Baidu yun (code: 2p1b): [link](https://pan.baidu.com/s/1ObAu_4Xm3SWCdMvAfiN7yw)\n\nNote that you need only the image-mask pairs in `A` and `label` to train our model. We also provide the spatially registered image of another temporal in `B` for possible usage. \n\n#### Data structure\n\n```\n\"\"\"\nThe pretraining data set with bitemporal images and building mask for one temporal. Note that the masks in the folder 'label' are aligned with the corresponding images in folder 'A'；\n├─A\n├─B\n├─label\n└─list\n\"\"\"\n```\n\n#### Data Download \n\n### Downstream Datasets\n\nWe test our pretrained model at three downstream change detection datasets.\n\n#### Data structure\n\n```\n\"\"\"\nChange detection data set with pixel-level binary labels；\n├─A\n├─B\n├─label\n└─list\n\"\"\"\n```\n\n#### Data Download \n\nLEVIR-CD: https://justchenhao.github.io/LEVIR/\n\nWHU-CD: https://study.rsgis.whu.edu.cn/pages/download/building_dataset.html\n\nGZ-CD: https://github.com/daifeng2016/Change-Detection-Dataset-for-High-Resolution-Satellite-Imagery\n\n## License\n\nCode is released for non-commercial and research purposes **only**. For commercial purposes, please contact the authors.\n\n## Citation\n\nIf you use this code for your research, please cite our paper:\n\n```\n@Article{chen2022,\n    title={Semantic-Aware Dense Representation Learning for Remote Sensing Image Change Detection},\n    author={Hao Chen, Wenyuan Li, Song Chen and Zhenwei Shi},\n    year={2022},\n    journal={IEEE Transactions on Geoscience and Remote Sensing},\n    volume={},\n    number={},\n    pages={1-18},\n    doi={10.1109/TGRS.2022.3203769}\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustchenhao%2FSaDL_CD","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustchenhao%2FSaDL_CD","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustchenhao%2FSaDL_CD/lists"}