landslides_segmentation

May 19, 2026 · View on GitHub

Deep learning pipeline for super-resolution and segmentation of multispectral Sentinel-2 satellite imagery, applied to landslide monitoring in Italian municipalities.

Bachelor's thesis project — University of Bologna, 2024/2025.

What this does

Sentinel-2 imagery has a spatial resolution of 10m for RGB bands and 20m for NIR. This project upscales those images by a factor of 5× using super-resolution models (CNN and Transformer architectures), then feeds the enhanced imagery into a segmentation pipeline to improve landslide detection.

Two main components:

  • Super_Resolution/ — trains and evaluates RCAN, DRCT, and Swin2MoSE models on paired LR/HR satellite patches
  • Segmentation/ — UNet and Swin-UNet models for landslide segmentation on the super-resolved output

Results

All metrics evaluated on the validation set. Bold = best per column.

Architecture comparison (100 epochs, 3 comuni)

ModelPSNRPSNR-RGBPSNR-NIRSSIMLPIPS
RCAN21.4822.0720.190.5740.592
DRCT21.1521.6420.030.5390.607
Swin2MoSE21.1121.6120.000.5380.614

RCAN (CNN-based) outperforms transformer models on this dataset size. Transformer models need larger datasets and longer training to surpass CNN performance.

Training duration (RCAN vs DRCT, 100 vs 300 epochs)

ModelEpochsPSNRPSNR-RGBPSNR-NIRSSIMLPIPS
RCAN10021.4822.0720.190.5740.592
RCAN30021.6222.1420.450.5860.586
DRCT10021.1521.6420.030.5390.607
DRCT30021.1921.7220.000.5630.591

Dataset size (1 vs 3 comuni)

ModelComuniPSNRPSNR-RGBPSNR-NIRSSIMLPIPS
RCAN121.3821.8320.350.5760.589
RCAN321.4822.0720.190.5740.592
DRCT121.0521.5219.980.5480.600
DRCT321.1521.6420.030.5390.607

Synthetic data and fine-tuning (RCAN)

TrainingPSNRPSNR-RGBPSNR-NIRSSIMLPIPS
Synthetic only24.2524.7922.980.6570.503
Fine-tuned21.3621.9020.180.5470.619
Standard21.4822.0720.190.5740.592

Pre-training on bicubic-downsampled synthetic data did not transfer well to real Sentinel-2 imagery.

Loss function combinations (RCAN)

LossPSNRPSNR-RGBPSNR-NIRSSIMLPIPS
Charbonnier21.4822.0720.190.5740.592
Ch. + SSIM21.5022.0320.340.5890.576
Ch. + LPIPS21.4021.8420.370.5470.357
Ch. + HF21.5222.0720.290.5780.592
NCC + SSIM21.5121.9720.460.5850.581

Charbonnier + High-Frequency loss gave the best overall results.

Project structure

Super_Resolution/
├── launch_model.py       # entry point: train/evaluate a model
├── config.py             # config dataclasses and factory
├── models_utils.py       # training loop and evaluation
├── rcan/                 # RCAN model and config
├── myDRCT/               # DRCT model and config
├── swin2mose/            # Swin2MoSE model and config
└── calc_mean.py          # compute per-channel dataset stats

Segmentation/
├── train.py              # segmentation training
├── evaluate.py           # segmentation evaluation
├── unet.py               # UNet architecture
└── swin_unet.py          # Swin-UNet architecture

Cloud_Generation/         # synthetic cloud augmentation utilities
data_utils.py             # dataset loading and preprocessing

Setup

Requires a CUDA-capable GPU and Python 3.10+.

pip install -r requirements.txt

Before training, compute per-channel normalization statistics on your dataset:

python Super_Resolution/calc_mean.py

This generates Super_Resolution/channel_stats.json, which is required by the config loader.

Usage

Train a super-resolution model:

python Super_Resolution/launch_model.py --model rcan
python Super_Resolution/launch_model.py --model drct
python Super_Resolution/launch_model.py --model swin2mose

Fine-tune from a checkpoint:

python Super_Resolution/launch_model.py --model rcan --finetune --ckpt path/to/checkpoint.pth

Model hyperparameters and training settings are configured in each model's config.yml.

Data

The models were trained on paired LR/HR Sentinel-2 patches from 4 Italian municipalities (comuni) with known landslide history. The LR images are the native Sentinel-2 10m/20m resolution; HR images are aerial orthophotos used as ground truth.

The dataset is not included in this repository.

Author

Leonardo Berselli — Bachelor's in Computer Science, University of Bologna (2024/2025)