Glenn County NDVI trend and crop classification

Comparing Normalized Difference Vegetation Index (NDVI) harmonic trend classification with Landsat 9 image classification.

This project used satellite imagery to analyze crop patterns in Glenn County, California. Two classification methods were compared: one based on a time-series NDVI trend model and another using a single Landsat 9 image.

Project highlights

  • Computed a harmonic trend of NDVI from multi-year Landsat 8 and 9 imagery in Google Earth Engine to capture seasonal vegetation dynamics
  • Extracted amplitude, phase, and mean NDVI from the harmonic model as input variables for crop classification
  • Applied a stratified random sampling approach in R using USDA Cropland Data Layer (CDL) data to create a balanced training dataset
  • Trained and validated a random forest classifier using both GEE-derived variables and a single Landsat 9 scene
  • Evaluated classification accuracy using producer’s and user’s metrics, and compared visual and statistical results across methods

Satellite imagery

To begin the analysis, a median composite of Landsat 8 and 9 surface reflectance imagery (2022–2024) was generated in Google Earth Engine. This natural color image provides a cloud-reduced baseline visualization of the agricultural landscape in Glenn County.

To explore vegetation seasonality, a harmonic trend analysis of NDVI was performed on the same time series. This produced three key variables:

  • Phase: timing of peak NDVI (greenness)
  • Amplitude: strength of seasonal variation
  • Mean NDVI: average greenness over time

These were combined into a phenological RGB composite, offering a vivid depiction of how crops differ not just by color, but by how their NDVI changes over time.

To isolate agricultural areas, the image was masked using a filtered version of the USDA Cropland Data Layer (CDL), revealing only cropland pixels.

For comparison, a single Landsat 9 scene was used to create a false-color composite (NIR, Red, Green), which highlights healthy vegetation in red tones.

Classifying the crops

Two separate classification models were developed to map crop types: NDVI harmonic trend classification and a Landsat 9 single-scene classification. 

NDVI harmonic trend classification

Using the phase, amplitude, and mean NDVI derived from the multi-year harmonic model, a random forest classifier was trained in R. Stratified random sampling ensured balanced training data across crop types.

Landsat 9 single-scene classification

A second model used the reflectance bands (Blue, Green, Red, NIR, SWIR1, SWIR2) from a single Landsat 9 scene taken during the growing season. While this method offers a snapshot in time, it lacks the seasonal context of the harmonic model.

Accuracy assessment

Both classification models were evaluated using a validation set derived from the USDA CDL. Accuracy was measured using producer’s and user’s accuracy for each crop class.

Harmonic trend classifier

Single-scene classifier

The classification based on the harmonic trend (GEE output) generally had a slightly lower overall accuracy compared to the classification using the Landsat 9 scene. Certain crop classes, especially those with strong seasonal cycles like corn, were classified better with the Landsat 9 imagery because it directly captured detailed spectral responses from a single, high-quality scene. 

The slightly lower accuracy in the harmonic trend classification is likely because the harmonic metrics (phase, amplitude, mean NDVI) summarize patterns over time rather than capturing the instantaneous conditions critical for distinguishing between some crop types.

Sources

Images were created from Landsat 8 and Landsat 9 data acquired from Google Earth Engine.