Janus / Guides / CODED

Change detection · forest degradation

CODED and the NDFI, step by step.

Logging and understory fire leave a forest standing, and most indices barely see them. The NDFI does: it splits every pixel into green vegetation, dead wood, soil and shade. CODED models it over a training period and calls a change when it falls well below, then tells degradation (still forest after) from deforestation.

01The idea

Spectral mixture analysis reads each pixel's six reflectances as a mix of a few pure materials, the endmembers: green vegetation (GV), non-photosynthetic vegetation (NPV: dead wood, dry leaves), soil, shade and cloud. The NDFI (Normalized Difference Fraction Index, Souza et al. 2005) combines them:

NDFI = (GVshade − (NPV + soil)) / (GVshade + NPV + soil)

where GVshade is the green vegetation normalized by the shade. Closed forest is near 1; a canopy opened by logging or a fire drops, while it still reads as forest to the NDVI; pasture and bare soil go below 0.

CODED (Continuous Degradation Detection, Bullock et al. 2020) fits a harmonic model of the NDFI over a training period, then watches every later observation: a few in a row far below the model are a change. After it, a new model; if its mean NDFI is still that of a forest, the change was degradation, otherwise deforestation.

Both need Landsat-style surface reflectance (blue, green, red, NIR, SWIR1, SWIR2) with real dates; CODED also needs at least two observations a year, and a quality band helps both.

02The example

The same Landsat 8 and 9 series as the CCDC guide: 125 dates, February 2020 to August 2026, of central Rondônia, with its QA_PIXEL band. The map is zoomed in on a forest cleared in May–June 2022, 261 × 196 pixels around it.

03The NDFI

Tools → Spectral analysis → NDFI (spectral unmixing) unmixes every observation with the endmembers of Souza et al. (2005). Run on the raster, it writes the NDFI of every date as a new series, opened as a layer over the others, ready for LandTrendr, BFAST or the agreement; and three maps: the mean NDFI, the lowest, and the observations used.

The NDFI tool's window: its bands, the reflectance units, max cloud fraction 0.05, the option to write the fractions too, and the run on the raster.
The NDFI tool. Also write the fractions adds the GV, NPV, soil and shade series.
The NDFI of July 2022 as a layer: forest in green near 1, the fields and the clearing in brown below 0; the chart shows the cleared pixel's NDFI falling from 1 to below 0 in 2022.
The NDFI layer, July 2022, over the area of the run (the series shows around it): the clearing is already brown, below 0. On the chart, the cleared pixel's NDFI after mid 2022.

Max cloud fraction (0.05) leaves out the observations whose unmixed cloud fraction is larger: thin clouds and haze the quality band missed.

04CODED on the chart

Tools → Change detection → CODED (degradation). Its bands are found as for CCDC. On the chart, with the layer showing a normalized difference, CODED adds the NDFI of each observation, the training mean, and a vertical line at each change.

CODED's window with monitoring from 2022 and two years of training; on the chart the NDVI of the cleared pixel, the NDFI of each observation and a change line in 2022; the Statistics table with the training, the stratum and the change.
The clearing: trained as forest (mean NDFI 1.0 over 9 clear observations of 2020–2021), then a deforestation in May 2022: the NDFI fell by 1.19, to 0.14.
The chart: the NDVI series, the NDFI of each observation dropping from near 1 to below 0 after mid 2022, and the change line.
The NDFI (dark dots) and the change.
The Statistics table with CODED's rows: the training, its observations, the stratum and the change with its date and NDFI change.
Its rows in the Statistics table.

The forest opened in 2021 and partly grown back reads differently:

The chart of the opened forest with CODED's NDFI and change.
An opened forest.
The Statistics table for the opened forest.
Trained as barely forest (mean NDFI 0.50, the canopy already open), a change in July 2023, read as deforestation.

05The parameters

ParameterDefaultWhat it does
Reflectance unitsautoThe endmembers are reflectances: 0–1, × 10000 or Collection 2 digital numbers, detected from the values.
Monitoring start0The year monitoring starts; the training period is before it. 0: the training starts with the series. Here 2022.
Training period3Years of training, whose NDFI model the monitoring compares with. Here 2, all the series has before 2022.
Consecutive observations3Observations in a row beyond the threshold that make a change.
Threshold (RMSEs)3How far below the model, in RMSEs of the training fit.
Years after a change3Modelled as the land after a change, and the least time between two changes.
Min observations6Least observations to fit a model.
ChangeslossOnly drops of the NDFI, as CODED, or rises too.
Max changes3Changes kept per pixel.
Forest NDFI0.5A model with a mean NDFI at least this is forest: before the change (forest or not), after it (degradation or deforestation).
Max cloud fraction0.05Observations with more unmixed cloud are left out.

06The maps

Run over the visible area (14 s here; about 80 s for the whole 1.2 million pixels), CODED maps:

CODED's strata over the area: forest, non-forest, degradation, deforestation and disturbance, with the legend in the Layers panel.
Strata: forest (green), non-forest (beige), degradation (orange), deforestation (red), disturbance (purple).
MapMeaning
StrataForest, non-forest, degradation, deforestation, or disturbance (a change outside forest).
First / last change dateThe earliest and the latest change.
NDFI change at the first changeThe NDFI after it minus before it.
ChangesHow many changes.
Mean NDFI of the training periodWhat the land was before.
The date of the first change over the area.
First change date.

07How strict

With only two years of training, about nine clear observations, the model of a forest pixel is tight, and ordinary variation from one dry season to the next crosses 3 RMSEs: above, much of the standing forest reads as degraded. At 5 RMSEs only the strong drops are left: the clearings, in red, and far less orange. There is no right threshold in general. Check it on pins over forest you know untouched and over logging you know of, and give CODED a longer training period when the series allows.

CODED's strata with a threshold of 5 RMSEs.
Threshold 5 RMSEs.

08What next

  • Every band, every break: CCDC on the same series.
  • The NDFI series in other tools: LandTrendr on yearly NDFI composites, BFAST on a regular NDFI series.
  • Validate the strata: they are a map of classes with change in it; see the Validation guide.
  • Script it: zeit.unmix and zeit.coded in Python.

09References

  • Bullock, E. L., Woodcock, C. E., Olofsson, P. (2020). Monitoring tropical forest degradation using spectral unmixing and Landsat time series analysis. Remote Sensing of Environment, 238, 110968.
  • Souza, C. M., Roberts, D. A., Cochrane, M. A. (2005). Combining spectral and spatial information to map canopy damage from selective logging and forest fires. Remote Sensing of Environment, 98, 329–343.
  • Zeit: the change detection library behind the tools of Janus.