Spatiotemporal land-use segmentation of satellite imagery with graph neural networks

Trained model from the PhD dissertation Method for Spatiotemporal Semantic Segmentation of Land Use on Satellite Imagery Using Graph Neural Networks by Domen Kavran, University of Maribor, Faculty of Electrical Engineering and Computer Science (UM FERI), completed in March 2026. The dissertation is in Slovenian.

Method

Workflow of the proposed method

  1. Regions. Each image of the time series is segmented into regions.
  2. Graph. A graph is built with spatial edges and temporally directed edges between the regions.
  3. Subgraphs. For every target region (node), a directed subgraph of its spatial and temporal neighbours is sampled.
  4. Classification. A CNN extracts features from the bounding box of every subgraph node, and a graph neural network classifies the target node.

The node predictions are then mapped back to pixels, which gives a time series of land-use maps.

Subgraph sampling algorithm

This checkpoint

GNN Heterogeneous Graph Transformer (MyModelGraphTransformer): 1 hidden HGT layer with 8 heads × 16 features, then an output HGT layer, with layer normalisation
Region feature extractor ShuffleNetV2-x0.5, 1024-d features
Region input 32 × 32 px bounding boxes, 4 channels (RGB + NIR), standardised with train_set_normalization_data.json, then a 1×1 conv to 3 channels
Subgraph sampling ProposedSampler, temporal neighbourhood: 0 spatial steps, 1 temporal step into the past, fanout 2
Classes (7) Impervious surface, Agriculture, Forest & other vegetation, Wetlands, Soil, Water, Snow & ice
Parameters 0.9 M

All settings are in config.json.

Results on DynamicEarthNet

These numbers come from the dissertation abstract.

Method mIoU mF1
Proposed, spatial neighbourhood 0.4145 ± 0.0051
Proposed, temporal neighbourhood 0.5202 ± 0.0103
GASSL (best state-of-the-art foundation model) 0.3823 ± 0.0156 0.4908 ± 0.0198

The proposed method was also compared with SeCo, SatMAE and TOV, and its improvements are statistically significant against all compared methods.

The best-trained model, which uses the temporal neighbourhood, reached a wF1 of 0.6905. Per-class results:

Class F1 IoU
Water 0.9159 0.8449
Forest & other vegetation 0.7890 0.6515
Soil 0.6561 0.4882

Results

Usage

DGL has to match your PyTorch version:

import sys
!{sys.executable} -m pip install torch==2.4.0 torchvision==0.19.0
!{sys.executable} -m pip install dgl -f https://data.dgl.ai/wheels/torch-2.4/repo.html
!{sys.executable} -m pip install torchdata==0.8.0 pydantic huggingface_hub networkx matplotlib
import sys
from huggingface_hub import snapshot_download
repo = snapshot_download("SAMPA-Project/spatiotemporal-land-use-segmentation-gnn")
sys.path.insert(0, repo)
import landuse_model as lm

model, cfg = lm.load_model(local_dir=repo)
graph_nx, masks = lm.load_region("path/to/region/")      # graph.pickle + segmentation_masks.pickle
g = lm.to_dgl(graph_nx, cfg)
node_pred = lm.predict_nodes(model, g, cfg)
pred_maps = lm.nodes_to_maps(g, node_pred, masks)         # (T, H, W) class indices, 255 = no region

The input graphs are produced by source/data_preparation/1_prepare_graphs.ipynb in the GitHub repository. run_proposed_method.ipynb is the complete demo. proposed_method_lib/ is the unchanged library from the GitHub repository.

Files

  • best_model.pt: model weights (PyTorch state dict)
  • config.json: architecture, sampling, classes and colours
  • train_set_normalization_data.json: per-channel means and standard deviations of the training set
  • landuse_model.py: helper functions for loading and inference
  • proposed_method_lib/: graph construction, GNN architectures and ProposedSampler
  • run_proposed_method.ipynb: demo notebook

Acknowledgements

Mentor: Niko Lukač, University of Maribor, FERI.

Contact

domen.kavran1@um.si

Downloads last month
18
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support