{"id":22068703,"url":"https://github.com/StephenApX/UCD-SCM","last_synced_at":"2025-07-24T06:32:11.571Z","repository":{"id":218330622,"uuid":"734362032","full_name":"StephenApX/UCD-SCM","owner":"StephenApX","description":"[IGARSS 2024] Segment Change Model (SCM) for Unsupervised Change detection in VHR Remote Sensing Images: a Case Study of Buildings","archived":false,"fork":false,"pushed_at":"2024-03-25T10:34:35.000Z","size":25255,"stargazers_count":34,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-07T18:19:56.887Z","etag":null,"topics":["change-detection","clip","deep-learning","fastsam","pytorch","remote-sensing","sam","satellite-imagery"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2312.16410","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StephenApX.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,"dei":null}},"created_at":"2023-12-21T13:48:37.000Z","updated_at":"2024-08-10T13:09:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"367b46a5-66c5-4523-8b92-c48aa60e70a4","html_url":"https://github.com/StephenApX/UCD-SCM","commit_stats":{"total_commits":3,"total_committers":2,"mean_commits":1.5,"dds":"0.33333333333333337","last_synced_commit":"593e081c34b2bfbdf19eb20b6e9dc2f618894093"},"previous_names":["stephenapx/ucd-scm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephenApX%2FUCD-SCM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephenApX%2FUCD-SCM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephenApX%2FUCD-SCM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephenApX%2FUCD-SCM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StephenApX","download_url":"https://codeload.github.com/StephenApX/UCD-SCM/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227421320,"owners_count":17775009,"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","clip","deep-learning","fastsam","pytorch","remote-sensing","sam","satellite-imagery"],"created_at":"2024-11-30T20:04:17.318Z","updated_at":"2025-07-24T06:32:11.559Z","avatar_url":"https://github.com/StephenApX.png","language":"Python","funding_links":[],"categories":["Paper List","Deep Learning"],"sub_categories":["Follow-up Papers","Foundation Models"],"readme":"# Segment Change Model (SCM) for Unsupervised Change detection in VHR Remote Sensing Images: a Case Study of Building\r\n\r\nOpen-source codes of [CVEO](https://github.com/cveo) recent research \"Segment Change Model (SCM) for Unsupervised Change detection in VHR Remote Sensing Images: a Case Study of Buildings\" ([ArXiv](https://arxiv.org/abs/2312.16410), [IEEE](https://ieeexplore.ieee.org/document/10642429)), which has been recently accepted for inclusion as an **Oral** presentation in the [IGARSS 2024](https://2024.ieeeigarss.org/index.php#welcome).\r\n\r\nTo the best of our knowledge, this work is the first to apply multimodal large language models (MLLM) to remote sensing image change detection without the need for fine-tuning. This represents a preliminary exploration of the application of general AI in industry.\r\n\r\n## Method\r\n\r\n### Framework of Segment Change Model (SCM)\r\n\r\n![](docs/SCM_framework.png)\r\n\r\n### Results on LEVIR-CD and WHU-CD datasets\r\n\r\n#### Comparison with other UCD methods\r\n\r\n![](docs/QuantitativeResults.png)\r\n\r\n#### Ablation Study\r\n\r\n![](docs/AblationStudy.png)\r\n\r\n#### Qualitative results on WHU-CD dataset\r\n\r\n![](docs/QualitativeResults.png)\r\n\r\n## Usage\r\n\r\n### Create a conda virtual env:\r\n\r\n```shell\r\nconda create -n scm python=3.9\r\nconda activate SCM\r\n```\r\n\r\n### Installation\r\n\r\n* Follow the instructions of installing [FastSAM](https://github.com/CASIA-IVA-Lab/FastSAM) and [CLIP](https://github.com/openai/CLIP):\r\n\r\n```shell\r\ngit clone https://github.com/CASIA-IVA-Lab/FastSAM.git\r\ncd FastSAM\r\npip install -r requirements.txt\r\npip install git+https://github.com/openai/CLIP.git\r\n```\r\n\r\n* **Copy** 'FastSAM' under 'SCM' folder.\r\n* Download Pretrained model weights of FastSAM(FastSAM_X.pt)[[GoogleDriveLink](https://drive.google.com/file/d/1m1sjY4ihXBU1fZXdQ-Xdj-mDltW-2Rqv/view)/[BaiduDriveLink](https://pan.baidu.com/s/18KzBmOTENjByoWWR17zdiQ?from=init\u0026pwd=0000)] and CLIP(ViT-B-32.pt)[[OpenAILink](https://openaipublic.azureedge.net/clip/models/40d365715913c9da98579312b702a82c18be219cc2a73407c4526f58eba950af/ViT-B-32.pt)] and place then in **'weights/' folder**.\r\n* In order to generate FastSAM segmentation masks and extract featrues from FastSAM's encoder simultaneously, we modified few codes and store them in **'tbr' folder**, you need to **replace** the original codes from 'ultralytics' packages in the installed conda env:\r\n  * replace \"tbr/head.py\" in \"anaconda3/envs/your_conda_env_name/Lib/site-packages/ultralytics/nn/modules/head.py\"\r\n  * replace \"tbr/predictor.py\" in \"anaconda3/envs/your_conda_env_name/Lib/site-packages/ultralytics/yolo/engine/predictor.py\"\r\n  * replace \"tbr/tasks.py\" in \"anaconda3/envs/your_conda_env_name/Lib/site-packages/ultralytics/nn/task.py\"\r\n\r\n### Quick Start on LEVIR-CD dataset\r\n\r\nWe have prepared samples from [LEVIR-CD](https://justchenhao.github.io/LEVIR/) dataset in the 'data/samples_LEVIR' folder for a quick start.\r\n\r\nRun like:\r\n\r\n```shell\r\npython demo_LEVIR.py\r\n```\r\n\r\nSoon you'll acquire cd results in 'results/samples_levir/'.\r\n\r\n### Quick Start on WHU-CD dataset\r\n\r\nWe have prepared samples from [WHU-CD](https://study.rsgis.whu.edu.cn/pages/download/building_dataset.html) dataset in the 'data/samples_WHU-CD' folder for a quick start.\r\n\r\nRun like:\r\n\r\n```shell\r\npython demo_WHU.py\r\n```\r\n\r\nSoon you'll acquire cd results in 'results/samples_WHU-CD/'.\r\n\r\n### Contents of Directory\r\n\r\n* data/: sample/input data dir.\r\n  * samples_LEVIR/\r\n  * samples_WHU-CD\r\n* docs/\r\n* FastSAM/: FastSAM scripts.\r\n* results/: out UCD result dir.\r\n* tbr/: modified codes of FastSAM.\r\n* weights/: dir to place pretrained FastSAM and CLIP weights.\r\n\r\n### List of Arguments\r\n\r\npython SCM.py (for SCM model)\r\n\r\n\r\n| Argument           | Details                                                                                                                                   |\r\n| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |\r\n| -m, --mode         | Choose modes of conducting UCD with 'RFF' (Recalibrated Feature Fusion) / 'PSA' (Piecewise Semantic Attention) modules. Default: RFF PSA. |\r\n| --sam_weight_path  | Specify path of the FastSAM pt model. Default: 'weights/FastSAM_X.pt'.                                                                    |\r\n| --clip_weight_path | Specify path of the CLIP pt model. Default: 'weights/ViT-B-32.pt'                                                                         |\r\n| --img_dir_1        | Set input dir of images at prev time. Default: 'data/samples_WHU-CD/prev/'                                                                |\r\n| --img_dir_2        | Set input dir of images at curr time. Default: 'data/samples_WHU-CD/curr/'                                                                |\r\n| -o, --out_dir      | Set output CD directory, which consists of bcd_map and dis folders. Default: 'results/samples_WHU-CD/'                                    |\r\n\r\nRun full script like:\r\n\r\n```shell\r\npython SCM.py -m RFF PSA --sam_weight_path weights/FastSAM_X.pt --clip_weight_path weights/ViT-B-32.pt --img_dir_1 data/samples_WHU-CD/prev/ --img_dir_2 data/samples_WHU-CD/curr/ -o results/samples_WHU-CD/\r\n```\r\n\r\n## Citation\r\n\r\nPlease consider citing the following paper if you used this project in your research.\r\n\r\n```shell\r\n@article{tan2023segment,\r\n  title={Segment Change Model (SCM) for Unsupervised Change detection in VHR Remote Sensing Images: a Case Study of Buildings},\r\n  author={Tan, Xiaoliang and Chen, Guanzhou and Wang, Tong and Wang, Jiaqi and Zhang, Xiaodong},\r\n  journal={arXiv preprint arXiv:2312.16410},\r\n  year={2023}\r\n}\r\n```\r\n\r\n### License\r\n\r\nCode is released for non-commercial and research purposes **ONLY**. For commercial purposes, please contact the authors.\r\n\r\n### Reference\r\n\r\nAppreciate the work from the following repositories:\r\n\r\n* FastSAM: [https://github.com/CASIA-IVA-Lab/FastSAM](https://github.com/CASIA-IVA-Lab/FastSAM)\r\n* CLIP: [https://github.com/openai/CLIP](https://github.com/openai/CLIP)\r\n* SAM-CD: [https://github.com/ggsDing/SAM-CD](https://github.com/ggsDing/SAM-CD)\r\n* OBIC-GCN：[https://github.com/CVEO/OBIC-GCN](https://github.com/CVEO/OBIC-GCN)\r\n* Unsupervised-OBIC-Pytorch: [https://github.com/CVEO/Unsupervised-OBIC-Pytorch](https://github.com/CVEO/Unsupervised-OBIC-Pytorch)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStephenApX%2FUCD-SCM","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FStephenApX%2FUCD-SCM","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStephenApX%2FUCD-SCM/lists"}