Welcome to the hands-on materials for the ASU Workshop on Geospatial AI Foundation Models.
This workshop introduces geospatial foundation models for Earth observation and walks through a practical example using the NASA-IBM Prithvi model for landslide mapping from satellite imagery.
The main hands-on notebook is:
workshop_materials/prithvi_workshop_final.ipynb
In this notebook, you will fine-tune a Prithvi geospatial foundation model for binary semantic segmentation:
- Input: Sentinel-2 optical bands, including Blue, Green, Red, NIR, SWIR-1, and SWIR-2
- Output: a landslide mask
- Model: Prithvi encoder with a UNet decoder
- Metrics: precision, recall, F1-score, and IoU
The notebook covers:
- Exploring HDF5 satellite data
- Building a custom PyTorch dataset
- Computing channel-wise normalization statistics
- Applying data augmentation and resizing for Prithvi input
- Building a TerraTorch Prithvi + UNet segmentation model
- Training, validation, checkpointing, and test evaluation
- Visualizing predictions and error maps
workshop_materials/prithvi_workshop_final.ipynb: main workshop notebookworkshop_materials/config_prithvi300_UNet.yaml: model configuration for Prithvi-EO-2.0 300M with a UNet decoderworkshop_materials/readme.md: short note for the workshop materials folder
Participants should download the required landslide reference dataset and Prithvi checkpoint before running the model-building and training sections.
- Landslide reference dataset: https://zenodo.org/records/17007637
- Prithvi-EO-2.0 300M model files: https://huggingface.co/ibm-nasa-geospatial/Prithvi-EO-2.0-300M/tree/main
- Direct checkpoint download: https://huggingface.co/ibm-nasa-geospatial/Prithvi-EO-2.0-300M/resolve/main/Prithvi_EO_V2_300M.pt?download=true
When Jupyter is launched from workshop_materials, the notebook path setup cell defaults to:
- Data:
./data/reference_data - Prithvi checkpoint:
./checkpoints/Prithvi_EO_V2_300M.pt - Fine-tuned training output:
./prithvi_unet_landslide_best.pt
These correspond to the repo paths workshop_materials/data/reference_data, workshop_materials/checkpoints/Prithvi_EO_V2_300M.pt, and workshop_materials/prithvi_unet_landslide_best.pt.
If you store the files somewhere else, update DATA_DIR and BACKBONE_CKPT_PATH in the notebook path setup cell. You do not need to edit workshop_materials/config_prithvi300_UNet.yaml for local paths.
The notebook uses Python 3 with common geospatial and deep learning packages, including:
torchtorchvisionh5pynumpypandasmatplotlibtqdmpyyamlterratorchsegmentation_models_pytorch
A CUDA-enabled GPU is recommended for training and evaluation.
- Follow
workshop_materials/readme.mdto create the environment, download files, and launch Jupyter fromworkshop_materials. - Open
prithvi_workshop_final.ipynb. - Run the notebook cells in order.
- Confirm that
DATA_DIRandBACKBONE_CKPT_PATHpoint to your downloaded files. - Follow the section notes in the notebook to inspect data, train the model, and visualize predictions.
- TerraTorch: https://github.com/terrastackai/terratorch
- Prithvi-EO-2.0: https://github.com/NASA-IMPACT/Prithvi-EO-2.0
- Prithvi-EO-2.0 300M model card: https://huggingface.co/ibm-nasa-geospatial/Prithvi-EO-2.0-300M