Back to projects

Project 03 · Machine learning · Earth observation

ML-based Biomass Downscaling

From 463 m to 30 m, one month at a time

A random forest workflow that downscales monthly biomass from the 463 m MODIS grid to 30 m using HLS vegetation indices, LAI, rainfall, terrain and land cover, while keeping every coarse cell's original value.

PythonRandom forestGoogle Earth EngineHLS L30 + S30MODIS LAICHIRPSESA WorldCoverGeoTIFF

Why I built it

Monthly biomass maps on the MODIS grid are consistent and easy to obtain, but at 463 m a single pixel blends fields, trees, settlements and water. For questions about individual fields and landscapes, that is simply too coarse.

I built a machine-learning workflow that takes each month's coarse biomass map (kg/m²) and produces the same month at 30 m. A random forest learns how biomass relates to 30 m covariates at the coarse scale, then predicts at 30 m, and a mass-conservation step rescales that prediction so every 500 m cell still averages to its original value.

The problem

Coarse maps hide the detail that matters

  • At 463 m, one biomass value has to stand for hundreds of 30 m fields and features.
  • Sharper predictors exist from Landsat and Sentinel-2 at 30 m, but cloud leaves gaps in almost every month.
  • A downscaled map is only trustworthy if it still agrees with the coarse product it came from.
  • Large areas and long time series quickly exhaust Earth Engine quotas and local memory.
  • Mixed pixels

    One value blends cropland, trees, water and settlements.

  • Cloud gaps

    Optical scenes are missing or partial in cloudy months.

  • Scale mismatch

    Inputs from 10 m to about 5.5 km must share one grid.

  • Consistency

    Fine maps must add back up to the coarse values.

  • Compute limits

    Big areas must run within quota and memory.

Built with

Technologies, services and libraries

  • Python
  • Google Earth Engine
  • Random forest
  • HLS · MODIS LAI
  • CHIRPS
  • ESA WorldCover
  • GeoTIFF

The solution

30 m monthly biomass

The same month as the coarse input, at 30 m, exported as a GeoTIFF clipped to the area of interest.

Mass-conserving

Every 500 m cell of the 30 m map averages back to its original coarse value.

Quota-light, memory-bounded

Earth Engine only downloads raw data. Everything else runs locally, one month at a time and in row chunks.

Inputs

Seven inputs, one 30 m grid

The coarse biomass map is both the training target and the reference for mass conservation. Everything else is a covariate that helps the model place biomass at 30 m. Hover over a row to see where its native resolution sits.

  • Coarse biomassLocal monthly GeoTIFFs463 mTraining target and mass-conservation reference
  • NDVI, EVIHLS L30 (Landsat 8/9) + S30 (Sentinel-2)30 mMain 30 m vegetation covariates
  • LAIMODIS MOD15A2H, 8-day500 mMonthly mean covariate
  • PrecipitationCHIRPS daily~5.5 kmMonthly total covariate
  • ElevationLocal DEM30 mCovariate, floored to 100 m bins
  • Land coverESA WorldCover10 m10 one-hot class layers (cropland excluded)
  • CroplandAFCD annual crop map30 mReplaces the ESA cropland class

The resolution scale is logarithmic, from 5 m (left) to 10 km (right). Every input is brought onto the 30 m grid.

Workflow

The full monthly workflow

Workflow of the ML-based biomass downscaling, from the study grid and Earth Engine downloads to the mass-conserved 30 m GeoTIFF.
Workflow of the ML-based biomass downscaling, from the study grid and Earth Engine downloads to the mass-conserved 30 m GeoTIFF. Click to open full size.

Try it

See mass conservation in action

One coarse cell and the fine pixels inside it. The random forest gets the spatial pattern, but its average rarely matches the coarse value exactly. Mass conservation rescales the pixels so the cell's average is restored. Switch between the stages and change the coarse value to see how the fine map follows.

04 kg/m²
1.60 kg/m²
Mean of the 30 m pixels
1.84
Difference from coarse
+15.0%

The random forest adds 30 m detail from the covariates, but its average drifts away from the coarse value.

Illustrative values, not model output. The real correction uses an iterative smoothed ratio across neighbouring cells (σ = 0.5 cell, 6 iterations) rather than one scaling factor per cell, and sets water pixels to 0.

Final output

From 500 m to 30 m, January to March 2023

The 30 m maps resolve rivers, field edges and settlements that the 500 m product blurs together, yet when they are aggregated back to the coarse grid they reproduce the original values almost exactly.

Meki basin, Ethiopia (testing area): monthly biomass (kg/m² per month) for January, February and March 2023, showing the coarse 500 m input (top) and the downscaled 30 m output (bottom), on one colour scale.
Meki basin, Ethiopia (testing area): monthly biomass (kg/m² per month) for January, February and March 2023, showing the coarse 500 m input (top) and the downscaled 30 m output (bottom), on one colour scale. Click to open full size.
Consistency check for the Meki basin: the 30 m output aggregated back to the coarse grid against the coarse input, for 10,760 cells per month. R² is 0.993, 0.991 and 0.989, and the fitted lines sit on the 1:1 line.
Consistency check for the Meki basin: the 30 m output aggregated back to the coarse grid against the coarse input, for 10,760 cells per month. R² is 0.993, 0.991 and 0.989, and the fitted lines sit on the 1:1 line. Click to open full size.