Multi-temporal Landsat analysis (2006–2026) combining Landsat 5 TM, Landsat 8 OLI and Landsat 9 OLI-2 to predict deforestation probability across the Western Ghats UNESCO World Heritage corridor using a Random Forest machine learning model.
→ View Interactive 2030 Risk Map & NDVI Time Slider
The Western Ghats is one of the world's eight biodiversity hotspots — a 1,600 km mountain corridor harbouring over 5,000 plant species, 139 mammal species, and the headwaters of rivers sustaining hundreds of millions across the Deccan Plateau. Despite UNESCO World Heritage status, the range faces compounding Frontier Risks: coffee and tea plantation expansion, mining, urban fringe sprawl, and infrastructure penetration into primary forest.
The UN 2026 Global Forest Goals Report found a global net loss of 40+ million hectares since 2015 and a $200 billion annual financing gap for conservation. When capital is scarce, it must be deployed with precision — before canopy loss becomes irreversible.
This project builds a fully open-source, reproducible Digital Twin that predicts the mathematical probability of forest loss by 2030 for every pixel currently forested in the Western Ghats.
| Output | Description |
|---|---|
| NDVI Time Series | 21 annual dry-season composites (2006–2026) at 5 km grid |
| Feature Table | Per-pixel NDVI trend, std, min, loss-year count + terrain |
| RF Risk Map | 2030 deforestation probability [0–1] for all forested pixels |
| Interactive Map | Folium HTML — NDVI time slider + Digital Magenta risk overlay |
| GitHub Pages | Self-contained deployment page with methodology panel |
2030 Risk Score = RandomForest.predict_proba(features)[:, 1]
Features:
ndvi_2006, ndvi_2010, ndvi_2015, ndvi_2020, ndvi_2023 ← annual NDVI
ndvi_trend (OLS slope, NDVI/year, 2006–2026)
ndvi_std (temporal standard deviation)
ndvi_min (minimum observed NDVI)
n_loss_years (years with NDVI < 0.35)
elevation (SRTM, metres)
slope (degrees)
dist_settlement (distance to nearest GHSL settled area, metres)
Training labels:
class = 1 → Forest in 2006 (NDVI > 0.50) → Deforested by 2015 (NDVI < 0.35)
class = 0 → Forest in 2006 (NDVI > 0.50) → Still forest in 2015 (NDVI > 0.50)
western-ghats-risk/
├── gee_scripts/
│ ├── wg_landsat_export.js ← Landsat 5/8/9 NDVI + terrain CSV export
│ └── rf_2030_predictor.js ← GEE-native RF predictor (reference only)
├── python/
│ ├── wg_01_process_landsat.py ← Feature engineering + training labels
│ └── wg_02_rf_risk_map.py ← Random Forest model + Folium map builder
├── web/
│ ├── index.html ← GitHub Pages project showcase
│ └── wg_frontier_risk_2030.html ← Generated Folium map (run wg_02 first)
├── data/
│ ├── WG_Landsat_Annual_NDVI_2006_2026.csv ← GEE export (download from Drive)
│ ├── WG_Terrain.csv ← GEE terrain export
│ ├── wg_features.csv ← Generated by wg_01
│ └── wg_risk_predictions.csv ← Generated by wg_02
├── linkedin_post.md
├── requirements.txt
└── README.md
# 1. Clone repo
git clone https://github.com/prakashkrish-DataGeek/western-ghats-risk.git
cd western-ghats-risk
# 2. Install dependencies
pip install -r requirements.txt
# 3. Generate synthetic Western Ghats data + features
python python/wg_01_process_landsat.py --demo
# 4. Train RF model + build Folium map
python python/wg_02_rf_risk_map.py
# → Saves: web/wg_frontier_risk_2030.html
# 5. Open in browser
open web/index.htmlGEE Export (run in code.earthengine.google.com)
- Open
gee_scripts/wg_landsat_export.js - Copy-paste into a new GEE Script and click Run
- In the Tasks tab, run both export tasks:
WG_Landsat_Annual_NDVI_2006_2026→ Google Drive folderWesternGhats_RiskWG_Terrain→ same folder
- Download both CSVs to
data/
# Process GEE exports + engineer features
python python/wg_01_process_landsat.py \
--ndvi data/WG_Landsat_Annual_NDVI_2006_2026.csv \
--terrain data/WG_Terrain.csv
# Train RF model + generate 2030 risk map
python python/wg_02_rf_risk_map.py
# → Saves: web/wg_frontier_risk_2030.html| Dataset | Source | Resolution | GEE Collection ID |
|---|---|---|---|
| Landsat 5 TM | USGS / NASA | 30m | LANDSAT/LT05/C02/T1_L2 |
| Landsat 8 OLI | USGS / NASA | 30m | LANDSAT/LC08/C02/T1_L2 |
| Landsat 9 OLI-2 | USGS / NASA | 30m | LANDSAT/LC09/C02/T1_L2 |
| SRTM DEM | CGIAR-CSI | 90m | CGIAR/SRTM90_V4 |
| GHSL Settlement Model | JRC / EC | 1km | JRC/GHSL/P2016/SMOD_POP_GLOBE_V1 |
- Band harmonisation: Landsat 5 (
SR_B3/SR_B4) and Landsat 8/9 (SR_B4/SR_B5) are renamed to commonRed/NIRnames before merging, ensuring consistent NDVI calculation across missions without mission-conditional logic. - Dry-season compositing: January–April window minimises monsoon cloud cover across the Western Ghats and isolates the annual dry-season vegetation signal.
- Balanced classes:
class_weight='balanced'in scikit-learn compensates for the natural imbalance between deforestation events and stable-forest pixels. - Prediction scope: Only pixels with
ndvi_2023 > 0.50(still forested) are included in the 2030 risk prediction — deforested land is excluded.
- Highest risk zones: Coorg/Kodagu coffee belt, Munnar tea-plantation fringe, Goa mining belt, Nilgiris urban fringe, northern Maharashtra Western Ghats
- Most stable zones: Silent Valley NP (Kerala), Kudremukh NP (Karnataka), Anamalai Tiger Reserve (Tamil Nadu) — high elevation core refugia
- Key predictor:
ndvi_trend(NDVI/year slope) consistently ranks as the top feature — pixels already on a declining trajectory carry the highest risk - Digital Magenta (
#FF00FF) overlay marks extreme-risk zones (p > 0.85) against the dark CartoDB basemap for maximum visual urgency
Prakash Krishnamachari
- GitHub: @prakashkrish-DataGeek
- LinkedIn: linkedin.com/in/prakashkrishnamachari
- Email: prakash.krishnamachari@gmail.com
MIT License — see LICENSE for details. Satellite imagery data is subject to respective agency terms of use (USGS, NASA, JRC).
Built with ❤️ for open conservation data science