FormalPara Overview

The purpose of this chapter is to present two methods of land cover extent change detection: map-to-map and map-to-image using anomaly data. In a map-to-map approach, changes are extracted by subtracting a two-date pair of land cover extent maps: that is, time 2 (T2) extent minus time 1 (T1) extent. By comparison, a map-to-image approach uses a baseline extent map within which changes are calculated based on a T2 image where the change classes are defined by threshold values. In this chapter, we will perform a map-to-map change detection between two mangrove extent maps from 2000 and 2020 and also perform a vegetation index anomaly analysis to detect changes within a mangrove extent map from the year 2000 in Guinea, West Africa.

FormalPara Learning Outcomes
  • Performing change detection by contrasting two pre-existent mangrove extent maps.

  • Harmonizing across Landsat generations to create consistent long-term series.

  • Calculating the anomaly of a given vegetation index based on its long-term average value.

  • Performing change detection by interpreting vegetation index anomalies.

Helps if you know how to

  • Recognize similarities and differences among satellite spectral bands (Part I, Part II, Part III).

  • Perform basic image analysis: select bands, compute indices, create masks (Part II).

  • Use normalizedDifference to calculate vegetation indices (Chap. 5).

  • Perform a supervised image classification (Chap. 6).

  • Work with array images (Chaps. 9 and 18).

  • Use expressions to perform calculations on image bands (Chap. 9).

  • Summarize an image with reduceRegion (Chap. 9).

  • Write a function and map it over an ImageCollection (Chap. 12).

  • Mask cloud, cloud shadow, snow/ice, and other undesired pixels (Chap. 15).

  • Perform a two-period change detection (Chap. 16).

1 Introduction to Theory

Mangrove forests are among the most productive ecosystems on Earth, providing a wide range of critical economic, ecological, and societal services. However, mangroves worldwide have undergone intense conversion, with human-related disturbances being one of the main causes of global mangrove loss in recent decades (Goldberg et al. 2020). Thus, regular monitoring of the dynamics of mangrove ecosystems worldwide is key for establishing better coastal management policies and mangrove conservation initiatives.

Readily available, low-cost, and repeated-coverage remote sensing data provides numerous advantages for monitoring mangrove forests and detecting changes in the landscape over time. In this context, the Landsat data archive, which covers more than 35 years, has been widely used for mapping land cover dynamics worldwide. Most notably, the Landsat mission coupled with Google Earth Engine’s computing infrastructure have been leveraged to develop widely used global datasets at 30 m spatial resolution, such as the global forest cover (Hansen et al. 2013) and global mangrove extent (Bunting et al. 2018) datasets.

However, as extensively explored in the literature, change detection using remotely sensed data is challenged by several factors, including (but not limited to) the following: spatial, spectral, thematic, and temporal constraints, atmospheric conditions, high cloud-coverage, and differences in sensors’ spectral characteristics. These differences may have a direct effect on the ability to accurately detect and monitor changes in the landscape, including mangrove forests. As explored by Roy et al. (2016), the Landsat TM/ETM + and OLI sensors present small but potentially significant differences between their spectral characteristics, with the greatest differences in the near-infrared (NIR) and the shortwave infrared (SWIR) bands—the most important spectral bands for vegetation studies.

In this chapter, we take advantage of the statistical functions presented in Roy et al. (2016) to transform between the comparable TM/ETM + and OLI bands in order to ensure inter-sensor harmonized spectral information and temporal continuity. We will use this harmonized Landsat TM/ETM + /OLI collection to derive anomaly-based changes in mangrove extent over 21 years (2000–2020) in Guinea, West Africa.

2 Practicum

2.1 Section 1: Map-To-Map Change Detection

Previous chapters demonstrated how to perform a general supervised classification, as well as how to apply those classifiers and functions to create a mangrove extent map (Chap. 47). In this section, we will build upon those techniques to perform a map-to-map change analysis. Paste the code below into a new script, which will access pre-created assets for two time periods: 2000 and 2020.

3 lines of code for the following functions, v a r area of study, v a r mangrove 2000, and v a r mangrove 2020.

Start by setting the map center around Conakry, Guinea, and adding your 2000 and 2020 mangrove extent to the map using a color of your choice and naming them ‘Mangrove Extent 2000’ and ‘Mangrove Extent 2020’:

4 lines of code for the following functions, Map dot set Center and Map dot add Layer.

Because the assets have the value of 1 (one) assigned to mangrove pixels and 0 (zero) to everything else, you can derive losses and gains from both mangrove extent maps with a simple subtraction of T1 (2000) from T2 (2020). The value of 1 has been assigned to mangrove pixels and everything else has been masked. For the mathematical operation between the two layers to work, every pixel has to have a value assigned to it. In this case, you can unmask previously masked pixels and assign the value 0 to them using unmask(0). Finally, subtract T1 from T2 into a new variable change:

A 3-line code for the following functions, v a r m a n g 2020, v a r m a n g 2000, and v a r change. I

Pixels in the raster change will have values of − 1, 0, or 1, which represent loss/conversion, no change, and gains, respectively:

  • − 1 = no mangroves in 2020, mangroves in 2000 (0 − 1 =  − 1);

  • 0 = mangroves in 2020, mangroves in 2000 (1 − 1 = 0);

  • 1 = mangroves in 2020, no mangroves in 2000 (1 − 0 = 1)

Finally, add change to the map:

A 10-line code of the javascript for the following functions, v a r palette CHANGE and Map dot add Layer. The palette change list 3 colors, where red denotes loss and conversion, white denotes no change, and green denotes gain and expansion.

You can calculate the area of expansion/conversion by isolating the pixels of gain/loss from the change into gain and loss. Then, calculate the area of each pixel using ee.Image.pixelArea and multiplying by the count of pixels in gain and loss using multiply. The default unit is square meters (m2). You can use divide to transform into square kilometers (divide(1000000)) or hectares (divide(10000)). Finally, use ee.Reducer.sum to sum all area values for both gain and loss and print them to the Console (Fig. 48.1).

Fig. 48.1
A screengrab of a map where the dark-shaded areas represent loss, conversion, or no change, and light-shaded areas represent gain or expansion.

Map-to-map changes in mangrove extent in Guinea from 2000–2020

A 16-line code of the javascript for the following functions, calculate the area of each pixel and sum all the areas.
A 6-line code of the javascript for the following functions, Map dot set Center and Map dot add Layer. It exhibits the palette greens as gain and palette red as loss.

Code Checkpoint A33a. The book’s repository contains a script that shows what your code should look like at this point.

Question 1. What are some of the issues that may arise when using a map-to-map change detection? Explain how these different dates may affect the classification output and, consequently, the change output.

2.2 Section 2: Map-To-Image Change Detection

Using the mangrove extent you created in the previous section, we will look at another way to detect changes without having to classify an image. In this case, change classes are defined by threshold values of a specific metric, such as a vegetation index or a spectral image band. In this section, we will take advantage of the Landsat archive to create an average reference value of a given vegetation index at an earlier date T1 and see how it compares to its later value at T2.

The first assumption of this approach is that changes will happen within a buffer zone from the baseline extent. Start by setting the baseline extent and buffer zone using focal_max:

A 9-line code of the javascript for the map to image change detection. It includes the var data type and color code in hexadecimal value. It uses a map dot add layers.

2.2.1 Harmonizing Landsat 5/7/8 Image Collections

As described in the beginning of this chapter, the Landsat TM/ETM + and OLI sensors present differences between their spectral characteristics. Thus, to ensure inter-sensor harmonized spectral information and temporal continuity, we will harmonize the entire Landsat image archive using the statistical functions presented in Roy et al. (2016). For that, start by defining the temporal parameters for the harmonization:

A 4-line code of the javascript. 1. Var start year = 1984 semicolon. 2. var end year = 2020 semicolon. 3. var start day = 01-01 semicolon. 4. var end day = 12-31 semicolon.

Next, we will create several functions for the harmonization of the Landsat archive:

Harmonization Function: harmonizationRoy uses the regression coefficients (slopes and intercepts) retrieved from Roy et al. (2016) and performs a linear transformation of ETM + spectral space to OLI spectral space:

A 15-line code of the javascript for the harmonization function. Var harmonization Roy = function of oli. It returns y dot to short value.

Retrieve a Particular Sensor Function: getSRcollection will be used to retrieve individual sensor collections based on the temporal parameters and the harmonization function above. Additionally, this function will mask cloud, cloud shadow, and snow based on the Landsat quality assessment bands:

A 26-line code of the javascript for the retrieve a particular sensor function. It uses get S R collection function. It includes the cloud, cloud shadow, and snow mask. It return s r collection.

Combining the Collections Function: getCombinedSRcollection will merge all the individual L5/L7/L8 collections into one:

A 6-line code of the javascript for combining the collections function. It uses get combined S R collection function of individual L 5, L 7, L 8 year, start day, end year, and end day.

Vegetation Indices: addIndices calculates several vegetation/spectral indices based on the harmonized Landsat bands. In this example, we are including the Normalized Difference Vegetation Index (NDVI), the Enhanced Vegetation Index (EVI), the Soil Adjusted Vegetation Index (SAVI), the Normalized Difference Mangrove Index (NDMI), the Normalized Difference Water index (NDWI), and the Modified Normalized Difference Water Index (MNDWI). Here is where you can include your own vegetation indices:

An 8-line code of the javascript for the vegetation indices. It includes the var data type and addIndices function.
The continuation of the last code includes 11 code lines for the vegetation indices. It includes the var data type and addIndices function.

Finally, collectionSR_wIndex will include the final harmonized collection with all the sensors based on the temporal parameters defined previously, with all spectral bands and vegetation/spectral indices:

A code line reads, var collection S R underscore w Index equals get Combined S R collection left parenthesis start Year, start Day, end year, end Day right parenthesis dot map left parenthesis add Indices right parenthesis semicolon.

Filter this collection by the bounds of the area of study:

A code line reads, v a r collection L 5 L 7 L 8 equals collection S R underscore wIndex dot filter Bounds left parenthesis area Of study right parenthesis semicolon.

Question 2. Based on your knowledge and the functions described above, what are the main fundamental differences between Landsat TM, ETM+, and OLI?

Question 3. What are the issues that may arise when using the same function for calculating vegetation indices using surface reflectance data acquired by ETM + and OLI sensors?

Vegetation Index Anomaly

By definition, anomaly is anything that deviates from what is standard, normal, or expected. Usually, anomalies are calculated by subtracting a long-term average of a variable from the actual value of that variable at a given time. For example, if X = actual value of average NDVI for mangroves in 2020, and Y = long-term average NDVI of mangroves (an average over many years), then the anomaly = X − Y. If the anomaly values are zero (or very close to zero), it means that NDVI remained relatively stable in that period, which indicates that there has not been any significant disturbance in that area. On the other hand, a positive anomaly means that the NDVI signal is greater than its long-term average, which indicates that vegetation has shown growth in that area; similarly, a negative anomaly means that the NDVI signal is weaker than its long-term average, indicating a potential loss in the area.

To calculate the anomaly, start by defining the index you want to compute the anomaly for and the reference period to get the average value. In this example, we are going use the 16 years before the mangrove extent baseline in 2000:

A 3-line of the javascript. It includes var data types. It exhibits the start of the period, 1984-01-01, and the end of the period, 1999-12-31.

Next, create the reference collection using collectionL5L7L8 and the parameters above. You can print the size of this reference collection to the Console using print and size:

A 5-lines of the javascript to print the number of images in the reference collection.

You can now calculate the mean value (and other statistics) for the reference collection reference. Mask the results by the baseline mangrove extent using extentBuffer:

A 4-lines of the javascript for the following functions, v a r mean, v a r median, v a r max, and v a r min.

Now that we have our long-term reference metrics, you can define the period for which you want to compute the gains and losses. In this example, we will use the full period of 2000–2020. However, any combination of years is possible depending on what period you are interested in. Then, an anomaly function can be created to subtract the metric from the average of your period of interest:

A 6-line code of the javascript for the following functions, v a r period underscore start, v a r period underscore end, and v a r anomaly function. It returns the image dot subtract.

Finally, map the anomalyfunction to the Landsat collection filtered by your period_start and period_end:

A 3-line code of the javascript. It includes the var data type and, series dot select, extent buffer.

The object series will have all the spectral bands and vegetation/spectral indices for the time period defined above. Their values, however, will be different from the original collection since we subtracted the average value of the reference period. The next step is to sum all the values for the index from series and divide by the number of images available:

Add the anomaly layer to the map using a color ramp of your choice (Fig. 48.2):

Fig. 48.2
A map where different colored areas represent negative anomaly, no charge, and positive anomaly.

NDVI anomaly for the period of 2000–2000

A 6-line code of the javascript. The line reads var vis anon = open curly brace, min negative 0.20, max 0.20, palette includes 9 color code, map dot add layer anomaly, vis anon index + anomaly, semicolon.

You can then extract loss areas by selecting a value threshold on the anomaly (Fig. 48.3):

Fig. 48.3
A map where different colored areas represent negative anomaly, no charge, and positive anomaly.

NDVI anomaly losses (orange) and gains (blue) based on change threshold values

A 6-line code of the javascript for the following functions only shows the losses within the mangrove extent of the year 2000 and only the gains within the mangrove extent buffer of the year 2000.

Code Checkpoint A33b. The book’s repository contains a script that shows what your code should look like at this point.

Question 4. What are the main challenges of a map-to-image change detection approach? Think from a perspective of baseline extent, spectral index, and metric used (e.g., mean versus median).

3 Synthesis

With the content covered in this chapter, you will be able to reproduce a map-to-map and a map-to-image change detection to your own area of interest. Additionally, the anomaly analysis can be used to detect changes in other land cover types, including (but not limited to) forests (forest cover loss) and agricultural land (crop harvest).

Assignment 1. Practice your land cover classification skills by using the code in script A33s1—Supplemental in the book's repository. In this code, we show how to create a mangrove extent map for Guinea using manually and automatically selected samples. The code covers masking techniques and using data from Google Earth Engine Catalog to assist in the classification workflow. Using the techniques you have learned, create two 30 m Landsat-based mangrove extent maps for the year of 2000 and 2020 for Guinea, West Africa.

Assignment 2. Using what you learned in this chapter, compile the areas (in km2) of mangrove change in Guinea derived from the anomaly analysis using: (a) vegetation spectral index versus a water-based spectral index; (b) mean versus median; and (c) five-year intervals (2000–2005, 2005–2010, 2010–2015, and 2015–2020.

Assignment 3. Practice the classification and compare the map-to-map and map-to-image change approaches for another land cover type/area of your choice, such as the following:

  • Agricultural land expansion in the Nile Delta, Egypt.

  • Forest burn/loss near Mount Hood, Oregon, United States.

4 Conclusion

Google Earth Engine’s computing infrastructure has been revolutionizing time-consuming remote sensing processes, creating a new way for rapid land cover classification and change detection at large scales. In the case of mangrove forests—a highly dynamic ecosystem that has been under increasing anthropogenic pressure—these approaches allow for a rapid and consistent monitoring of change in extent over time. These approaches using Earth Engine may be particularly useful for developing countries where, until very recently, the high computational power and the difficulties of distributing nontrivial classification algorithms across multiple computational workstations has challenged classification and change detection at large scales.