🌊🛰️ ESA Copernicus pipeline for coastal erosion monitoring and forecasting along the West African coast. Fuses Sentinel-1/2, Landsat, ERA5, GESLA, CHIRPS, and NASADEM via Swin-UNETR segmentation and Bayesian LSTM shoreline forecasting (3/6/12-month horizons). Outputs COG, GeoJSON, STAC 1.0, and interactive dashboard.
# 🌊 Coastal Erosion Digital Twin
**ESA Copernicus pipeline for shoreline change detection and forecasting on the West African coast**
| | |
|---|---|
| **Author** | Samuel Appiah Kubi |
| **Programme** | Copernicus Master's in Digital Earth (Erasmus Mundus) |
| **Institution** | Paris Lodron University Salzburg (PLUS) |
| **Study area** | Ghana (Keta, Fuvemeh, Komenda) · Grand-Bassam (Côte d'Ivoire) |
| **Period** | 2015 – 2024 |
| **Target** | IoU > 0.75, F1 > 0.82 (spatial CV) · Forecast MAE 0.75 | 5-fold spatial block CV |
| F1 | > 0.82 | 5-fold spatial block CV |
| Forecast MAE | < 8 m | Temporal hold-out 2023–2024 |
Spatial block cross-validation uses 2 km × 2 km blocks with 200 m buffers to prevent spatial leakage. The temporal hold-out reserves 2023–2024 imagery for testing.
```bash
# Run validation only
python main.py --steps validate
# Check the report
cat data/outputs/validation/validation_report.md
```
---
## Outputs
| Output | Format | Location |
|--------|--------|----------|
| Shoreline probability maps | Cloud-Optimised GeoTIFF | `data/outputs/cogs/` |
| Extracted shorelines | GeoJSON | `data/outputs/geojson/` |
| Erosion rates (LRR/EPR/WLR) | CSV + GeoJSON | `data/outputs/erosion_rates/` |
| Shoreline forecasts | CSV | `data/outputs/forecasts/` |
| STAC catalogue | JSON | `data/outputs/stac/` |
| Interactive dashboard | HTML | `data/outputs/dashboard/` |
| Validation report | Markdown + PNG | `data/outputs/validation/` |
---
## Notebooks
| Notebook | Description |
|----------|-------------|
| `01_explore_sentinel.ipynb` | Explore Sentinel-1/2 scenes, NDWI, SAR backscatter |
| `02_generate_labels.ipynb` | Generate and QC training labels, QGIS export |
| `03_visualize_erosion.ipynb` | Timeseries, erosion maps, forecasts, hotspots |
```bash
cd notebooks
jupyter lab
```
---
## Testing
```bash
# All tests
pytest tests/ -v
# Specific modules
pytest tests/test_model.py -v
pytest tests/test_erosion.py -v
pytest tests/test_features.py -v
``` …