ttp
Implement of the paper "Time Travelling Pixels: Bitemporal Features Integration with Foundation Model for Remote Sensing Image Change Detection"
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.5%) to scientific vocabulary
Repository
Implement of the paper "Time Travelling Pixels: Bitemporal Features Integration with Foundation Model for Remote Sensing Image Change Detection"
Basic Info
Statistics
- Stars: 80
- Watchers: 3
- Forks: 4
- Open Issues: 7
- Releases: 0
Metadata Files
README.md
Time Travelling Pixels: Bitemporal Features Integration with Foundation Model for Remote Sensing Image Change Detection
Introduction
The repository is the code implementation of the paper Time Travelling Pixels: Bitemporal Features Integration with Foundation Model for Remote Sensing Image Change Detection, based on MMSegmentation and Open-CD projects.
The current branch has been tested under PyTorch 2.x and CUDA 12.1, supports Python 3.7+, and is compatible with most CUDA versions.
If you find this project helpful, please give us a star ⭐️, your support is our greatest motivation.
Main Features
- Consistent API interface and usage with MMSegmentation - Open sourced the TTP model in the paper - Tested with AMP training method - Supports multiple dataset extensionsUpdate Log
🌟 2023.12.23 Released the TTP project code, which is completely consistent with the API interface and usage of MMSegmentation.
🌟 2023.12.30 Released the model trained on Levir-CD.
🌟 2024.02.10 This project has been included in the Open-CD project.
Table of Contents
- Introduction
- Update Log
- Table of Contents
- Installation
- Dataset Preparation
- Model Training
- Model Testing
- Image Prediction
- FAQ
- Acknowledgements
- Citation
- License
- Contact Us
Installation
Dependencies
- Linux or Windows
- Python 3.7+, recommended 3.10
- PyTorch 2.0 or higher, recommended 2.1
- CUDA 11.7 or higher, recommended 12.1
- MMCV 2.0 or higher, recommended 2.1
Environment Installation
We recommend using Miniconda for installation. The following command will create a virtual environment named ttp and install PyTorch and MMCV.
Note: If you have experience with PyTorch and have already installed it, you can skip to the next section. Otherwise, you can follow these steps to prepare.
Install TTP
Download or clone the TTP repository.
shell
git clone git@github.com:KyanChen/TTP.git
cd TTP
Dataset Preparation
Model Training
TTP Model
Config File and Main Parameter Parsing
We provide the configuration files of the TTP model used in the paper, which can be found in the configs/TTP folder. The Config file is completely consistent with the API interface and usage of MMSegmentation. Below we provide an analysis of some of the main parameters. If you want to know more about the meaning of the parameters, you can refer to MMSegmentation documentation.
Parameter Parsing:
work_dir: The output path of the model training, which generally does not need to be modified.default_hooks-CheckpointHook: Checkpoint saving configuration during model training, which generally does not need to be modified.default_hooks-visualization: Visualization configuration during model training, comment out during training and uncomment during testing.vis_backends-WandbVisBackend: Configuration of network-side visualization tools, after opening the comment, you need to register an account on thewandbofficial website, and you can view the visualization results during the training process in the network browser.sam_pretrain_ckpt_path: The checkpoint path of the SAM backbone provided by MMPretrain, refer to download address.model-backbone-peft_cfg: Whether to introduce fine-tuning parameters, which generally does not need to be modified.dataset_type: The type of dataset, needs to be modified according to the type of dataset.data_root: Dataset root directory, modify to the absolute path of the dataset root directory.batch_size_per_gpu: The batch size of a single card, needs to be modified according to the memory size.resume: Whether to resume training, which generally does not need to be modified.load_from: The checkpoint path of the model's pre-training, which generally does not need to be modified.max_epochs: The maximum number of training rounds, which generally does not need to be modified.
Single Card Training
shell
python tools/train.py configs/TTP/xxx.py # xxx.py is the configuration file you want to use
Multi-card Training
shell
sh ./tools/dist_train.sh configs/TTP/xxx.py ${GPU_NUM} # xxx.py is the configuration file you want to use, GPU_NUM is the number of GPUs used
Other Instance Segmentation Models
Model Testing
Single Card Testing:
shell
python tools/test.py configs/TTP/xxx.py ${CHECKPOINT_FILE} # xxx.py is the configuration file you want to use, CHECKPOINT_FILE is the checkpoint file you want to use
Multi-card Testing:
shell
sh ./tools/dist_test.sh configs/TTP/xxx.py ${CHECKPOINT_FILE} ${GPU_NUM} # xxx.py is the configuration file you want to use, CHECKPOINT_FILE is the checkpoint file you want to use, GPU_NUM is the number of GPUs used
Note: If you need to get the visualization results, you can uncomment default_hooks-visualization in the Config file.
Image Prediction
Single Image Prediction:
shell
python demo/image_demo_with_cdinferencer.py ${IMAGE_FILE1} ${IMAGE_FILE2} configs/TTP/ttp_sam_large_levircd_infer.py --checkpoint ${CHECKPOINT_FILE} --out-dir ${OUTPUT_DIR} # IMAGE_FILE is the image file you want to predict, xxx.py is the configuration file, CHECKPOINT_FILE is the checkpoint file you want to use, OUTPUT_DIR is the output path of the prediction result
FAQ
Acknowledgements
The repository is the code implementation of the paper Time Travelling Pixels: Bitemporal Features Integration with Foundation Model for Remote Sensing Image Change Detection, based on MMSegmentation and Open-CD projects.
Citation
If you use the code or performance benchmarks of this project in your research, please refer to the following bibtex to cite TTP.
@misc{chen2023time,
title={Time Travelling Pixels: Bitemporal Features Integration with Foundation Model for Remote Sensing Image Change Detection},
author={Keyan Chen and Chengyang Liu and Wenyuan Li and Zili Liu and Hao Chen and Haotian Zhang and Zhengxia Zou and Zhenwei Shi},
year={2023},
eprint={2312.16202},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
License
The repository is licensed under the Apache 2.0 license.
Contact Us
If you have other questions❓, please contact us in time 👬
Owner
- Name: Keyan Chen
- Login: KyanChen
- Kind: user
- Location: Beijing
- Company: Beihang University
- Website: https://kyanchen.github.io/
- Repositories: 57
- Profile: https://github.com/KyanChen
I am a Ph.D. student at Beihang University, primarily focused on remote sensing image processing, deep learning, and multimodal.
Citation (CITATION.cff)
cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - name: "MMSegmentation Contributors" title: "OpenMMLab Semantic Segmentation Toolbox and Benchmark" date-released: 2020-07-10 url: "https://github.com/open-mmlab/mmsegmentation" license: Apache-2.0
GitHub Events
Total
- Issues event: 9
- Watch event: 23
- Issue comment event: 5
- Fork event: 2
Last Year
- Issues event: 9
- Watch event: 23
- Issue comment event: 5
- Fork event: 2
Dependencies
- actions/checkout v3 composite
- actions/setup-python v4 composite
- pytorch/pytorch ${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel build
- pytorch/pytorch ${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel build
- pytorch/pytorch ${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel build
- albumentations >=0.3.2
- docutils ==0.16.0
- myst-parser *
- sphinx ==4.0.2
- sphinx_copybutton *
- sphinx_markdown_tables *
- urllib3 <2.0.0
- mmcv >=2.0.0rc4,<2.2.0
- mmengine >=0.5.0,<1.0.0
- ftfy *
- regex *
- cityscapesscripts *
- diffusers *
- einops ==0.3.0
- imageio ==2.9.0
- imageio-ffmpeg ==0.4.2
- invisible-watermark *
- kornia ==0.6
- nibabel *
- omegaconf ==2.1.1
- pudb ==2019.2
- pytorch-lightning ==1.4.2
- streamlit >=0.73.1
- test-tube >=0.7.5
- timm *
- torch-fidelity ==0.3.0
- torchmetrics ==0.6.0
- transformers ==4.19.2
- mmcv >=2.0.0rc1,<2.1.0
- mmengine >=0.4.0,<1.0.0
- prettytable *
- scipy *
- torch *
- torchvision *
- matplotlib *
- numpy *
- packaging *
- prettytable *
- scipy *
- codecov * test
- flake8 * test
- ftfy * test
- interrogate * test
- pytest * test
- regex * test
- xdoctest >=0.10.0 test
- yapf * test