FormalPara Overview

Shallow-water coastal benthic habitats, which can comprise seagrasses, sandy soft bottoms, and coral reefs are essential ecosystems, supporting fisheries, providing coastal protection, and sequestering ‘blue’ carbon. Multispectral satellite imagery, particularly with blue and green spectral bands, can penetrate clear, shallow water, allowing us to identify what lies on the seafloor. In terrestrial habitats, atmospheric and topographic corrections are important, whereas in shallow waters, it is essential to correct the effects of the water column, as different depths can change the reflectance observed by the satellite sensor. Once you know the water depth, you can accurately assess benthic habitats such as seagrass, sand, and coral. In this chapter, we will describe how to estimate water depth from high-resolution Planet data and map benthic habitats.

FormalPara Learning Outcomes
  • Separating land from water with a supervised classification.

  • Removing surface sunglint and wave glint.

  • Correcting for water depth to derive bottom surface reflectance through a regression approach.

  • Identifying and classifying benthic habitats using machine learning.

  • Developing regression models to estimate water depth using training data.

  • Evaluating training data and model accuracy.

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

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

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

  • Use drawing tools to create points, lines, and polygons (Chap. 6).

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

  • Obtain accuracy metrics from classifications (Chap. 7).

  • Use reducers to implement linear regression between image bands (Chap. 8).

  • Filter a FeatureCollection to obtain a subset (Chaps. 22 and 23).

  • Convert between raster and vector data (Chap. 23).

1 Introduction to Theory

Coastal benthic habitats include several ecosystems across the globe. One common element is the seagrass meadow, a significant component of coastal marine ecosystems (UNEP/MAP 2009). Seagrass meadows are among the most productive habitats in the coastal zone, performing essential ecosystem functions and providing essential ecosystem services (Duarte et al. 2013), such as water oxygenation and nutrient provision, seafloor and beach stabilization (as sediment is controlled and trapped within the rhizomes of the meadows), carbon burial, and nursery areas and refuge for commercial and endemic species (Boudouresque et al. 2012; Vassallo et al. 2013; Campagne et al. 2014).

However, seagrass meadows are experiencing a global decline due to intensive human activities and climate change (Boudouresque et al. 2009). Threats from climate change include sea surface temperature increases and sea level rise, as well as more frequent and intensive storms (Pergent et al. 2014). These threats represent a pressing challenge for coastal management and are predicted to have deleterious effects on seagrasses.

Several programs have focused on coastal seabed mapping, and a wide range of methods have been utilized for mapping seagrasses (Poursanidis et al. 2021; Borfecchia et al. 2013; Eugenio et al. 2015). Satellite remote sensing has been employed for the mapping of seagrass meadows and coral reefs in several areas (Goodman et al. 2011; Hedley et al. 2016; Knudby and Nordlund 2011; Koedsin et al. 2016; Lyons et al. 2012).

In this chapter, we will show you how to map coastal habitats using high-resolution Earth observation data from Planet with updated field data collected in the same period as the imagery acquisition. You will learn how to calculate coastal bathymetry using high-quality field data and machine learning regression methods. In the end, you will be able to adapt the code and use your own data to work in your own coastal area of interest, which can be tropical or temperate as long as there are clear waters up to 30 m deep.

2 Practicum

2.1 Section 1: Inputting Data

The first step is to define the data that you will work on. By uploading raster and vector data via the Earth Engine asset inventory, you will be able to analyze and process them through the Earth Engine API. The majority of satellite data are stored with values scaled by 10,000 and truncated in order to occupy less memory. In this setting, it is crucial to scale them back to their physical values before processing them.

A screenshot contains a set of codes that describe the satellite data import and layout.

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

2.2 Section 2: Preprocessing Functions

Code Checkpoint A22b. 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. When you run the script, you will see several assets being imported for water, land, sunglint, and sandy patches to correct for the water column.

With the Planet imagery imported into Earth Engine, we now need to prepare for the classification and bathymetry procedures that will follow. The aim of the preprocessing is to correct or minimize spectral alterations due to physical conditions like sunglint, waves, and the water column. The landmask function below will remove the land area from our image in order to focus on the marine area of interest. This prevents the land reflectance values, which are relatively high, from biasing the main process of classification over dark water with low reflectance. To implement this step, we will perform a supervised classification to obtain the land/water mask. To prepare for the classification, we drew water and land geometry imports and set them as a FeatureCollection with property ‘class’ and values 1 and 0, respectively (Fig. 41.1). We will employ the Normalized Difference Water Index (NDWI) (Gao 1996) using a Random Forest classifier (Breiman 2001). Due to the distinct spectral reflectances of terrain and water surfaces, there is no need to ensure a balanced dataset between the two classes. However, the size of the training dataset is still important and therefore, the more the better. For this task, we create ‘line’ geometries because we can get more training points than ‘point’ geometries with fewer clicks. For more information regarding generating training lines, points or polygons, please see Chap. 6.

Fig. 41.1
A screenshot contains water and land geometry imports. Arrows pointing at the regions indicate the land and water surfaces. The fields listed in the configure geometry import tool are as follows. Name, import as, and property, as well as the color range.

Labeling of land and water regions using lines in preparation for the Random Forests classification

A screenshot contains a set of codes that describes the preprocessing functions. Section 2 mask based to N D W I and R F.

Sunglint is a phenomenon that occurs when the sun angle and the sensor are positioned such that there is a mirror-like reflection at the water surface. In areas of glint, we cannot detect reflectance from the ocean floor. This will affect image processing and needs to be corrected. The user adds polygons identifying areas of glint (Fig. 41.2), and these areas aid the linear model to remove sunglint areas in the whole image extend (Hedley et al. 2005).

Fig. 41.2
A screenshot of the surface of the ocean demonstrates the sun glint effect. The shoreline has a polygon shape. The following field is enabled in the rectangular shape titled masked l m g visualization parameters. 3 bands R G B and gamma.

Identification of areas with sunglint. Raising the gamma parameter during the visualization makes the phenomenon appear more intense, making it easier to draw the glint polygons

A screenshot contains a set of codes that describe the sun-glint correction.
A screenshot contains a set of codes that describe the sun-glint correction. It uses functions like linear fit and slope image.

Question 1. If you design more polygons fοr sunglint correction, can you see any improvement in the results visually and by examining values in pixels? Keep in mind that in already drawn rectangles (sunglint polygons), you cannot draw free-shaped polygons or lines. Try instead adding some more points or rectangles.

You can design more polygons, or select areas with severe or moderate sunglint to see how the site selection influences the final results.

The Depth Invariant Index (DIV) is a tool that creates a proxy image that helps minimize the bias of the spectral values due to the water column during classification and bathymetry procedures. Spectral signatures tend to be affected by the depth of the water column due to suspended material and the absorption of light. A typical result is that shallow seagrasses and deeper sandy seafloors will have similar spectral signatures. The correction of that error is based on the correlation between depth and logged bands (Lyzenga 1981).

In our example, the correction of water column alterations is based on the ratio of the green and blue bands, because of their higher penetrating properties compared to the red and near-infrared (NIR) bands. As in the previous functions, a requirement for this procedure is to identify sandy patches in different depth ranges. If needed, you can use the satellite image layer to do so.

Since we will use log values in the current step, it is crucial to transform all the negative values to positive before estimating DIV and since the majority of the values are in optically deep waters, the value 0.0001 will be assigned to values less than 0 in an attempt to avoid altering the pixels with positive values at the coastal zone. Moreover, a low-pass filter will be applied to normalize the observed noise that occurred during the previous steps (see Chap. 10).

A screenshot contains a set of codes that describe the D I V procedure. It uses functions like kernel, make positive, and div.
A screenshot contains a set of codes that describe the D I V procedure. It uses functions like image cat and map add layer.

Question 2. How can the selection of sandy patches influence the final result?

Sandy patches can also include signals from sparse seagrass or other types of benthic cover. Select different areas of variable depths and therefore different spectral reflectance to explore the changes in the final DIV result.

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

2.3 Section 3: Supervised Classification

To create accurate classifications, it is beneficial for the training data set to be created from in situ data. This is especially important in marine remote sensing, due to dynamic, varying ecosystems. In our example, all the reference data were acquired during scientific dives. The reference data consist of three classes: SoftBottom for sandy patches, rockyBottom for rocky patches, and pO for posidonia-seagrass patches. Here, we provide a dataset that will be split using a 70–30% partitioning strategy into training and validation data (see Chap. 6) and is already pre-loaded in the assets of this book.

A set of codes that explain the import of reference data and split. It has functions like sand filter and hard filter.
A set of codes that explain the import of reference data and split. It uses functions like map add layer and random column.

For this procedure, we chose the ee.Classifier.libsvm classifier because of its established performance in aquatic environments (Poursanidis et al. 2018; da Silveira et al. 2021). The function below does the classification and also estimates overall user’s and producer’s accuracy (see Chap. 7):

A set of codes illustrates the classification procedure. It uses functions like feature collection and sample regions.
A screenshot contains a set of codes that describe how the function does the classification. It has functions like array to data table and lists class names.
A screenshot contains a set of codes that describe how the function performs the classification procedure.

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

2.4 Section 4: Bathymetry by Random Forests Regression

For the bathymetry procedure, we will exploit the setOutputMode (‘REGRESSION’) option of ee.Classifier.smile RandomForest. For this example, reference data came from a sonar that was mounted on a boat. In contrast to the classification accuracy assessment, the accuracy assessment of bathymetry is based on \({R}^{2}\) and the root-mean-square error (RMSE).

With regard to visualization of the resulting bathymetry, we have to consider the selection of colors and their physical meanings. In the classification, which is a categorical image, we use a diverging palette, while in bathymetry, which shows a continuous value, we should use a sequential palette. Tip: ‘cold’ colors better convey depth. For the satellite-derived bathymetry, we use pre-loaded assets with the in situ depth measurement. The quality of these measurements is crucial to the success of the classifier.

A set of codes illustrates the import and split training and validation data for bathymetry. It corresponds to section 4, Bathymetry.

So that every pixel contains at most one measurement, the vector depth assets are rasterized prior to using them for the regression.

A set of codes illustrates the rasterized vector data for the regression. It has functions like filter and map add layer.

Finally, we need to enter down and execute the function to calculate the satellite derived bathymetry function, based on the Random Forest classifier.

A set of codes demonstrates satellite-derived bathymetry functions based on random forest regression. It has functions like set output mode and ends in get mean.
A set of codes demonstrates satellite-derived bathymetry functions based on random forest regression. It has functions like print and map add layer.

Question 3. Does the selection of different color ramps lead to misinterpretations?

By choosing different color ramps for the same data set, you can see how visual interpretation can be changed based on color. Trying different color ramps will reveal how some can better visualize the final results for further use in maritime spatial planning activities, while others, including commonly seen rainbow ramps, can lead to erroneous decisions.

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

3 Synthesis

With what you learned in this chapter, you can analyze Earth observation data—here, specifically from the Planet Cubesat constellation—to create your own map of coastal benthic habitats and coastal bathymetry for a specific case study. Feel free to test out the approach in another part of the world using your own data or open-access data, or use your own training data for a more refined classification model.

You can add your own point data to the map, collected via a fieldwork campaign or by visually interpreting the imagery, and merge with the training data to improve a classification, or clean areas that need to be removed by drawing polygons and masking them in the classification.

For the bathymetry, you can select different calibration/validation ratio approaches and test the optimum ratio of splitting to see how it influences the final bathymetry map. You can also add a smoothing filter to create a visually smoother image of coastal bathymetry.

4 Conclusion

Many coastal habitats, especially seagrass meadows, are dynamic ecosystems that change over time and can be lost through natural and anthropogenic causes.

The power of Earth Engine lies in its cloud-based, lightning-fast, automated approach to workflows, especially its processing power. This process would take days when performed offline in traditional remote sensing software, especially over large areas. And the Earth Engine approach is not only fast but also consistent: The same method can be applied to images from different dates to assess habitat changes over time, both gain and loss.

The availability of Planet imagery allows us to use a high-resolution product. Natively, Earth Engine hosts the archives of Sentinel-2 and Landsat data. The Landsat archive spans from 1984 to the present, while Sentinel-2, a higher-resolution product, is available from 2017 to today. All of this imagery can be used in the same workflow in order to map benthic habitats and monitor their changes over time, allowing us to understand the past of the coastal seascape and envision its future.