FormalPara Overview

The expansion of gold mining has had a large impact on the rainforests of the Amazon over the last decades. To take just one example, it has affected both the biodiversity and the lives of local people in the Madre de Dios region of southeastern Peru. In this chapter, we will review a methodology developed to generate early warnings of deforestation based on the use of synthetic aperture radar (SAR) images. First, we will identify the Sentinel-1 images suitable for the construction of a time series of preprocessed datasets. Second, we will run a change detection analysis based on a statistical analysis of the Sentinel-1 images. Finally, we will show the steps to follow in the post-processing stage by filtering information with forest/non-forest and bodies of water datasets.

FormalPara Learning Outcomes
  • Selecting and creating a multi-temporal SAR mosaic.

  • Generating SAR change detection based on a statistical analysis of Sentinel-1 images.

  • Post-processing of alerts generated by filtering maximum area patches and information of forest/non-forest and water bodies.

FormalPara Helps if you know how to
  • Import, filter, and visualize images (Part 1).

  • Work with time series data in Earth Engine (Part 4).

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

  • Use the require function to load code from existing modules (Chap. 28).

  • Export results to assets (Chap. 29).

1 Introduction to Theory

Accelerated demand for natural resources has transformed the Amazon rainforest into a new economic frontier that generates commodities such as agricultural products, livestock, and more recently, minerals, especially gold (RAISG 2020). In Peru, illegal gold mining is a serious problem that affects local populations in the southeastern region of Madre de Dios (Yard et al. 2012; Asner and Tupayachi 2017, Alvarez-Berrios et al. (2021). According to Caballero et al. (2018), it has led to the deforestation of about 1000 km2 of rainforest, affecting protected areas, Indigenous communities, and sustainable management areas. Gold mining is carried out throughout the year, even during the rainy season.

Optical Earth observation satellites have played a very important role in monitoring gold mining deforestation in recent years. Madre de Dios is one of the few tropical regions in the world for which there is well-documented information on annual forest loss due to this deforestation driver (Asner et al. 2013; Asner and Tupayachi 2017; Caballero et al. 2018; Nicolau et al. 2019; Csillick and Asner 2020; Aguirre et al. 2021). However, these resources do not reveal the progress of illegal mining during the rainy season and at other times when the optical images are obscured by clouds. This reduces the window of opportunity to know the dynamics of the activity and guide actions to control the advance of deforestation.

Satellite-based SAR sensors obtain information throughout the entire year thanks to the ability of microwaves to penetrate cloud cover (Ballère et al. 2021; Nicolau et al. 2021). Therefore, we are able to capture changes due to gold mining expansion with SAR data from the European Space Agency (ESA) Sentinel-1 C-band satellite. In this chapter, we will look at a successful example of how to process radar images to generate early warnings of gold mining deforestation.

2 Practicum

SAR sensors transmit microwave signals at an oblique angle and measure the backscattered portion of the signal in order to analyze features on the surface. Unlike optical sensors, which are passive, SAR is an active instrument with its own source of illumination, and it is one of the few sensing instruments that allows full control of the signal polarization on both the transmit and receive paths. The majority of today’s SAR sensors are linearly polarized, and transmit horizontally and/or vertically polarized wave forms (i.e., SAR bands can be VV, VH, HV, or HH). While interpreting optical imagery is similar to interpreting a photograph, interpreting SAR data requires a different way of thinking, in that the signal is instead responsive in complex ways to surface characteristics such as structure and moisture. More information about the theory and concepts behind SAR is available in the SAR Handbook (Flores-Anderson et al. 2019).

The area of study for this chapter is the region surrounding a mining corridor located in Madre de Dios in the southern Peruvian Amazon (Fig. 39.1).

Fig. 39.1
Three maps. a. A map of South America highlights the southern Peruvian Amazon. b and c highlight the location of the mining corridor located in Madre de Dios in 2006 and 2020 respectively.

Maps of (a) the area of study in the southern Peruvian Amazon and the expansion of alluvial mining activity between (b) 2006 and (c) 2020

Alluvial gold mining exploitation generates changes in the radar backscattering mechanism over forested areas, since it involves deforestation, removal of topsoil, excavation, and the use of water for the extraction of gold from the loose sediment. Figure 39.2 shows the changes in SAR Sentinel-1 images and a radar backscattering mechanism before (Fig. 39.2a) and after (Fig. 39.2b) the impact of alluvial gold mining activity.

Fig. 39.2
2 sets of illustrations. a. It denotes a radar backscattering signal from a volume scattering mechanism from the primary forest. b. The specular scattering from the water after the mining activity.

Radar backscattering mechanism from an area affected by alluvial mining activity (a) before: backscattering signal from primary forest (volume scattering); (b) after: specular scattering from bearing soil and water as a result of clearing forest cover, removing topsoil, digging pits, and using water in the extraction process of gold from the loose sediment

Therefore, you will learn how to use SAR Sentinel-1 time series to detect changes generated by alluvial gold mining activities in forested areas.

The first step is to create a SAR mosaic for a given period of time and orbit pass. Then, we will apply the omnibus Q test algorithm to generate change alerts from the SAR Sentinel-1 time series. Finally, we will filter and eliminate potential false positive alerts coming from other activities with the same temporal pattern as the mining activity (e.g., natural forest loss by river expansion or water over bare soil during the rainy season).

2.1 Section 1: Creating a Single SAR Mosaic

We will use ESA’s Sentinel-1 dual-polarized (VV + VH) in descending orbit pass to create a single SAR mosaic over the area of study. Sentinel-1 SAR Ground Range Detected (GRD) data (Fig. 39.3) are stored in Earth Engine in two formats: logarithmic scale (dB) and the original values (power scale named as FLOAT). We will use the latter since mathematical operations should not be applied into data on a logarithmic scale. The Sentinel-1 dataset is composed of Level-1 SAR amplitude multi-look images preprocessed according to the following steps: orbit metadata update, removal of border and thermal noise, radiometric calibration, and terrain correction.

Fig. 39.3
A screenshot of sentinel 1 S A R Ground range detected data stored in the earth engine in log scaling. It denotes the details of dataset availability, dataset provider, earth engine snippet, tags, and description.

Sentinel-1 imagery available in the Earth Engine data catalog

Fig. 39.4
A screenshot of the Google Earth engine highlights the mining corridor located in the Madre de Dios region.

Area of study around the mining corridor located in the Madre de Dios region

Copy and paste the code below to define the area of study (Fig. 39.1), convert this vector to a boundary image, and add it to the map (Fig. 39.4).

17 lines of code denote section one which defines the area of study, centers the map at the a o i, creates an empty image, converts the area of study to an E E image, visualizes only the boundary, selects satellite base map view, and adds the area of study boundary to the map.

Next, copy and paste the code below to define two functions, maskAngle and getCollection. The first function masks sections of SAR images acquired at an incidence angle less than 31° or greater than 45°. The second function filters the Sentinel-1 imagery to a specific period of time, region of interest, and orbit pass. Note that the Sentinel-1 GRD dataset is imported inside the second function.

14 lines of pseudo-code present function to mask the S A R images acquired with an incidence angle, lower or equal to 31 and greater or equal to 45 degrees. It also denotes a function to get the S A R collection.

Copy and paste the code below to import the Sentinel-1 collection, define time variables (a list of dates) and the orbit pass variable, apply the functions, create a mosaic by using the mosaic function, and clip the mosaic to the study area.

8 lines of the pseudo-code to define variables of the period of time and the orbit pass, and apply the function to get the S A R mosaic.

Before adding the mosaic to the map, it’s important to scale the values to a logarithmic scale (log10().multiply(10.0)). The parameters of visualization (sarVis) should be taken between 3 and −23 dB (decibels). Copy and paste the code below to do so and to add the mosaic to the map (Fig. 39.5). The code creates a scaled image and draws it using visualization parameters set through trial and error.

Fig. 39.5
A screenshot of Google Earth Engine represents the map of a location. It highlights a certain section in the middle within a rectangular block.

SAR Sentinel-1 mosaic generated in previous section

9 lines of pseudo-code to apply logarithmic scale and visualize results. It obtains minimum and maximum values at the end.

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

Question 1. How many bands (polarizations) does Sentinel-1 have over the area of study?

Question 2. Using the Inspector tool, explore the values from the VV and VH bands over different land covers. Which one do you think is better able to detect forested areas?

2.2 Section 2: Creating a SAR Mosaic Time Series

We will reuse most of the code from Sect. 39.2.1, only changing the period of time and not applying the mosaic function just yet. Start this section by opening the following code checkpoint.

Code Checkpoint A18b. The book’s repository contains a script to use to begin this section. You will need to start with that script and paste code below into it.

Expand the SAR ImageCollection in the Console and note that it is composed of 30 elements. To create a time series of mosaics, we need to define two additional functions (getDates and mosaicSAR). The first function converts the format of the date from milliseconds to format ‘YYYY-MM-dd’. The second function filters the SAR ImageCollection using the list of dates and generates a mosaic. The result is an ImageCollection of mosaics per date. Copy and paste the code below to define these two functions.

16 lines of the pseudo-code represent the function to get dates in year, month, and day format, and the function to get a S A R mosaic clipped to the study area.

Now, copy and paste the code below to generate a list of dates without duplicate elements (i.e., where there are images from the same dates in the collection, we only keep one). We avoid duplicates by using the ee.List.distinct and the getDates functions and output an ImageCollection of mosaics per date.

9 lines of the pseudo-code present the functions to get a S A R collection of mosaics by date and get a S A R list and an image collection of mosaics by date.

Finally, copy and paste the code below to set the visualization parameter (sarVis) and add two SAR mosaics filtered by the date of acquisition as an example (one from 2021-01-04 and the other from 2021-12-18; Fig. 39.6).

Fig. 39.6
A screenshot denotes a code, a map, and an inspector tool that compares the before and after values of V V and V H S A R bands using a bar graph. A specific region from the map is highlighted for the comparison.

SAR Sentinel-1 mosaics generated in Sect. 39.2.2. The Inspector tool shows a comparison between before and after values of VV and VH SAR bands

A set of 14 lines of pseudo-code to visualize results. It adds 2 mosaics filtered by the date.

Note that we applied the logarithmic scale for visualization purposes. Zoom in and switch between the layers to note the differences between the images.

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

Question 3. How many images were taken by Sentinel-1 over the area of study between 2018-01-01 and 2020-01-01?

Question 4. Using the Inspector tool, explore the temporal changes of the values from VV and VH bands over new mining areas.

2.3 Section 3: Generate SAR Change Detection

There are different methods for detecting changes using SAR data. In this case, we will use a SAR change detection method based on Canty et al. (2020).

This methodology allows us to identify changes for a series of ‘k’ uncorrelated SAR images using a pixel-based omnibus likelihood ratio test statistic Q for covariance matrices (∑i, i = 1... k), based on a Wishart distribution. The Q test is defined by

$$\ln Q = n\left( {pk\ln k + \sum\limits_{{i = 1}}^{k} {\ln |X_{i} | - k\ln \left| {\sum\limits_{{i = 1}}^{k} {X_{i} } } \right|} } \right)$$

where Xi = nΣ* (with Σ* being the maximum likelihood estimate of the covariance matrices Σi), ‘n’ the number of looks, and ‘p’ the dimensionality of the covariance matrices (with p = 2 for dual polarización SAR data). The | ⋅ | denotes the determinant.

The Q test is an omnibus test statistic because it evaluates the equality of several covariance matrices simultaneously. Thus, this test statistic tests the null hypothesis (no change, H0) against alternative hypothesis (change, H1) using SAR time series pixel-based data and the level of significance (probability that the null hypothesis H0 is true, also known as p-value) estimated in each iteration.

In the first iteration, the first two first images in the time series are tested (null hypothesis of no change against the alternative of change):

  1. (1)

    \(\text{H}_{0} :\Sigma _{1} = \Sigma _{2}\) against \(\text{H}_{1} :\Sigma _{1} \ne \Sigma _{2}\) → Null hypothesis rejected?

If the null hypothesis (H0) is not rejected, then the test continues including the values of the next image in the series:

  1. (B)

    \(\text{H}_{0} :\Sigma _{1} = \Sigma _{2} =\Sigma _{3}\) against \(\text{H}_{1} :\Sigma _{1} = \Sigma _{2} \ne\Sigma _{3}\) → Null hypothesis rejected?

However, if the null hypothesis is rejected in this iteration, then the interval of time for this change is labeled and the test is restarted from there.

The explanation of the Omnibus likelihood ratio test statistic is beyond the scope of this chapter but more details can be found in Canty et al. (2020).

The next steps correspond to obtaining a single change detection output image using the time series of mosaics generated in Sect. 39.2.2.

To do so, we will use modules adapted from the original JavaScript libraries by Canty et al. (2020). Beginning from the last code checkpoint from Sect. 39.2.2, copy and paste the code below to import the adapted modules and define a variable that stores the number of images in our collection. This number will be used later on for visualization purposes.

15 lines of the pseudo-code present libraries of SAR change detection, the original version is found in change detection under Mortcanty, which is under the users. There is a function to count the length of the list of dates of the time series.

Before applying the SAR change algorithm, we need to define the input parameters such as the significance and the reducer to be applied (median in this case). The result is an ee.Dictionary that contains several images: among these are cmap, smap, fmap, bmap. The cmap image shows the occurrence of the most recent significant change, smap shows the first significant change, fmap shows the frequency of significant changes, and bmap shows the interval in which each significant change occurred.

Copy and paste the code below to define such variables, apply the algorithm to the list of SAR mosaics (getMosaicList), and extract the results.

20 lines of pseudo-code to run the algorithm and print the results, change maps generated such as c map, s map, f map, and b map, extract and print the image results from the e e dot directory.

The values for cmap, smap, and bmap are numbers that correspond to dates. These are the dates that are stored in the datesMosaic list. For example, the pixel value of 0 corresponds to the first date (2021-01-04), the pixel value of 1 corresponds to the second date (2021-01-16), and so on (Fig. 39.7).

Fig. 39.7
A table represents the details of the p r o p dates for the system index ranging from 0 to 29. The dates are ranging from the fourth of January to the eighteenth of December 2021.

List of dates to be exported as a CSV file. Each value (index) is associated with a specific date of change of the raster file (smap)

If we want to export the resulting images, we need to also export the list of dates. To do so, we need to create a FeatureCollection since we can’t currently export lists directly in Earth Engine. Copy and paste the code below to create a FeatureCollection where each feature contains the date information as a property. We are also printing the dates in order to visualize the pixel-date association (expand the list on the Console to see it.)

A text box presents 8 lines of pseudo-code to build a feature collection from dates and print the results.

Now, we can add the results to the map. Copy and paste the code below to define visualizations parameters, make a legend that associates date numbers with colors, and add the resulting images (Fig. 39.8).To load results faster, change the Map.centerObject function at the top of the script to Map.setCenter (−70.003, −12.849, 12)we are zooming in to a specific areaand leave only the smap layer checked under the Layers panel.

Fig. 39.8
A screenshot of the Google Earth Engine denotes the S A R change detection results from applying the Q test algorithm.

SAR change detection results from applying the Q test algorithm

A text box presents 12 lines of pseudo-code to visualize the parameters and add resulting images and legend to the map.

Now, copy and paste the code below to export two items to Google Drive: fCollectionDates, the dates of SAR images processed (Fig. 39.7); and smap, the image of the first significant change (Fig. 39.8).

A text box presents 16 lines of pseudo-code to export the feature collection with the dates of change and export the image of the first significant changes.

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

Question 5. What is the difference between the smap and cmap images?

Question 6. How does the FeatureCollection fCollectionDate relate to the change maps smap, cmap, and fmap?

2.4 Section 4: Filtering and Post-processing Alerts

As explained earlier in the Practicum, the smap results need to be filtered in order to eliminate possible false positives. The false positives are associated with the forest loss due to river morphology and the presence of muddy water bodies (Fig. 39.2).

In this section, we will explore different options to filter false positives and, therefore, post-process the results generated.

Like we did in previous sections, copy and paste the code below into a new script to import the study area and the exported smap image. Remember that our analysis covered 30 Sentinel-1 images from distinct dates.

A text box presents 32 lines of pseudo-code. It defines the area of study, centers the map, creates an empty image, converts the area of study to an E E image object, selects the satellite base map view, adds the area of study boundary to the map, and visualization parameters.
A text box presents 32 lines of pseudo-code. It defines the area of study, centers the map, creates an empty image, converts the area of study to an E E image object, selects the satellite base map view, adds the area of study boundary to the map, and visualization parameters.

Next, copy and paste the code below to import from the Earth Engine data catalog and add to the map all the sources of information for filtering false positives: Shuttle Radar Topography Mission (SRTM) digital elevation data, Hansen Global Forest Change data, and JRC Global Surface Water data (Fig. 39.9).

Fig. 39.9
4 sets of photographs, a and b denote Shuttle Radar Topography Mission digital elevation and slope data. c denotes Hansen global forest change data, and d indicates J R C global surface water data.

Layers used to filter false positives alerts: (a) SRTM elevation, red color shows areas over 1000 m above sea level; (b) SRTM slope, red color shows areas with slope over 15°; (c) Hansen Global Forest Change, green color shows forested areas updated to 2020; (d) JRC Yearly Water Classification History, blue color shows the maximum extent of water surface detected from 1984 to 2020

A text box denotes 40 lines of pseudo-code to import the data of digital elevation model S R T M, Hansen global forest change data, and J R C global surface water data from the Earth Engine data catalog.
A text box denotes 40 lines of pseudo-code to import the data of digital elevation model S R T M, Hansen global forest change data, and J R C global surface water data from the Earth Engine data catalog.

You can toggle these layers on and off, zoom in and out, and inspect pixel values to analyze them.

The SRTM elevation layer (‘SRTM Elevation’) and the slope (‘SRTM Slope’) derived from it with ee.Terrain.slope show red areas that correspond to an altitude over 1000 m above sea level and a slope over 15°, compared to blue areas, which are closer to sea level or to flat terrain. We chose these options because mining activity in this region is located in lowlands. Furthermore, the SAR Sentinel-1 data provided by Earth Engine are not radiometric-terrain corrected. So, steep slopes (> 15°) generate distortions in SAR images, and therefore, potential false changes between two or more images taken at different times.

The Hansen Global Forest Change data are composed of forested areas in 2000 (the ‘treecover2000’ band) and the forest loss between 2001 and 2020. In this sense, the binary layer ‘Forest cover 2020’ previously generated and added shows in green the forested areas updated until 2020, with all the non-forested and the forest loss between 2001 and 2020 areas masked.

The JRC Yearly Water Classification History data show surface water extent and change between 1984 and 2020. The binary layer ‘Water Bodies until 2020’ previously added shows in blue the water bodies’ maximum extent between 1984 and 2020. Non-water bodies are shown in black.

Note that alluvial mining expansion pattern in the study area is associated with primary forest loss and the appearance of new surface water patches (Fig. 39.2).

Now, we will filter the false positives based on thresholds. We will mask any pixel in smap marked as changeover areas greater than 1000 m above sea level, slope greater than 15° according to the SRTM data (classified as forest until 2020 by the Hansen data), and that are not classified as water bodies by the JRC dataset. Copy and paste below to add the filtered results to the map.

A text box presents 16 lines of the pseudo-code to apply filters through masks and add filtered results to the map.

We can still improve the results a bit more. Copy and paste the code below to define and apply a function that eliminates small pixel patches and isolated pixels. We do this because we know that in this area, mining activities occur in areas of at least 0.5 ha.

A text box presents 11 lines of the pseudo-code. It denotes the function to filter small patches and isolated pixels and apply the function and visualize the filtered results.

Turn off all the other layers to visualize the filtered result. By analyzing the results without the filters and with the filters, we can see that we eliminated most of the false positives (Fig. 39.10).

Fig. 39.10
2 sets of photographs denote the comparison results of the unfiltered and filtered false positives. The filtered part indicates the mining region.

A comparison of results, after (‘Alerts Filtered - Minimum Patches’) and before filtering false positives (‘Change Map Unfiltered’)

Finally, we can export the outcome. Copy and paste the code below to export to the Drive.

A text box represents 7 lines of the pseudo-code to export filtered results to the drive.

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

3 Synthesis

In this chapter, we mapped the changes generated by the alluvial mining activity over a forested area and between a period of time using Sentinel-1 SAR time series. For this, we separated the methodology into three steps. First, we were able to build a time series from Sentinel-1 mosaics. Second, we estimate all the changes based on the omnibus Q test change detection algorithm. Finally, we filter the detected changes based on existing forest/non-forest, water bodies, and elevation data, and a minimum mapping unit in order to retrieve the changes generated by the alluvial mining activity only.

Now, it’s your turn to explore the use of the methodology.

Assignment 1. In this chapter, we applied the methodology for a given SAR orbit. Describe how we could identify the different SAR orbits over a specific area of study.

Assignment 2. Describe whether these alerts, which are generated by a change detection algorithm, are different for the ascending or descending orbit over our area of study.

4 Conclusion

In this chapter, you have learned how to analyze the changes generated by alluvial mining activity over forested areas based on the application of a SAR change detection methodology. This is possible because of the significant impact generated by this activity over the environment (that is, the deforestation and the use of water in the alluvial gold wash machine) that is reflected in the backscatter signal of SAR data. This methodology can be applied to other study cases since a good understanding of the principles of change detection has been achieved in this chapter and complemented by Chaps. 16 through 21.