How liumency/cropland-cd works
Cropland-CD is a PyTorch implementation of MSCANet for binary cropland change detection from paired images. Its main workflow loads and augments time-paired images and labels, trains a multi-scale change detector with cross-entropy, validates by IoU, and saves selected weights; prediction evaluates pairs and saves change maps. The model combines a CNN backbone with transformer context aggregation and multi-scale classifiers. The prediction script imports models.mscanet.network, which does not match the supplied tree’s model/network.py; that connection is therefore not asserted. Arrows reflect shown calls or README descriptions.
Main entry points: train.py Training loop · network.py Change detector · predict.py Prediction script · data_utils.py Dataset loaders
Components 16
Paired data
- Dataset loaders
data_utils.py - Pair augmentation
data_utils.py - Test dataset
data_utils.py
Detection model
- Change detector
model/network.py - CNN backbone
model/backbone.py - Transformer context
model/network.py - Attention modules
model/modules.py - Multi-scale heads
model/network.py
Training and evaluation
- Training loop
train.py - Training options
train_options.py - Cross-entropy
loss/losses.py - IoU metric
data_utils.py - Weight saving
train.py
Prediction
- Prediction script
predict.py - Saved change maps
predict.py
Other components
- Engineer
Connections 16
- Engineer → Training loop: starts training
train.py - Training options → Training loop: configures
train.py - Training loop → Dataset loaders: loads pairs
train.py - Dataset loaders → Pair augmentation: applies
data_utils.py - Training loop → Change detector: runs forward
train.py - Change detector → CNN backbone: extracts features
model/network.py - Change detector → Transformer context: aggregates context
model/network.py - Transformer context → Attention modules: uses attention
model/network.py - Change detector → Multi-scale heads: classifies scales
model/network.py - Training loop → Cross-entropy: computes loss
train.py - Training loop → IoU metric: measures IoU
train.py - Training loop → Weight saving: saves weights
train.py - Engineer → Prediction script: starts prediction
predict.py - Prediction script → Test dataset: loads test pairs
predict.py - Prediction script → IoU metric: measures IoU
predict.py - Prediction script → Saved change maps: saves maps
predict.py