Forecasting vegetation dynamics (EVI) across Southern Africa using pixel-level LSTM models and environmental drivers.
# πΏ Pixel-LSTM Forecasting
Forecasting vegetation dynamics in Southern Africa using pixel-level LSTM models and remote sensing data.
This repository contains the code and data pipeline for predicting the Enhanced Vegetation Index (EVI) using a Long Short-Term Memory (LSTM) model. It integrates climate variables and static environmental features to model spatiotemporal vegetation change at 0.1Β° grid resolution.
## Please note:
Some of the listed data files are lacking in this repository due to maximum file size limitations, the data can be accessed via the Thesis PDF document in this folder or by contacting the author at daan.hoekvander@gmail.com. The PDF will be available in the LATEST version.
---
## π Overview
- **Target Variable**: Enhanced Vegetation Index (EVI)
- **Model**: LSTM with static feature-based hidden state initialization
- **Region**: Southern Africa
- **Data Sources**: MODIS, ERA5, GMTED2010, GLDAS, SPEI
- **Forecast Horizon**: Multi-step sequence modeling
- **Goal**: Understand vegetation responses to hydroclimatic and geophysical variables
---
## π§ Features
- π¦ Raw NetCDF to training-ready `.npy` conversion
- π§Ό Temporal standardization & log-transformations
- π Per-pixel sample selection & masking
- π§ LSTM model with custom static initialization
- π Training with early stopping & loss tracking
- π§ͺ Evaluation & result saving for downstream analysis
---
## π Directory Structure
pixel-lstm-forecasting/β
βββ raw_data/ # Raw NetCDF files (ignored in .gitignore)
βββ prepared_data/ # Processed NumPy arrays (X.npy, y.npy, etc.)
β
βββ model_architecture.py # PixelLSTM model definition
βββ dataloader_utils.py # Dataset, split logic, and loaders
βββ prepare_data.py # Extracts X, y, static, coords from NetCDF
βββ training.py # Main training pipeline
βββ loading and using model.py # (Optional) inference or demo code
β
βββ LICENSE
βββ README.md
> π Note: `raw_data/` and `prepared_data/` may be added via `.gitkeep` to persist empty folders.
--- β¦