DUA Mapping Workflows

This section provides the commands to execute the four core workflows of the DUA mapping pipeline. Make sure your environment is set up before running these commands (see Environment Setup).

All commands follow this general pattern, with variations for each task:

python main.py --task <task_name> --city <city_name> --country <country_name> --year <year>

1. Training from Scratch

Train a new model on your complete dataset. This is useful when you have sufficient labeled data for your specific city or region.
python main.py --task train --city nairobi --country kenya --year 2024

2. Fine-tuning with Pre-trained Weights

Adapt the global IDEAtlas pre-trained model to your specific geographic context. Use this when you have limited local reference data.
Using default global model weights:
python main.py --task finetune --city nairobi --country kenya --year 2024
Using custom weights:

Replace {custom} with the actual name of the model weight file:

python main.py --task finetune --city nairobi --country kenya --year 2024 --weights checkpoint/custom.h5

3. Classification/Inference

Generate segmentation maps from a trained or fine-tuned model. This creates the DUA classification output for your study area.
Using city-specific weights:
python main.py --task classify --city nairobi --country kenya --year 2024
Using custom weights:

Replace {custom} with the actual name of the model weight file:

python main.py --task classify --city nairobi --country kenya --year 2024 --weights checkpoint/custom.h5

4. SDG Statistics

Compute SDG 11.1.1 statistics from classified rasters. This calculates the percentage and extent of deprived urban areas in your study region.
python main.py --task sdg_stats --city nairobi --country kenya --year 2024

Note: Ensure all required input data is placed in the corresponding folders as outlined in the IDEAtlas user handbook before running these workflows.