Dual-branch UAV+Satellite multi-scale segmentation network
DETSlideNet fuses high-resolution UAV imagery and wide-area satellite data via cross-attention and a flexible decoder, for accurate segmentation across scales.
- Dual-branch encoders (SwinTransformer) for UAV & SAT streams
- Cross-attention fusion at multiple scales
- Flexible decoder blocks with optional skip connections
- Joint loss combining UAV-supervision & SAT-supervision
- End-to-end PyTorch implementation with training & evaluation scripts
├── .github
│ └── workflows
│ └── ci.yml
├── checkpoints/ # saved model weights
├── data/ # expected directory structure for datasets
│ ├── train/
│ └── test/
├── src/
│ ├── dataloader.py # CASLDataset
│ ├── nets.py # DETSLideNet and submodules
│ ├── train.py # train_net
│ ├── test.py # eval_net
│ └── utils/
│ ├── losses.py
│ └── module.py
├── Dockerfile
├── .gitignore
├── .gitattributes
├── requirements.txt
└── README.md
Follow the steps below to set up and run DETSLideNet, both locally (without Docker) and in Docker.
- Python 3.8 or higher
- Git
- (Optional, for Docker) Docker & docker-compose
git clone https://github.com/Guemann-ui/DETSlideNet.git
cd DETSlideNet
Download the dataset from Zenodo.
Extract under data/:
data/
├── train/
│ ├── Moxitaidi/
│ │ ├── img/
│ │ └── label/
│ ├── TiburonPeninsula/
│ │ ├── img/
│ │ └── label/
│ └── Jiuzhaivalley/
│ ├── img/
│ └── label/
└── test/
├── Moxitaidi/
│ ├── img/
│ └── label/
├── TiburonPeninsula/
│ ├── img/
│ └── label/
└── Jiuzhaivalley/
├── img/
└── label/
python3 -m venv .venv
source .venv/bin/activate # macOS/Linux
.venv\Scripts\activate # Windows PowerShell
pip install --upgrade pip
pip install -r requirements.txt
python main.py \
--mode train \
--region Moxitaidi,TiburonPeninsula,Jiuzhaivalley \
--epochs 300 \
--batch-size 16 \
--learning-rate 0.01 \
--sat-weight 0.4 \
--img_size 128 \
--output-dir checkpoints/run1
python main.py \
--mode test \
--region Moxitaidi,TiburonPeninsula,Jiuzhaivalley \
--load checkpoints/model_best.pth \
--img_size 128
docker build -t detslidenet:latest .
PowerShell / Windows:
docker run --rm \
--mount type=bind,source="$(pwd)/data",target=/app/data \
--mount type=bind,source="$(pwd)/checkpoints",target=/app/checkpoints \
detslidenet:latest \
--mode train --epochs 100 --batch-size 4 --region Moxitaidi --img_size 128
Bash / Linux / macOS:
docker run --gpus all \
-v $(pwd)/data:/app/data \
-v $(pwd)/checkpoints:/app/checkpoints \
detslidenet:latest \
python main.py --mode train --output-dir checkpoints/run1
PowerShell / Windows:
docker run --rm `
--mount type=bind,source="$($pwd.Path)\data\data",target=/app/data/data `
detslidenet:latest `
--mode test `
--region Moxitaidi,TiburonPeninsula,Jiuzhaivalley `
--load checkpoints/model_best.pth `
--img_size 128
Bash / Linux / macOS:
docker run --gpus all \
-v $(pwd)/data:/app/data \
-v $(pwd)/checkpoints:/app/checkpoints \
-v $(pwd)/results:/app/results \
detslidenet:latest \
python main.py --mode test --load checkpoints/run1/model_best.pth
docker-compose up --build
python main.py -m train Train with default settings
python main.py -m test -f <ckpt> Evaluate saved checkpoint
docker run … Train or test in Docker container