Introduction

The Global Assessment Report on Biodiversity and Ecosystem Services has already highlighted an unprecedented decline in biodiversity over the past half-century1. Anthropogenic activities have significantly exacerbated this loss through the induction of adverse climate change phenomena, and the depletion of terrestrial and aquatic resources. Nevertheless, humanity also holds the key to reversing this trend by translating interdisciplinary scientific knowledge into practical conservation actions2. Recent advancements in remote sensing technology offer particular promise in this regard3,4,5. The extensive spatial coverage and high temporal resolution of remote sensing data provide unprecedented insights into ecosystem responses under both natural and human-induced pressures. By employing rigorous quantitative methods, remote sensing facilitates efficient and cost-effective monitoring of complex and diverse ecosystems, such as mangrove forests6,7,8,9. Moreover, when integrated with the Essential Biodiversity Variables (EBVs) framework of the Group on Earth Observations—Biodiversity Observation Network10,11, remotely sensed data can generate comprehensive spatial datasets to inform effective management strategies for diverse terrestrial and marine ecosystems. Such an approach supports the realization of global biodiversity targets, including the Kunming-Montreal Global Biodiversity Framework Targets and Goals12.

Quantitative investigations into biodiversity, initiated approximately three decades ago, have undergone substantial evolution towards spatial observation in recent years, reflecting the growing potential of Earth observation data. The ___domain of remote sensing biodiversity encompasses four primary areas: habitat mapping, species mapping, functional diversity (FD), and spectral diversity3,13. While the former two predominantly employ classification methodologies, the latter two leverage continuous indices to assess variation across spatial scales such as alpha (within-community), beta (community-to-community), and gamma (regional) diversity14,15,16. A paradigm shift from categorical approaches (habitat and species mapping) to a continuous approaches, exemplified by spectral-based and trait-based perspectives, provides numerous advantages such as: (i) refining habitat classifications by subdividing broad habitat categories into more functionally relevant units, (ii) providing quantitative estimates of FD within different habitat types, (iii) identifying functional hotspots, and (iv) elucidating the dynamic nature of ecosystems and changes in diversity over time.

Historically, remote sensing has been constrained by coarse spatial and spectral resolutions, as well as insufficient temporal replicates, limiting its application to quantitative FD17,18. To date, studies have widely relied on the spectral variability hypothesis19, utilizing the variation in spectral signatures or vegetation indexes (VIs) as biodiversity or environmental heterogeneity proxies—an approach that has shown variable success across ecosystems and spatial scales20. Less common are attempts to first derive functional traits through empirical, physical-based, or hybrid approaches before calculating diversity metrics. Limited studies have employed single21 or multiple traits22,23,24 as input metrics for FD estimation and their application has been predominantly confined to terrestrial ecosystems.

Among Earth’s biota, mangrove forest ecosystems, situated at the dynamic land-sea interface, provide a multitude of valuable biodiversity functions, hosting a wide range of flora and fauna25. While individual mangrove stands often comprise few tree species, they exhibit considerable intraspecific FD and host rich associated biodiversity. This FD is crucial for ecosystem resilience against environmental stressors such as storm surges, sea level rise, and salinity fluctuations26. These ecosystems provide multiple ecological services and are increasingly recognized as nature-based solutions for climate change mitigation and adaptation, contributing to various Sustainable Development Goals. While mangroves are significant blue carbon sinks27, their restricted coastal distribution makes them vulnerable to both oceanographic impacts and anthropogenic pressures7,28. Rather than focusing on species mapping, understanding FD becomes essential for assessing ecosystem health and resilience in mangrove stands.

Despite growing evidence linking spectral and FD29, these relationships tend to become more confounded and complex at landscape scales20, and significant knowledge gaps remain in applying these relationships to mangrove ecosystems. While Wang et al. (2022) pioneered spectral diversity mapping in mangroves30, their approach relied solely on spectral information without establishing physical or empirical relationships to functional traits. The validity of spectral-based approaches requires further investigation, particularly given inconsistent results reported across ecosystems and the known sensitivity of spectral variation to confounding factors such as vegetation cover, biomass, and background signals20,31—considerations that could be even more pronounced in water-influenced environments. Furthermore, critical questions on methodological decisions for satellite-derived FD estimation and their impact are still outstanding; how optical trait selection influences observed satellite-based mangrove FD patterns, and how spatial scaling, both the size and shape of plots, effects manifest in remote sensing-based mangrove diversity assessments. Notably, while trait-based approaches might offer advantages over direct spectral or VI methods, to our knowledge no studies have yet mapped mangrove FD using optical trait-based techniques.

To address these knowledge gaps, our research investigates several key aspects that influence mangrove FD mapping: (1) the dependence on spatial scale, (2) the impact of core versus fragmented mangrove areas, and (3) the influence of input functional traits and VIs. We utilized Sentinel-2 (S2) imagery to derive spectral-biophysical variables, including leaf chlorophyll content (LCC), leaf mass per area (LMA), and equivalent water thickness (EWT), alongside relevant VIs. Prior to FD estimation, we conducted correlation analysis and principal component analysis (PCA) to ensure the independence and distinct ecological interpretations of these input variables. Subsequently, we quantified FD, encompassing richness, divergence, and evenness, using a three-dimensional moving window approach, applying the selected traits/VIs across a range of systematically varied plot sizes32. Ultimately, our findings aim to contribute meaningfully to the ongoing discourse surrounding the challenges and adaptations inherent in mapping FD within mangrove ecosystems using satellite remote sensing.

Study area

Encompassing 33 of 64 world mangrove species, Vietnam ranks among the top 10 countries experiencing the highest mangrove deforestation rates during the period 1996–202033. Within diverse mangrove ecosystems spanning along nearly 3,300 km of coastline (almost half the national boundary), the southernmost Ca Mau Peninsula stands out as the largest mangrove area33,34. Rhizophora apiculata is the dominant mangrove species, with widespread canopy cover observed conspicuously from space35,36. Mangrove forest in Ca Mau extends far beyond their physical defense mechanisms (i.e., waves, storms, and coastal erosion), as also a rich biodiversity hotspot and a source of livelihood for local communities36,37,38,39.

The entire mangrove forest is demarcated into five management sub-regions following their geographical ___location and specific requirements (Fig. 1). The West coastal protection mangrove forest (WE) and the East coastal protection mangrove forest (EA) function as the frontline defense for the coastline, attenuating wave energy and mitigating erosion. Located centrally, the safeguarding Nhung Mien Coastal Protection Mangrove Forest (NM) covers the southernmost tip of the Ca Mau Peninsula. Notably, the strictly conservational area, also known as UNESCO Biosphere Reserve Mui Ca Mau National Park (MCM) (https://rsis.ramsar.org/ris/2088), was recognized for its ecological significance due to its diverse assemblage of flora and fauna. The remaining Dat Mui Coastal Protection Mangrove Forest (DM) serves a distinct purpose, fostering sustainable livelihoods by empowering local communities to engage in responsible forest management practices and ecological shrimp farming.

Fig. 1
figure 1

Location of the study area in Vietnam (A), with zoom-in mangrove-dominated area in the Vietnam’s southern tip (B), and five distinct conservation mangrove areas over the background of mean 2023 Sentinel-2 image (C). Maps were generated by QGIS 3.16.0 (https://qgis.org).

Results

Spatial scale dependence of mangrove FD mapping

The spatial distribution of mangrove traits as quantified by LCC, LMA, and EWT provided comprehensive insights into photosynthetic activity, biomass, and transpiration, incorporating pixel-wise uncertainty quantification (Fig. 2). Lower relative uncertainties were achieved in both LCC (on average: 20%) and EWT (on average: 18%) compared to LMA (on average: 38%) across examined sites. Notably, core natural forests (e.g., MCM) exhibited higher trait values with concurrently lower relative uncertainties compared to fragmented forests (e.g., WE, DM, NM, EA). This finding indicates that the retrieval process becomes more challenging and less certain in areas with discontinuous mangrove cover, where significant anthropogenic activities (e.g., aquaculture ponds) are interspersed with mangrove patches.

Fig. 2
figure 2

Maps of LCC, LMA and EWT by annual mean of 2023 accompanied with relative uncertainty. Maps were generated by QGIS 3.16.0 (https://qgis.org).

In order to access the spatial scale effect of FD mapping, Fig. 3 illustrated three FD components of richness, divergence, and evenness estimated from mangrove functional traits LCC, LMA, and EWT using varying window sizes 4 × 4, 6 × 6, 8 × 8, and 10 × 10 pixels. The results demonstrated a gradual disappearance of FD patterns in fragmented forests as the window size increases. This is primarily due to insufficient pixels within the captured window, particularly when applying the 10 × 10 plot to discontinuous landscapes, which hinders the calculation of three-dimensional (3D) FD volumes. Here, mangrove patterns with sufficient 10 × 10 pixels (corresponding to 1 hectare) were found rarely in fragmented forests except for the Ramsar site MCM.

Fig. 3
figure 3

Maps of FD indices following different plot size. Maps were generated by QGIS 3.16.0 (https://qgis.org).

The impact of spatial scale on FD estimation as changing moving window extent is interpreted using histogram density plots (Fig. 4). Incorporating a greater number of data points within the 3D computational space (Fig. 5) demonstrably influences various FD metrics, with specific ecological implications depending on the metric itself. In particular, richness exhibits a significant decrease in density as the number of diverse functional trait values increases, as the mean from 0.035 to 0.089 with the edge of the square moving window increasing from 40 to 100 m. Conversely, the distance to the center of gravity, representing divergence, shows a slight fluctuation (mean of 0.17 – 0.25) during changing plot size. Interestingly, functional evenness remains relatively constant across different grain sizes, with means of approximately 0.56, 0.58, 0.59, 0.60 following 10 m group of 4 × 4, 6 × 6, 8 × 8, 10 × 10 adjacent pixels in 3D space volume, respectively.

Fig. 4
figure 4

Effect of plot size in moving window approach in FD indices.

Fig. 5
figure 5

3D scatter plots represent the corelation between traits in different plot size: (a) 4 × 4, (b) 6 × 6, (c) 8 × 8, (d) 10 × 10.

Building a robust FD model necessitates securing an adequate number of data points for reliable estimation. Additionally, assessing the spatial scale effect revealed a significant influence of the moving window size on the richness and divergence variability, especially in areas with aquaculture ponds mixed with productive mangroves. Therefore, we opted the largest plot size (10 × 10) for further analysis of FD estimated over sub-areas and influences of different input traits/VIs.

Comparison between core and fragmentated mangrove

Figure 6 offered a summarized breakdown of the change of FD indices for each mangrove protective area. MCM is the sole area preserving dense core natural forests, while the remaining four regions exhibit a more fragmented landscape with mixed mangrove and aquaculture pixels. The Biosphere Reserve MCM achieved the highest divergence (middle quantile Q2 = 0.31) and evenness (Q2 = 0.93). The spread of the data, represented by the interquartile range (IQR, calculated as the difference between upper quantile Q3 and lower quantile Q1) in box plots, indicates the distribution around the median. MCM exhibited a more concentrated distribution, while the other four areas showed a more dispersed distribution. For instance, EA achieved the highest range for all three FD indices, with IQRs of 0.11, 0.30, and 0.79 for richness, divergence, and evenness, respectively. Conversely, MCM displayed the tightest range, with IQRs were 0.06 for richness, 0.04 for divergence, and 0.35 for evenness.

Fig. 6
figure 6

Box and whisker plot (between the 5th and 95th percentile) with four percentiles over the core natural mangrove (MCM) and fragmented mangroves (DM, EA, NM, WE). The whisker shows the min and max values, while box plot represents lower quantile Q1 (25th percentile), middle quantile Q2 (50th percentile) as median, and upper quantile Q3 (75th percentile).

Mangrove FD mapping based on different input functional traits and VIs

The bivariate correlation matrix and PCA plot of the first two principal components (Fig. 7) revealed strong correlations primarily between VIs. This finding was expected since these indices are largely derived from the input of spectral reflectance data in the visible to SWIR range. Among VIs, canopy chlorophyll content index (CCCI) was highlighted as the most independent variable. The lowest correlations were observed between Chlorophyll vegetation index (CVI) – CCCI (R = 0.06), Modified Chlorophyll Absorption in Reflectance Index (MCARI) – CCCI (R = -0.03), and CVI—MACRI (R = 0.4), as the same representation observed by PCA analysis. In contrast to these VIs, both of the three traits (i.e., LCC, LMA, EWT) exhibited independent levels with each other (R ranging from -0.27 to 0.15). These findings suggest that the functional traits represent distinct and independent ecological characteristics of the mangrove plants compared to VIs.

Fig. 7
figure 7

The correlation matrix (left) and PCA plot (right) present the relationships between mangrove variables. Values depicted in the lower left half of the correlation matrix are the Pearson correlation coefficients. P-value less than 0.05 (***), between 0.05 and 0.1 (**), greater than 0.1 (*).

Based on the correlation and PCA results, two sets of three VIs were selected as input for FD mapping and compared with results estimated from the set of mangrove functional traits. A set of three indices CCCI, CVI, and MCARI was prioritized due to their minimal intercorrelation. Meanwhile, to reflect ecological relevance based on VIs, an additional set of Specific Leaf Area Vegetation Index (SLAVI), Normalized Difference Moisture Index (NDMI), and MCARI was also taken into account. The rationales behind this selection are: SLAVI is sensitive to dry matter content40, NDMI is associated with water content41, and MCARI use commonly for chlorophyll pigment representation42. FD maps derived from input VIs in the supplementary S1.

To conduct a more exhaustive comparison, kernel density estimation was employed to pair all co-pixels from FD results derived using different inputs for scatter plot generation (Fig. 8). The highest correlations were observed for evenness, with R2 values of 0.98 for all three comparisons between the sets of functional traits/VIs. In contrast to richness and divergences, a low-to-moderate correlation (R2 ranging from 0.39 to 0.55) was found between a set of input functional traits and VIs. Conversely, higher levels of correlation were achieved between two sets of VIs for both richness (R2 = 0.81) and divergences (R2 = 0.67). The slope and fitted line of the linear regression indicated that FD estimates based on all VIs (CCCI + CVI + MCARI and SLAVI + NDMI + MCARI) were consistently underestimated compared to those derived from functional traits (LCC + LMA + EWT). FD indices estimated using the CCCI + CVI + MCARI set were marginally higher than those from the SLAVI + NDMI + MCARI set. This can be attributed to the lower correlation results presented previously (Fig. 7), leading to the calculation of shorter distances in the 3D FD models.

Fig. 8
figure 8

Scatter Plot showing the comparison of FD indices estimated by different input functional traits/VIs.

Discussion

To our knowledge, this study represents a novel attempt in mapping mangrove FD using remotely sensed functional traits. Our results elucidate the influence of spatial scales on quantifying three independent FD components: richness, divergence, and evenness across various mangrove landscapes, as well as assessing the influence of different input functional traits/VIs for FD estimation. In the following discussion, we delve into three key aspects of our study: (1) strategies for mangrove FD estimation, (2) the selection of ecologically meaningful input mangrove traits/VIs, and (3) our perspective and prospects for remotely sensed data in quantifying spatiotemporal patterns of mangrove FD.

Strategies for mangrove FD estimation

Our analysis revealed a significant positive correlation between plot size and functional richness, while functional divergence and evenness remained relatively stable. This aligns with findings from diverse ecosystems, including mixed43, tropical44, and logged forests, as well as oil palm plantations45. It is also consistent with what has been found in the field in with traditional sampling46, synthetic data47, airborne remote sensing43, and satellite remote sensing13. Multi-scale analyses that consider different plot sizes may be preferred to understand this scale dependency and its convergence or divergence against random null-models13,43. Such multi-scale analyses are relatively efficient to calculate based on satellite imagery.

The moving window approach, commonly used for FD estimation22,23,43, may present limitations when applied to mangrove landscapes. This is due to the reliance on a sufficient contiguity of adjacent pixels as input to multidimensionally computational space. In fragmented and human-dominated landscapes, where mangrove patches are interspersed with other land cover types (aquaculture ponds in particular), the lack of pixel contiguity compromises these methods’ validity, may introduce edge artefacts, risks incompleteness, and constrains statistical power. Alternative approaches like nested radial pixel selection13 or spreading dye algorithms48 conditioned by land cover or other environmental geospatial layers could potentially better draw plots attuned with the mosaic and fragmentation of mangroves found in aquaculture-dominated areas. In addition, object-based approaches better delineate observable management units that directly affect biodiversity49. However, these management or landscape-relevant object-based approaches often require additional information to determine the appropriate ‘objects’ to represent plots. The increasing availability of computer vision and automated segmentation algorithms50 may aid this process, as demonstrated in the case of aquaculture ponds using S2 imagery51. Nevertheless, the resulting objects of varying sizes and shapes present new methodological challenges for standardizing comparisons across object-based plots.

For human-dominated landscapes like our study area, our analysis indicated higher FD in protected regions (MCM) versus production zones (WE, DM, NM, EA). This statistical finding is consistent with current conservation policies for particular conserved areas. Specifically, a high level of conservation prevents timber logging and aquaculture farming activities in the core natural mangrove habitat over the Ramsar MCM28,52. Meanwhile, sustainable livelihood activities (e.g., timber and aquaculture farming) are permitted in other productive mangroves39,53. The sensitivity of remotely sensed FD estimates to various policy and management interventions shows promise in advancing these methods to effectively track the evolution of mangrove ecosystem FD over time. Integrating satellite data with field-based measurements can help bridge remaining knowledge, observation and methodological gaps to track changes in FD over time. Such an integrated approach on FD monitoring can guide policy interventions, including conservation, restoration, and other land-management strategies, aimed at preserving and enhancing mangrove ecosystems.

Selection of ecologically meaningful mangrove traits/VIs for FD estimation

Our approach leveraged multi-trait data on photosynthetic activity (LCC), leaf mass per area (LMA), and water content (EWT) derived from radiative transfer model inversion to estimate mangrove FD. While this approach offers a trait-specific understanding of functional variation within the studied mangrove ecosystem and backed with in-situ measurements for calibration and validation, our analysis revealed the critical role of input variable selection in accurately characterizing FD within mangrove ecosystems. We found that the choice of input metrics (i.e., functional traits and VIs) differentially affects the quantification of richness, divergence, and evenness, the three core components of FD. Importantly, the degree of independence among input metrics is closely linked to FD results. To exemplify, our results confirmed the expected pattern that higher correlation among input traits/VIs was associated with lower FD. These findings suggest that the selection of functional traits (i.e., LCC, LMA, EWT), characterized by both ecological relevance and independence, is key to the representation of mangrove FD and spatiotemporal patterns observed.

When using VI as input for FD mapping, initial prioritization typically emphasizes their perceived ecological relevance within specific habitats or the inherent meaning of the VIs themselves. However, our correlation assessment and PCA indicated that VIs with distinct ecological interpretations may still exhibit strong intercorrelations (i.e. SLAVI, NDMI, and MCARI) when using multi-spectral sensors such as S2. Such high collinearity requires careful analysis to disentangle spectrally dominant features and redundancy to ensure representation. Potentially, the use of physically-based approach, i.e. an radiative transfer model inversion, or other corrections could help to extend separation into distinct biophysical signals of interest rather than ingesting the combined and potentially redundant spectral responses and inter-correlations among bands.

Regarding the choice of functional traits, the current study employed exclusively physiological traits (i.e., LCC, LMA, EWT) due to the absence of morphological traits input for FD estimation. Physiological traits primarily reflect internal properties (e.g., chlorophyll content, leaf mass per area, and water content). In contrast, morphological traits encompass the external characteristics of organisms Influencing their form, structure, and appearance (e.g., foliage architecture, crown diameter, height, and leaf area)22,23,43. Further investigations are warranted to integrate these traits for inter- and intra-specific for a more comprehensive configuration of trait space covering both physiological and morphological functional traits.

Ultimately, the selection of input metrics hinges on the specific research questions, analytical approaches employed, and the number of traits incorporated. We support two rigorous criteria for selecting ecologically relevant traits that satisfy: (i) a demonstrably strong link to distinct ecological strategies, and (ii) degree of independence to inter-trait correlations.

Perspective for remotely sensed FD for mangrove monitoring

In this study, we utilized multispectral imagery S2, taking advantage of spectral-biophysical derivatives for mangrove FD mapping54. Nonetheless, it is important to acknowledge the complementary capabilities of other remote sensing technologies. For instance, light detection and ranging (LIDAR) onboard airborne or spaceborne platforms, or backscattering signals from radar satellites, offer the capacity to capture detailed structural information of understory and overstory mangroves55,56,57. Additionally, hyperspectral sensors offer more detailed imaging spectroscopy, leading to better predicting VIs and traits based on narrow bands58. For local applications, synergistically employing spaceborne sensors with lower observation altitude unmanned aerial vehicles (UAVs) may bridge the gap between field measurement and satellite monitoring59.

Our previous work achieved accurate functional trait prediction (LCC, LMA, EWT) with a Normalized Root Mean Square Error (NRMSE) below 17%9, facilitating mangrove FD mapping using freely accessible S2 imagery. However, the 10 m spatial resolution of S2 presents a challenge for resolving fine-scale patterns of diverse mangrove types, such as reforested mangroves over our study sites. While high or very-high resolution imagery is advantageous, ensuring sufficient variability in trait values between adjacent pixels is critical for robust FD estimation. As evidenced by60, the variation hypothesis, which posits a link between per-pixel trait variation and detectable ecological niches, holds a significant influence. In simpler terms, achieving high resolution is not the sole consideration. The plot size within the FD model must also be large enough to capture meaningful differences between sampled units. For example, a plot size of 10 × 10 pixels with uniform trait values across all pixels would likely yield negligible or null FD results. Therefore, gaining valuable insights into mangrove restoration/reforestation still remains a dual challenge of not only remote sensing capacities but also trait retrieval models61,62.

Ultimately, long-term tracking is essential for establishing quantitative relationships between biodiversity and ecosystem functioning in mangroves63. The recent Sentinel-2C mission, operating simultaneously with Sentinel-2A and Sentinel-2B, offers a promising solution for long-term and high revisit monitoring. However, acquiring high-quality optical imagery in tropical regions remains challenging due to persistent cloud cover contamination9. In this study, we employed the typical mean composite of S2 images acquired throughout 2023, which fortunately provided gap-free coverage of the entire study site. For long-term assessments, spatially explicit gap-filling techniques are necessary. These techniques typically involve pre-processing steps like cloud removal and gap-filling algorithms to ensure the generation of high-quality, spatially consistent products.

Materials and methods

A schematic workflow diagram for mangrove FD mapping is depicted in (Fig. 9). Details of each step are further described in the next sections.

Fig. 9
figure 9

Workflow diagram for mangrove FD mapping using S2 spectral-biophysical derivatives.

Datasets

Preprocessing

Multispectral imagery acquired by the S2 constellation, specifically surface reflectance products (Level-2A), 10 m (m) spatial resolution was employed by downloading automatically in Earth Engine Data Catalog. Each individual image underwent cloud detection and masking using the quality band (QA60). We also leveraged S2 cloud probability datasets64,65 to remove effectively defective pixels affected by saturation, darkness, cloud shadows, low to high cloud probability, and cirrus. All pre-processed S2 images acquired in 2023 were used to retrieve further various mangrove traits as well as VIs. The mean values were subsequently calculated as representing the average conditions for the year.

Over the examined area, different landcover attributes (i.e., built-up, aquaculture, water bodies, bare soil) were observed intermixed with the mangrove spatial pattern7,66,67. Hence, we masked all non-mangrove pixels by using the mangrove vegetation index (MVI)68. The optimal threshold to discriminate mangrove and non-mangrove pixels suggested for Vietnam was set to 3.568.

$$\text{MVI} = \left(\text{B8-B3}\right)\text{ / (B11 -B3)}$$
(1)

where B3, B8, B11 represent S2 bands of green, near infrared, and shortwave infrared, respectively.

Mangrove stand traits

Building upon our previous work in successfully developing inversion models for retrieving different mangrove traits using a hybrid approach of physics-based combined machine learning regression algorithms9, we applied the verified models to S2 data for mapping mangrove functional traits as input for FD estimation. The model was available online in https://github.com/thangbomhn87/GEE_Mangrove (see supplementary S2). Notably, the model also enables the mapping of pixel-wise absolute uncertainty through standard deviation (SD) accompanied by trait estimation. To assess the variability around the mean values, we calculated the coefficient of variation (CV) expressed as relative uncertainty (%).

$${\text{CV}} = {\text{SD}}/{\text{estimate}} \times 100$$
(2)

Focus on physiological traits, three important biophysical properties encompassing LCC, LMA, and EWT were selected due to their diverse representation of ecological functioning69,70. Among the pigments found in vegetation, LCC stands out for its close association with plant health, reflecting photosynthetic activity71. LMA offers complementary information on the amount of leaf dry material (biomass) and the ability to capture resources72. EWT serves as an indicator of water content within the leaves, potentially revealing drought conditions and stress levels in vegetation73. These traits were also recognized as the most frequently used in tracking ecological restoration processes74.

Spectral-based VIs

VIs derived from various band ratio calculations have been the most common approach for analyzing spectral diversity in remotely sensed data3,54,75. To compare with FD estimated based on functional traits, we selected a suitable set of 17 VIs fulfilling four key criteria: (i) the most widely used, (ii) ensuring compatibility with the pre-defined bands offered by S2 data, (iii) sensitivity to biophysical and biochemical properties relevant to mangrove ecosystems, and (iv) encompassing the entire visible, near-infrared (NIR), and short-wave infrared (SWIR) spectrum. The typical annual mean of these spectral indices for the year 2023 was calculated based on the expressions listed in supplementary S3.

Methods

FD indices

The fundamental principle in FD assessment emphasized the importance of decomposing it into three primary components: richness, divergence, and evenness76. This approach has been further refined by multifaceted frameworks that allow direct translation from single traits to multiple-trait inputs32. In this study, we assembled each of the three variables (i.e., traits or VIs) as input for calculating FD indices in a 3D space.

Functional richness quantifies the variety of ecological strategies within a species assemblage or community. However, when applying a pixel-based approach, the interpretation of richness shifts to focus on the number of unique trait values observed across all pixels32. Therefore, we calculate richness by mapping all pixels defined by a moving window in a 3D functional space using convex hull volume77. In this space, each dimension represents one of the three selected variables.

Functional divergence measures the spread of trait values within a community, reflecting the degree of niche variation. In our pixel-based approach, we calculate divergence by considering how spread out the trait values are relative to an average trait value (center of gravity). Lower divergence indicates that pixels have trait values clustered close to this average, suggesting narrower niches within the community32.

$$\Delta {\text{d}}| = \mathop \sum \limits_{{{\text{i}} = 1}}^{{\text{S}}} \frac{1}{{\text{S}}} \times \left| {{\text{dG}}_{{\text{i}}} - \overline{{{\text{dG}}}} } \right|$$
(3)
$${\text{FD}}_{{{\text{iv}}}} { = }\frac{{\overline{{{\text{dG}}}} }}{{\Delta \left| {\text{d}} \right|{ + }\overline{{{\text{dG}}}} }}$$
(4)

where \(\Delta \left| {\text{d}} \right|\) is absolute abundance-weighted deviances, S is the number of pixels mapped in 3D space, \({\text{dG}}_{\text{i}}\) is the Euclidian distance between sample i and the center of gravity, \(\stackrel{\text{-}}{\text{dG}}\) is the mean Euclidian distance of all samples to the center of gravity, \({\text{FD}}_{\text{iv}}\) is the functional divergence.

While divergence measure the spread level, evenness reflects how evenly distributed trait values are across the trait spectrum32. Low evenness, with a few dominant trait values, might suggest under-utilization of available resources in the environment or a lack of suitable conditions for certain trait strategies or due to management and disturbances47.

$${\text{EW}}_{\text{l}}= \text{ } \frac{\text{dist(i,j)}}{{\text{w}}_{\text{i}}+ \text{ } {\text{w}}_{\text{j}}}$$
(5)
$$\text{PEW= }\frac{{\text{EW}}_{\text{l}}}{\sum_{\text{l=1}}^{\text{S-1}}{\text{EW}}_{\text{l}}}$$
(6)
$${\text{FE}}_{\text{VE}}= \text{ } \frac{\sum_{\text{l=1}}^{\text{S-1}}{\text{min}}\left({\text{PEW}}_{\text{l}}\text{ , }\frac{1}{\text{S-1}}\right)\text{- }\frac{1}{\text{S-1}}}{\text{1- }\frac{1}{\text{S-1}}}$$
(7)

where \({\text{EW}}_{\text{l}}\) is the weighted evenness of branch l in the minimum spanning tree, dist(i, j) is the Euclidean distance between sample i and j, w is the relative abundance, S is the number of pixels, PEW is the partial weighted evenness, \({\text{FE}}_{\text{VE}}\) is the functional evenness.

Moving from single-trait to multi-trait approaches in FD analysis introduces challenges in predicting diversity within the volume of a multi-dimensional space32. A critical aspect of constructing data points for FD involves quantifying density distributions. This process allows us to gain insights into the relationships between the three variables represented within a 3D functional space. In this study, we employed Kernel Density Estimation78, a non-parametric technique, to estimate the Probability Density Function based on the distribution of data points. To minimize the influence of potential outliers on the overall distribution, we utilized only data between 5 and 95th percentile for subsequent FD analysis.

Functional space: input and scale

For biophysical derivatives, three functional traits LCC, LMA, and EWT were selected as input for multi-trait-based FD estimation. Prior to FD estimation, all input metrics were normalized to a 0–1 range to avoid bias in measurement scales. To investigate the effect of spatial scale, moving window sizes of 4 × 4, 6 × 6, 8 × 8, and 10 × 10 pixels were employed. These window sizes correspond to ecologically relevant niche areas of approximately 0.16, 0.36, 0.63, and 1 hectare, respectively. The requirement for minimum window size (4 × 4) needs to be higher than 3D volume space. Conversely, the maximum window size (10 × 10) minimizes the potential for discontinuities introduced by the fragmented spatial distribution over mangrove forests.

Regarding the usage of VIs for multi-trait-based FD estimation, it should be emphasized the importance lies in selecting ecologically relevant traits that capture distinct facets within multidimensional trait space. Highly correlated input metrics may introduce redundancy into the FD analysis, potentially masking the unique contributions of individual traits. A thorough understanding of the interrelationships between input variables is crucial for comprehensively interpreting the contribution of each independent trait to ecological niche differentiation. Consequently, assessing correlation becomes essential to identify the most informative factors driving robust FD modeling. We sampled all mangrove pixels across 20 input functional traits/VIs to perform bivariate correlation analysis as well as PCA. Two strategies for spectral-based selection were subsequently employed: (1) utilizing three VIs demonstrably independent of each other based on correlation analysis, and (2) employing three VIs known to represent ecologically significant biophysical and biochemical properties.