{"id":29581087,"url":"https://github.com/blaz-r/btc-change-detection","last_synced_at":"2025-07-19T19:08:53.589Z","repository":{"id":305132606,"uuid":"995257112","full_name":"blaz-r/BTC-change-detection","owner":"blaz-r","description":"[IEEE TGRS 2025] Be the Change You Want to See: Revisiting Remote Sensing Change Detection Practices","archived":false,"fork":false,"pushed_at":"2025-07-18T10:16:26.000Z","size":1174,"stargazers_count":12,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-18T14:18:44.403Z","etag":null,"topics":["btc","change-detection","deep-learning","method","optimization","pytorch","remote-sensing","swin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blaz-r.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-03T07:52:30.000Z","updated_at":"2025-07-18T10:16:30.000Z","dependencies_parsed_at":"2025-07-18T14:21:47.130Z","dependency_job_id":"18a75b90-459f-4ba5-a6ac-1ce15b4cf5fd","html_url":"https://github.com/blaz-r/BTC-change-detection","commit_stats":null,"previous_names":["blaz-r/btc-change-detection"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/blaz-r/BTC-change-detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaz-r%2FBTC-change-detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaz-r%2FBTC-change-detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaz-r%2FBTC-change-detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaz-r%2FBTC-change-detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blaz-r","download_url":"https://codeload.github.com/blaz-r/BTC-change-detection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaz-r%2FBTC-change-detection/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265992874,"owners_count":23860995,"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":["btc","change-detection","deep-learning","method","optimization","pytorch","remote-sensing","swin"],"created_at":"2025-07-19T19:08:48.653Z","updated_at":"2025-07-19T19:08:53.577Z","avatar_url":"https://github.com/blaz-r.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003ch1 align=\"center\"\u003eBTC - Be The Change\u003c/h1\u003e\n\u003ch3\u003eBe the Change You Want to See: Revisiting Remote Sensing Change Detection Practices\u003c/h3\u003e\n\n[Blaž Rolih](https://scholar.google.com/citations?user=Qs-k2PkAAAAJ), [Matic Fučka](https://scholar.google.com/citations?user=2kdcuAkAAAAJ), [Filip Wolf](https://scholar.google.com/citations?user=1i7eNmwAAAAJ), [Luka Čehovin Zajc](https://scholar.google.com/citations?hl=en\u0026user=XKc1wdcAAAAJ)\n\nUniversity of Ljubljana, Faculty of Computer and Information Science\n\n[![TGRS](https://img.shields.io/badge/TGRS-paper-00629B.svg)](https://arxiv.org/abs/2507.03367)\n[![arXiv](https://img.shields.io/badge/arXiv-2507.03367-b31b1b.svg)](https://arxiv.org/abs/2507.03367)\n\n[**Overveiw**](#overview) | [**Get Started**](#get-started) | [**Results**](#results) | [**Reference**](#reference) | [**Questions**](#questions)\n\n\u003c/div\u003e\n\n## Overview\n\nThis repository contains the codebase for **BTC (Be The Change)** and the accompanying analysis from our paper.\n\nThe work systematically investigates the impact of fundamental design choices in deep learning-based change \ndetection, like pretraining strategies, data augmentations, loss functions, and learning rate schedulers. \nBuilding on these insights, we introduce BTC, a simple yet strong baseline that leverages these core components\nto achieve state-of-the-art performance across multiple benchmark datasets.\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"picture/title.svg\" alt=\"title img showing 9.4 percentage points of performance boost with our analysis\"\u003e\n\u003c/p\u003e\n\n### BTC architecture\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"picture/arch.svg\"\u003e\n\u003c/p\u003e\n\n## Get Started\n\n### Environment setup\n\nCreate a Python environment and install required packages:\n\n```bash\nconda create -n btc_env python=3.10\nconda activate btc_env\n\npip install -r requirements.txt\n```\n\n### Training and evaluation\n\nRun the training and evaluation with:\n```bash\npython train.py --config configs/exp/BTC-B.yaml\n```\n\nRun evaluation only:\n```bash\npython train.py --config configs/exp/BTC-B.yaml --eval_only --ckpt_path \u003cpath to the weights (e.g. weights/clcd.pt)\u003e\n```\n\n### Checkpoints:\n\nThe checkpoints are available [here](https://drive.google.com/drive/folders/1OND326JAw420C9F2yTaqyGDlTN8OLDON?usp=sharing)\n\n### Data\n\nBy default, datasets are automatically downloaded from [huggingface](https://huggingface.co/ericyu)\nand saved into `./datasets` directory. We thank Weikang Yu for making these splits publicly available.\n\n\u003e **Note:** The OSCD dataset on HuggingFace is not cropped into the original 96x96 tiles. We provide a corrected version (zip and HDF5 files) [here](https://drive.google.com/drive/folders/1VH_aR8tLtvVXKYwIhFxpBko9d46_Gn5P?usp=sharing). !\n\n### Dataset Configuration Options\n\n- data.use_hf=True (default): Use HuggingFace datasets.\n\n- data.use_hf=False: For custom datasets in directory-based format.\n\nWhen you have use_hf set to False, you can additionally set the following flags:\n\n- data.load_in_mem=None (default): Read images from the disk on-the-fly.\n\n- data.load_in_mem=\"direct\": For custom datasets in directory-based format that is read into RAM first.\n\n- data.load_in_mem=\"hdf5\": For HDF5-formatted datasets (including our version of OSCD) that is read into RAM first.\n\n#### Custom directory format\n\nUse the following structure for a custom directory dataset.\n```\ndata_root/\n    dataset_name/\n       train/\n            A/\n                0.png\n                ...\n            B/\n                0.png\n                ...\n            label/\n                0.png\n                ...\n       test/\n            A/\n            B/\n            label/\n       val/\n            A/\n            B/\n            label/\n```\n\n#### Custom HDF5 data\n\nSet `data.load_in_mem` to \"hdf5\" and `data.use_hf=False` if you have the dataset in a format with hdf5 files:\n```\ndata_root/\n    dataset_name/\n        train.h5\n        test.h5\n        val.h5\n```\nEach HDF5 file must contain the following collections:\n- imageA\n- imageB\n- label\n- img_idx\n\n## Configuration files\n\nAll experiment configurations are available in the [configs directory](configs/exp). \n\nThe directory also includes configurations for related remote sensing foundation models [here](configs/exp/sota/other) \n\u003e For foundation models, please manually download weights and place them in weights/, or update paths in the config files.\n\n### Custom configuration\n\nThe config file contains the configuration for the whole setup, including data, architecture and training parameters.\nRefer to [BTC-B config file](configs/exp/BTC-B.yaml) for more details on each parameter.\n\nYou can manually override any argument in the command line without changing the config file. \nFor example, to keep all the parameters from config but change the dataset name, simple do the following.\n\n```bash\npython train.py --config configs/BTC-B.yaml --data.dataset oscd96\n```\n\nThe architecture follows the pipeline:\n```text\nencoder -\u003e diff -\u003e decoder\n```\n\nAdditional modules like in_proc, pre_diff, and out_proc are supported but unused in this work (see `models/finetune_framework.py`).\n\nAlternatively, you can also list all arguments with:\n\n```bash\npython train.py -h\n```\n\n### Performance benchmarking\n\nThe benchmarking code and results are inside the [perf](./perf) directory.\n\nRun model inference speed and efficiency evaluation with:\n```bash\npython perf.py\n```\n\n### Slurm\n\nSlurm job scripts are included for both training and evaluation workflows.\n\n## Results\n\nAll evaluation metrics (F1, Precision, Recall, cIoU) across seeds and methods are stored in the results directory. This includes:\n\n- Design choice analysis\n- BTC-T / BTC-B models\n- Remote sensing foundation models\n- Change detection-specific baselines\n\n## Reference\n\nIf you found this work useful, consider citing our paper and giving this repo a ⭐ 😃\n```bibtex\n@ARTICLE{rolih2025btc,\n  author={Rolih, Blaž and Fučka, Matic and Wolf, Filip and Zajc, Luka Čehovin},\n  journal={IEEE Transactions on Geoscience and Remote Sensing}, \n  title={Be the Change You Want to See: Revisiting Remote Sensing Change Detection Practices}, \n  year={2025},\n  volume={63},\n  number={},\n  pages={1-11},\n  doi={10.1109/TGRS.2025.3585342}\n}\n```\n\n## Questions\n\nFor issues or questions, please open a GitHub [issue](https://github.com/blaz-r/BTC-change-detection/issues) or email the author directly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblaz-r%2Fbtc-change-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblaz-r%2Fbtc-change-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblaz-r%2Fbtc-change-detection/lists"}