Development of tools for coastal management in Google Earth Engine: Uncertainty Bathtub Model and Bruun Rule

: Sea-level rise is a problem increasingly affecting coastal areas worldwide. The existence of Free and Open-Source Models to estimate the sea-level impact can contribute to better coastal management. This study aims to develop and to validate two different models to predict the sea-level rise impact supported by Google Earth Engine (GEE) – a cloud-based platform for plan-etary-scale environmental data analysis. The first model is a Bathtub Model based on the uncertainty of projections of the Sea-level Rise Impact Module of TerrSet - Geospatial Monitoring and Modeling System software. The validation process performed in the Rio Grande do Sul coastal plain (S Brazil) resulted in correlations from 0.75 to 1.00. The second model uses Bruun Rule formula implemented in GEE and is capable to determine the coastline retreat of a profile through the creation of a simple vector line from topo-bathymetric data. The model shows a very high correlation (0.97) with a classical Bruun Rule study performed in Aveiro coast (NW Portugal). The GEE platform seems to be an important tool for coastal management. The models developed have been openly shared, enabling the continuous improvement of the code by the scientific community.


Introduction
More than 30% of the world population lives in coastal areas -which are three times densely populated as inland areas and are increasing exponentially [1,2] -and between 80% and 100% of the total population of more than half of coastal countries live within 100 km from the coastline. Depending on the geologic, climatic, and oceanographic conditions, coastal zones may present a high risk of subsidence in some areas, storms exposure, tsunami, overwash and flood, coastal erosion, and regional sea-level fluctuations. All these phenomena are natural and contributed to model present-day coastlines. However, in the last seventy years, the effect of these drivers has increased in both intensity and frequency [3,4], and it is expected that this increasing trend keeps up in the future [5], being the anthropogenic forcing the main reason for the global average sea level rise since 1970 [6].
The sea-level rise is a common problem that affects about 70% of coastal zones worldwide [7]. The Total Global Mean Sea-level (GMSL) rose 0.16 m between 1902 and 2015. However, in the period 2006-2015, the GMSL rise rate was 3.6 mm yr -1 , about 2.5 times higher than in the period 1901-1990 (1.4 mm yr -1 ). The ice sheet and glacier contributions over the period of 2006-2015 were the most important sources of sea-level rise (1.8 mm yr -1 ), exceeding the influence of the thermal expansion of ocean water (1.4 mm yr -1 ) [8].
Sea-level rise is accelerated due to the contribution of ice loss from the Greenland and Antarctic ice sheets. Mass losses from the Greenland and Antarctic ice sheet doubled and tripled, respectively, in the years from 2007 to 2016 when compared with the period between 1997 and 2006 [7]. According to the Special Report on Climate Change and Oceans and the Cryosphere (SROCC) of Intergovernmental Panel on Climate Change (IPCC), the rate of global mean sea-level rise is projected to reach 4 mm yr -1 under a Representative Concentration Pathway -RCP 2.6 scenario and 15 mm yr -1 under RCP 8.5 scenario in 2100 [6]. In a global scale, the sea-level changes are not spatially uniform. For example, in the United States of America, the estimated sea-level rise for New York City is 0.87 m whereas for the Los Angeles area is 0.57 m by the end of the century under the same RCP 8.5 scenario [7].
Considering the dimension and complexity of sea-level rise hazards, the use of Geographic Information Systems (GIS) to organize and to analyze the information produced about those issues is crucial to improve coastal management. Desktop GIS applications such as ArcGIS [9], gvSIG [10], Terraview [11], or QGIS [12] have traditionally been used in coastal management, but the exponential increase of Google Earth Engine [13] in terms of available data, and capability to address a considerable volume of datasets with high spatial resolution has become this powerful cloud-based platform capable to connect large-scale problems on coastal management in a new point of view.

Google Earth Engine (GEE)
The Google Earth Engine is a cloud-based platform that offers high-performance computing resources for processing geospatial data [13]. It provides access to an increasing amount of remotely obtained datasets through its Application Programming Interfaces (API) for JavaScript and Python languages, which decrease the complexity of laborious desktop-based computations [14].
GEE use is growing very fast in the last few years. Several applications were developed such as MapBiomas [15] that provide a historical dataset of land use maps; CoastSat that allows extracting coastlines from Landsat and Sentinel images [16]; and the extraction of bathymetry from Sentinel 2 images [17]. One of the best benefits of creating models on GEE is the possibility to work efficiently and quickly in a large scale. These advantages can be integrated into scripts (based on GEE API) by implementing modeling frameworks and creating new tools and analysis methodologies, which can improve new knowledge and its application.

The Uncertainty Bathtub Model (uBTM)
The simple Bathtub method is a GIS technique that shows the areas below a specific elevation level as being flooded, like a bathtub or single value water surface [18]. Based on the former, the Uncertainty Bathtub Model (uBTM) [19] is a modified version of this technique that combines the uncertainty of sea-level projections and the vertical error of a Digital Elevation Model (DEM). Based on the Terrset Sea-level Impact tool [20], the model defines the probability of the sea-level to flood a considered zone, using the level of uncertainty associated with the DEM and the sea-level rise projections.

Brunn Rule for GEE Model (BRGM)
The Brunn Rule for GEE Model (BRGM) [21] is based upon a formula created to estimate the retreat of sandy beaches coastline in response to sea-level changes [22]. The Bruun Rule has some limitations, and its application requests precaution due to the simplicity of the formula; the equation does not include some essential variables such as extreme washover events, changes in sediment budget and anthropic action. However, the formulation shows accurate results in its applications history [23,24], and allows to obtain better results than those produced by modern models, such as the Profile Translation Model (PTM) [25].
The main objective of this work is to explore the potential of GEE as support for two models -uBTM and BRGM -and its validation in the context of coastal management problems. The uBTM model uses the uncertainties of sea-level projections and the vertical digital elevation model error to create a coastal flooding scenario. The BRGM model is based on the Bruun Rule equation that generates a tool capable of determining the coastline retreat in a coastal stretch.

Study Sites
The models were applied and validated using a morphological dataset of the southern Rio Grande do Sul, Brazil and of a region located in the northwest coast of Portugal.
The Rio Grande do Sul coastal plain (RSCP) in the south of Brazil was chosen to validate the Uncertainty Bathtub Model (uBTM) (Figure 1 -A). The RSCP is characterized by an extensive NE-SW sandy barrier system of 620 km of length and a great variety of environments associated [26]. The coast is wave-dominated, and tides have a subordinated role in coastal hydrodynamics and present a mean amplitude of 0.5 m and a maximum of 1.2 m. The wave climate is dominated by two-wave propagation patterns, one composed of S-SE swell waves of higher amplitude and longer periods; the second comprising local generated waves, with shorter periods and a predominant E-SE direction. Swell waves have a mean significant wave height of 1.5 m and periods of 12 s. Sea waves are characterized by a mean significant wave height of 1 m and a mean period of 8 s [27].
The continental shelf is wide (100 to 200 km), shallow (100 to 140 m) and slightly sloping (0.02° to 0.08°) [26]. Differences in width, slope and topographic features along the coastal region are a result of reworking action related to glacio-eustatic variations that occurred during the Quaternary [28]. The barrier system was formed in the last 7 Ka controlled by both sediment supply along the coast and morphology; coastal embayment promote the development of regressive barriers and steeper coastal slopes are dominated by transgressive barriers [29].
The second site considered, in order to validate the Bruun Rule for GEE Model (BRGM), is located in the northwest coast of Portugal (Figure 1 -B). The stretch is situated south of the Aveiro lagoon entrance and is morphologically characterized by a sandy barrier extending in NNE-SSW direction. Nowadays, this area is highly vulnerable to erosion due to the very low and flat topography, combine with high wave conditions and a meso-tidal regime [34]. The sector considered, from Barra to Poço da Cruz beaches, is backed by a degraded foredune ridge partially destroyed by erosive processes and replaced by sand dykes. In general, the beaches show pronounced seasonal behavior, with a range of morphodynamical states. This variation reveals the important exchange of sediments between the upper and lower foreshore [35]. Despite this cross-shore transport, significant littoral drift causes major alongshore motion of sediments along the southward direction [36]. However, the presence of several cross-shore structures (jetties and groins) contributes to changes in the sediment transport patterns.
The coast is exposed to highly energetic waves from WNW-NNW [37]. In maritime summer (June to September) significant wave heights and mean periods are less than 3 m and 8 s, respectively. During winter and transitions periods, the mean significant wave heights and periods exceed 3 m (most common values of 3-4 m) and 8 s (most frequent mean periods of 8-9 s), with storms defined by a mean significant wave height greater than 5 m (often exceeding 7 m) and mean wave periods of 13 s, which can reach maximum 18 s [38]. The average values for the spring and neap tidal ranges are 2.8 m and 1.2 m, respectively.
Despite the considerable differences between the two study sites, regarding the geological, climatic, and oceanographic frameworks, both are sensitive areas to trigger events, e.g., storms and sea-level changes.

Uncertainty Bathtub Model
The model was entirely implemented on the GEE using the JavaScript API. The model exams the uncertainty of sea-level rise projections with vertical errors in the DEM, creating a frequency from 0 to 100%, which indicates the probability of a specific area to be affected by sea-level rise (Figure 2 -a). The model assumes the lowest vertical error of a DEM and the highest sea-level rise projection (Figure 2 -b). The areas that appear emerged are considered locals with 0% of probability to be affected by sea-level rise flooding. On the other hand, a region has a 100% probability of being submerged when the maximum error of DEM elevation is compared with the lowest sea-level rise projection and the area appears submerged, even with optimistic settings (Figure 2 -c). The uBTM passed through a filtering process with different Kernel Filters, in order to choose the best option to smooth the data and to reduce both the pixelization and the image grain for a better delimitation of the waterline boundaries. All 3x3 Kernel Filters available on GEE (i.e. Cross, Plus, Gaussian, Diamond, Circle, Square, Octagon, Chebyshev, Euclidean, and Manhattan) were tested and compared. The geometric aspect of the circular Kernel Filter seems more adequate for the waterline shapes of the study area. However, this filter can be easily changed on the code and to be selected the one that is more appropriate to the coastal characteristics (for example, a square filter is reasonably proper in the case of rocky cliff coasts). The result of the uBTM combined with the filtering process is called the uncertainty Bathtub Model smoothed (uBTMs) (Figure 2 -d).

uBTM Validation
The validation of the uBTM consists of performing a comparison between three similar GIS models (i) Simple Bathtub Model (sBTM), (ii) Enhanced Bathtub Model (eBTM), and (iii) Terrset Sea-level Impact (tSLI), which are briefly described below.
The sBTM is a user-defined static inundation water level that does not consider either the hydrological framework or physical barriers.
The eBTM includes a roughness coefficient and the beach slope, to perform a more realistic representation of the area and coastal flooding conditions. The eBTM needs the surface roughness coefficient as input [39]. The surface roughness acts as a critical variable that influences the water movement. In the present case, the study region (RSCP) is characterized by mainly sandy substrate in the first meters above the surface [40][41][42][43][44] and according to [45] sands are characterized by a uniform roughness coefficient of 1.
The tSLI yields the effect of a sea-level rise integrating both the uncertainties of the projection and the DEM, using a PCLASS algorithm, which produces a probability image where values are between zero and one [20].
The calculation of the area by itself is not a good indicator of the similarity between the models because it ignores the spatial distribution. For this reason, a different methodology was developed allowing the quantification of spatial differences to check spatial similarities between models.
Several algorithms, including Artificial Intelligence, use heatmaps and statistical analyses to recognize objects and identify differences between images [46][47][48]. The method used to quantify the similarity of the spatial distribution consists of transforming the pixels values of model into a density map and applying a correlation matrix to assess the similarities and their distribution. An ArcMap graphical model was created to select only the impact by using the Extract by Mask, a tool that cuts the raster cells related to the area defined by a polygon [9]. In the case of uBTM, uBTMs and tSLI -that show the impact from 0 to 100% -50% is the point that expresses the value of sea-level on DEM without the influence of vertical error and uncertainties of sea-level projections. The use of the same values for sBTM and eBTM allows comparing both models. The process to extract the area below 50% is represented in the graphical model by the Raster Calculator Tool, which allows to create and perform a map algebra expression that results in an output raster [9]. After that, the affected area of all models is transformed into points by the Raster to Points Tool. Then, it is applied the Kernel Density tool to create a heatmap of pixel changes for each model (Appendix A).
It was necessary to remove the effect of lagoon areas (in the case of RSCP) and understanding the spatial distribution near to the coastline. For this reason, the same procedure (Extract by mask > Raster to Point > Kernel Density) was performed by creating a small sector through a buffer area of 500 m from the coastline vector. The final step was applied the Raster Correlations and Summary Statistics of SDM Toolbox v.2.4 [49], which creates a correlation matrix of the Kernel Density.
The accuracy of the method was verified by using two accessible APIs for image comparison: i) DeepAI -Image Similarity [50] which uses an artificial neural network algorithm to identify the differences, ii) Resemble.js based on Visual Regression method [51]. The heatmap images of spatial distribution used for comparison were created by exporting from ArcGIS 10.6 the images of the Kernel Density in a white background. In the end, the density points created on ArcGIS, the outcomes of the process of DeepAI and Resemble.js, and the results of the area differences calculation were correlated using pyplot library and GoogleColab [52]. Matplotlib is a library for producing visualizations (i.e. charts) in Python [53]. The GoogleColab platform allows writing and executing python code through the web browser in a cloud environment [54].
The DEM used to perform the analysis was the CoastalDEM Free Version (resolution of 90 m), a product created with a multilayer perceptron (MLP) artificial neural network to reduce the vertical error of Shuttle Radar Topography Missions (SRTM) to ca. 2.5 m [54]. The values of sea-level rise were extracted from the regional data of Special Report on the Ocean and Cryosphere in a Changing Climate (SROCC) [5] under Representative Concentration Pathway-RCP 8.5. The value adopted is 0.68 m with the uncertainties of 0.50 m to 0.90 m, for the period 2081-2100.

Bruun Rule implementation on Google Earth Engine
The Bruun formula [22] uses the berm height, the horizontal length after the berm ridge towards the backshore, or the beach face [55]. If the profile does not have a berm, the dune foot is considered. The code developed on GEE requires the sea-level rise projection, DEM (raster format) of topography and bathymetry (Figure 3 -a) in order to create the topo-bathymetric profile, i.e. a line that allows obtain the values of the berm height and depth of closure (Figure 3 -b). After that, Equation 1 was used with the values extracted from the created line. The displacement representation in the future is represented by using a simple buffer, with the extreme edge of the polygon being the final position of the coastline (Figure 3 -c).
Bruun's classic equation where R is the coastline retreat, S is the predicted sea-level rise, W is the profile length; h is the depth of closure and B the berm elevation.
In the last years, modifications to the original Bruun equation were proposed by [56] in order to incorporate the landwards transport, and [57], that included the contributions of the cross and longshore sedimentary processes and the sediment budget (Appendix B). These variables were included in the code, but its precision was not evaluated in the present study. In this study, the classic Bruun equation (Eq. 1) was applied on the Portuguese coastal stretch, between Barra and Poço da Cruz beaches (Aveiro region), using bathymetry and UAV photogrammetry DEM data (Figure 1). The results were compared with [58]'s study, which performed a Bruun Rule analysis in the same region. Profiles for the GEE Model (BRGM) were created with the values detailed in this study. However there are some bathymetric and topographic differences between the profiles performed by [58] and the present analysis because it was necessary to adapt the length of some profiles to get similar values of height and depth. The topographic and bathymetric data used have two sources, the COSMO Program [59] (topography) with 1 m of spatial resolution and the Portuguese Hydrographic Institute [60] (bathymetry) with 82.4 m of spatial resolution. Subsequently, a Spearman correlation analysis between the results of the GEE Bruun Rule and the previous study [58] was performed. After the validation process, was tested for the area a scenario of sea level rise of 1.21 m, considering the contribution of the ice sheets melting process (AIS = 60 cm) [61].

Results
The results section is divided in two subsections: i) the validation process of the Uncertainty Bathub Model (uBTM) and ii) Bruun Rule validation for Google Earth Engine Model (BRGM) through Spearman correlation analysis and the example of the application of the BRGM under a climate change scenario.

uBTM Validation
The subsection presents the results of the comparison of the areas between the different models, and those obtained with the spatial similarity using Kernel Density and machine learning APIs.

Comparison of the areas between models
In Figure 4, the red color shows the areas with more than 50% of probability to be affected by a climate change scenario. The results are very similar in all the models performed, which means the outcomes of uBTM and uBTMs are coherent (Figure 4 -A and  B). The regions in red color correspond to the total results of eBTM and sBTM (Figure 4 -D and E). Additionally, it is possible to observe the result of the Kernel filter smooth effect by using the uBTMs (Figure 4 -B, small frame). Besides, the Terrset Sea-level Impact (tSLI) showed the different spatial distribution of areas from 0 to 40% of impact (Figure 4 -C). The tSLI yields the most significant area affected, but the difference between tSLI and uBTM represents only 0.63% of the total area of Rio Grande do Sul coastal plain (RSCP) and 2.99% of the coastal stretch or section (CS). Furthermore, the total areas obtained by the uBTM and sBTM are similar ( Figure 5). In the coast section, the eBTM, uBTM and sBTM show also similar results. The correlation matrix of Kernel Density results is presented in Table 1. The uBTM model shows a correlation of 0.99 and 1 with tSLI and sBTM, respectively. Moreover, the uBTMs display 0.97 of correlation with tSLI and sBTM. The correlation matrix of the area differences, density correlation, Deep AI, and Resemble.js recognized the eBTM singularity. The method also identified similar values for the other models (Figure 7-A to D).

Coast section
In the coastal stretch, the differences between models is more evident, especially in uBTMs and tSLI models, thatshow different spatial distributions of density points (Figure 8). The uBTMs smooth process deleted the loose pixels that influenced the Kernel Density results (Figure 8 -E). The uBTM and sBTM has a correlation factor of 1 while with tSLIthe correlation value is 0.77. The eBTM presents high correlation values (0.99) with both uBTM and sBTM models ( Table 2). The singularities of uBTMs and tSLI on the coastal section are evident on Image Similarity APIs as well. The Deep AI and Resemble.js also recognized the uBTM, eBTM, and sBTM spatial similarities (Figure 9 -C and D). This situation makes it clear that the area differences analysis on its own cannot accurately distinguish the spatial distribution between models as reached by the density correlation method and image similarity APIs.

BRGM Validation
The results presented in Table 3 compare the numeric characteristics of the profiles (i.e., berm high, profile length, depth of closure profile and coastline retreat) obtained by [58] and Bruun Rule for GEE model (BRGM). The results of the BRGM with the projection for 2100 (RCP 8.5, 1.21 m) points to a maximum coastline retreat of about 146.6 m close to the south jetty (Profile 1) and a minimum of 78.5 m (Profile 8) (Figure 1) (Table 3). Table 3. Comparison between morphological variables obtained by [58] and in the present work. The coastline retreat results  According to projections for 2100 under the RCP 8.5 scenario the coastline will might suffer a total retreat of about 100 m ( Figure 10). The nine profiles used to estimate the coastline retreat with BRGM are compared with those of [58]'s study. There is a strong correlation between them (r = 0.97), showing a coefficient of determination (R2) of 0.93, t-test (9.49), and p-value equals zero, which indicates a very-high coherence between the results of both studies ( Figure 11).

Discussion
The two models presented in this paper (uBTM and BRGM) may correctly operate and were positively validated with the other well-known GIS-based models and previous studies. It is suitable to affirm that both models can produce appropriate outcomes according to their objectives.
The uBTM and uBTMs can be defined as being a hybrid between sBTM and tSLI. The uBTM has the advantage of representing the sBTM in a probabilistic form related to uncertainties and reducing the computational complexity. The main difference between tSLI and the remaining models is due to the PCLASS algorithm used by Terrset that operates with a different reclassification, which calculates the area under a normal curve defined by the threshold value using the uncertainties as standard deviation [20]. The Circle Kernel filter applied to the uBTMs model reduced the scarce pixels and improved the delimitation of the Rio Grande do Sul coastal plain (RSCP) coastline contour. Furthermore, the pixels removed reduced the correlation with the sBTM in the coast stretch but when the totally of the RSCP is considered the uBTMs presents 0.97 of correlation. Zones of high vulnerability like as salt marshes [62], low altitude and flat areas [63], and places prior recognized as a priority for coastal management [64,65] were coherently recognize by all the models as areas with a high risk in flood situations caused by sea-level rise.
Combining the results of the correlation matrix with the Kernel Density and the image similarities APIs it is possible to recognize the spatial patterns of eBTM and tSLI and similarities to other models in general. The inclusion of artificial intelligence as a tool to compare images and recognize spatial designs and trends can bring useful algorithms to the existing GIS software available nowadays. Additionally, it is essential to highlight that the eBTM results reveal the hydrological connectivity of the lagoons with success. In this case, as in uBTMs, the low correlations do not necessarily determine inferior quality results.
Regarding the BRGM, the high correlation of 0.97 with [58]'s results proves that this model can perform the Bruun Rule on Google Earth Engine with success. Recently, [66] published a study using the Bruun Rule, and [67] criticized the authors for using the 'Bruun Rule' without considering the offshore sediment transport. It is always essential to remember that the analysis may not be conclusive because the original equation ignores some factors such as the overwash events and changes in sediment supply. Overall, the implementation of the original Bruun Rule in GEE can turn easier to apply, helping to get a better understanding of the formula and providing a new environment in GIS that can encourage the creation of more realistic modifications of the Bruun Rule itself.
Both methods, uBTM [19] and BRGM [21] can be found to download in the references. Therefore, the models should be used with caution due to their inherent simplicity it is sufficient to conclude about sea-level impact by using these analyses alone. However, this methodology takes few minutes to run and is useful for an initial assessment, to be supported by more detailed studies combined with other models and including more variables.

Conclusions
This work presents and validates two models for the assessment of sea-level rise created on Google Earth Engine (GEE). The GEE has shown to be a useful analytical platform to develop models that can be performed in different studies of coastal dynamics.
The Uncertainty Bathtub Model (uBTM) reveals high similarities and correlations with tested models. This proved uBTM as a reasonable option to represent the impact of the sea-level flood. The study also provided a data analysis of the sea-level rise impact for the Rio Grande do Sul coastal plain. Likewise, the Bruun Rule for GEE Model (BRGM) validation allowed a high degree of confidence that guarantee the model is well adjusted. Besides, by the characteristics of GEE, this model can now run efficiently in a cloud-based GIS environment, promoting improvements of Bruun Rule by calibrations, modifications, and enhancing its base formulation.
The uBTM and BRGM codes are in open access for the scientific community, and thus, they can make improvements and adapt the code to its applications and scientific investigations.

Appendix A
Graphical model for the validation process in ArcGIS (version 10.6). Blue circles are the inputs; yellow rectangles are the tools; green circles are the outputs.