Spectral Complexity of Hyperspectral Images: A New Approach for Mangrove Classiﬁcation

: Hyperspectral remote sensing across multiple spatio-temporal scales allows for mapping and monitoring mangrove habitats to support urgent conservation efforts. The use of hyperspectral imagery for assessing mangroves is less common than for terrestrial forest ecosystems. In this study, two well-known measures in statistical physics, Mean Information Gain (MIG) and Marginal Entropy (ME), have been adapted to high spatial resolution (2.5 m) full range (Visible-Shortwave-Infrared) airborne hyperspectral imagery. These two spectral complexity metrics describe the spatial heterogeneity and the aspatial heterogeneity of the reﬂectance. In this study, we compare MIG and ME with surface reﬂectance for mapping mangrove extent and species composition in the Sierpe mangroves in Costa Rica. The highest accuracy for separating mangroves from forest was achieved with visible-near infrared (VNIR) reﬂectance (98.8% overall accuracy), following by shortwave infrared (SWIR) MIG and ME (98%). Our results also show that MIG and ME can discriminate dominant mangrove species with higher accuracy than surface reﬂectance alone (e.g., MIG–VNIR = 93.6% vs. VNIR Reﬂectance = 89.7%).


Introduction
Mangroves are considered to be among the most threatened ecosystems on Earth [1], despite their ecological and economical importance. Globally, mangroves cover 137,760 km 2 [2] and are estimated to be disappearing at a rate of approximately 1% annually, primarily caused by human alteration to the landscape [1,3]. Conversion of mangrove habitats to agriculture, aquaculture, urbanization, and their over-exploitation are among the leading causes for their loss and there is an urgent need for conservation and restoration [1,4,5]. Structurally, mangroves are characterized by a unique composition of tree and shrub species capable of thriving in saline conditions [4]. They are primarily found in coastal environments in the tropical and subtropical regions of the world, forming an interface between the sea and terrestrial environment [6,7]. They serve as an important ecological and economic resource providing many ecosystem services [8][9][10]. For instance, mangroves serve both as a barrier that protects coastlines and as significant carbon sinks (blue carbon) [11], thus serving as a key natural climate solution to mitigate global warming [4,12]. The structural complexity of mangrove forests makes them highly efficient in trapping laterally imported carbon from riverine and oceanic sources [11]. It has therefore become increasingly important to monitor the periodic changes of their extent and distribution to assist in conservation planning [13]. However, the inundation and inaccessibility that on the development of methods for quantifying ecosystem structural complexity [28]. For instance, spatial and aspatial measures of complexity known as the Mean Information Gain (MIG) and Marginal Entropy (ME) derived from a single band of RGB photographs (from digital cameras) have been developed for rapid assessments of ecosystems [28,29]. MIG is a measure of the randomness of a given landscape, considering the spatial variation in reflected radiation across the landscape. In other words, MIG provides an estimate of the spatial heterogeneity of the reflectance in the landscape being studied. In contrast, ME (i.e., Shannon Entropy) provides an estimate of aspatial spectral heterogeneity, which is the probability of observing a pixel value independent of its location in the scene [30]. Several studies have demonstrated the utility of these metrics for biodiversity assessments, with promising results. For instance, an empirical relationship was established between MIG estimated from digital photographs and benthic epibiota richness and evenness [27], and MIG computed from digital photographs and satellite imagery has been linked to habitat complexity of a coral reef [31]. Similarly, a positive relationship was established between biodiversity metrics of understory vegetation in a temperate forest and MIG and ME derived from digital RGB photographs [30,32]. Despite the promising results attained in these studies, MIG and ME metrics have not yet been applied to HSI for mangrove forest extent and species mapping. The MIG and ME adapted to HSI are referred to as spectral complexity metrics (SCM), where MIG is the spectral reflectance spatial heterogeneity (spectro-spatial heterogeneity) and ME is the spectral reflectance aspatial heterogeneity (aspatial spectral complexity) [28,33].
In this study, MIG and ME are applied to high spatial resolution (2.5 m) full range (Visible-Shortwave-Infrared) airborne hyperspectral imagery acquired over the Sierpe mangroves in southern Costa Rica. The three main objectives of our study are: (1) To determine the utility of the spectral complexity metrics (MIG and ME) for discriminating mangrove extent from terrestrial forest, (2) To compare the separability of predominant mangrove species using spectral complexity metrics and surface reflectance, and (3) To examine the spectral variability of the predominant mangrove species across the visible to shortwave infrared regions. It is expected that the results from this study will support landscape mapping of mangrove forest extent and species distribution to complement global mangrove conservation efforts.

Study Site
Our study focused on approximately 18,000 ha of mangrove forest in Sierpe, along the southwest Pacific coast of Costa Rica ( Figure 1). The Térraba-Sierpe mangroves, as they are known in Costa Rica, are found in the estuary of the Rio Grande de Térraba and Rio Sierpe rivers [34]. This large mangrove ecosystem constitutes approximately 40% of all mangroves in the country. The adjacent old-growth tropical wet forest on the Osa peninsula is known for its high biodiversity. It is part of a large conservation area known as the Área de Conservación de Osa (ACOSA) [35,36] (Figure 2). Although the study area is considered to have undergone minimal disturbance compared to other similar habitats in Costa Rica, it is threatened due to anthropogenic activities and economic factors [37].
Despite these ongoing threats, very few studies have attempted to map the recent status and extent of the mangroves on a landscape scale. Apart from global efforts to map overall mangrove extent [2,38], some large-scale mapping of mangrove extent was conducted two decades ago using moderate resolution (30 m) Landsat TM satellite imagery and SPOT-2 Imagery (60 m resolution) [39]. Although some recent landscape scale species distribution mapping efforts have also been conducted with RapidEye satellite imagery (e.g., [40]) and a combination of field surveys, aerial photographs from the Costa Rican Airborne Research and Technology Applications (CARTA) mission along with Quickbird imagery [41], continued temporal monitoring of mangrove extent and species distribution on a landscape scale is needed for conservation planning and decision making. The predom-Remote Sens. 2021, 13, 2604 4 of 28 inant species in Sierpe include Rhizophora racemosa (mangrove tree), Pelliciera rhizophorae (mangrove tree), Rhizophora mangle (mangrove tree) and Acrostichum aureum (fern) [40].
Remote Sens. 2021, 13, x FOR PEER REVIEW 4 of 29 imagery [41], continued temporal monitoring of mangrove extent and species distribution on a landscape scale is needed for conservation planning and decision making. The predominant species in Sierpe include Rhizophora racemosa (mangrove tree), Pelliciera rhizophorae (mangrove tree), Rhizophora mangle (mangrove tree) and Acrostichum aureum (fern) [40].    The delimitation of terrestrial forest and mangroves is more apparent from the HSI than from the aerial photograph.

Airborne Hyperspectral Imagery (HSI)
We used airborne HSI acquired by Mission Airborne Carbon 2013 (MAC13) [42]. The imagery consists of data from two distinct pushbroom sensors, the Compact Airborne The delimitation of terrestrial forest and mangroves is more apparent from the HSI than from the aerial photograph.

Airborne Hyperspectral Imagery (HSI)
We used airborne HSI acquired by Mission Airborne Carbon 2013 (MAC13) [42]. The imagery consists of data from two distinct pushbroom sensors, the Compact Airborne Spectrographic Imager 1500 (CASI) and the Shortwave Airborne Spectrographic Imager 644 (SASI). The CASI-1500 acquired 199 spectral bands across the 375 nm to 1050 nm wavelength range, while the SASI acquired 160 spectral bands across the 883 nm to 2523 nm range. Characteristics of the sensors and sample flight planning parameters are outlined in Tables 1 and 2.  [43] considering the FWHM of a Gaussian point spread function (PSF) in the determination of the pixel resolution as acquired.

Pre-Processing
The raw images were preprocessed to radiance following the standard methodology described in [42,44]. The Atmospheric and Topographic correction module implemented in ATCOR-4 (rugged terrain) (Version 7.3.0 2019) was used to account for the influence of the atmosphere, terrain, solar illumination geometry, and viewing geometry of the sensor to derive surface reflectance. Although our study was focused on the mangroves, surrounding terrestrial forests were characterized by highly variable topographic complexity, with a mean elevation and standard deviation of 100 m and 119 m, representing an elevation range of 0-669 m [42]. Topographic differences are known to cause variability in the incident radiation [45]; as a result, bidirectional reflectance effects are inevitable, with potential implications on the quality of the spectral information [46]. This topographic influence traceable to individual pixels must be accounted for during the preprocessing stage to ensure consistency in the spectra [45,46]. The incident angle topographic BRDF effect was corrected using the Modified Minnaert (MM) topographic correction routine available in ATCOR-4 [46].
The low signal and noisy regions of the CASI (<400 nm and >900 nm) were excluded from further analysis. For the SASI, bands in the wavelength ranges between 1367 nm-1492 nm and 1800 nm-2200 nm were excluded from the analysis due to atmospheric water Remote Sens. 2021, 13, 2604 7 of 28 absorption and known low signal-to-noise ratio. Finally, because spectral artefacts tend to remain after atmospheric correction, particularly for high spectral resolution datasets [47], spectral polishing was applied in ATCOR-4 to reduce these residual artefacts. The final number of bands that remained for the CASI and SASI were 174 and 65, respectively. The parameters used for the atmospheric correction are shown in Table S1 (Supplementary Material).
After atmospheric correction, the flight lines were geocorrected following [42,44], using the NASADEM [48] digital elevation model. Typically, airborne HSI over large geographic areas requires multiple flight lines. These images are characterized by distinct acquisition times, and thus, differing illumination geometry, which usually results in variable illumination effects. Therefore, to map on a landscape scale the extent and distribution of mangrove species, it was important to have spectrally consistent datasets covering the landscape. Hence, after atmospheric correction, it was necessary to normalize the illumination differences observed between individual flight lines to ensure spectral consistency across entire image scene.
During data acquisition, the last flight line on the 29 April was repeated on the 30 April. Pixels from these repeated flight lines were used to compute scaling constants for normalizing the illumination effects before applying them to the other flight lines. Over 100,000 cloud free pixels were selected from same areas in both images. Pearson's correlation coefficient was computed for each pixel pair to determine the correlation of their reflectance spectra. Differences in reflectance were estimated between pixel pairs for each band and the results averaged for use as scaling constants to account for the variable illumination effects.
The CASI and SASI sensors have different along and across track pixel resolutions in the original acquisition geometry (Table 1), because they have different point spread functions (PSF), FOVs, sensor characteristics, and integration times. Considering the FWHM of the PSF in the determination of the pixel resolution, with the acquisition parameters (i.e., altitude, speed, integration time, frame time) following the methodology described by [43], approximately only 58% of the spectrum from a given pixel originates from materials that fall within the area of the raw pixel resolution in both across and along track directions. This emphasizes that there are differences in the material contributions to the pixels from the two sensors. Therefore, all analyses were performed on the two datasets separately.

Non-Overlapping Window Size Determination
The implementation of SCM is based on a non-overlapping window (i.e., edges of a square blocks or tiles of imagery) approach. Before its calculation, determining the optimal window size for the computation was a key consideration in our analysis. First, we explored different window sizes to ensure appropriate pixel pairs are captured that could depict both the spatial and aspatial heterogeneity within a unit area [49]. To determine the suitable window size for both CASI and SASI imagery for separating mangrove from forest, three window sizes were explored, starting from a 25 × 25 pixel window, which represents 0.4 ha, to 100 × 100 pixels (6.25 ha) and 200 × 200 pixels (25 ha). To discriminate mangrove species, we examined two additional smaller windows sizes 10 × 10 pixels (0.063 ha) and 5 × 5 pixels (0.016 ha). Since, the predominant mangrove species in the study area occur in stands > 1 ha (40 × 40 pixels), the above-mentioned window sizes were deemed suitable for species classification. Next, the SCM were computed for both the CASI and SASI imagery ( Figure 3). As seen in Figure 3, windows that span the NoData region outside the flight line boundaries will have an influence on the SCM estimates at the edges of the images. We consider this influence to be minimal in this analysis considering the landscape scale at which the implementation was done (HSI mosaic > 18,000 ha).

Spectral Complexity Metrics (SCM)
The SCM were computed in MATLAB v2018b for each spectral band of the CASI (VNIR = 174 bands) and SASI (SWIR = 65 bands) imagery. The methods proposed by [30,32] were followed to compute MIG and ME as described below.
The MIG (Equation (1)) computes the spectro-spatial heterogeneity (p(Xi)) for a given image that is exclusive of the portion of aspatial spectral heterogeneity (p(Yi)) [32].
where: k = 4 (i.e., the observed 2 × 2-pixel neighborhood; when k = 4, it means the combination of positions (x, y), (x + 1, y), (x, y + 1) and (x + 1, y + 1) in the image); N k signifies the maximum number of possible reflectance combinations, given a set number of reflectance values (bins), N; log (N k ⁄N) is used to normalize MIG values between 0 and 1;

Spectral Complexity Metrics (SCM)
The SCM were computed in MATLAB v2018b for each spectral band of the CASI (VNIR = 174 bands) and SASI (SWIR = 65 bands) imagery. The methods proposed by [30,32] were followed to compute MIG and ME as described below.
The MIG (Equation (1)) computes the spectro-spatial heterogeneity (p(X i )) for a given image that is exclusive of the portion of aspatial spectral heterogeneity (p(Y i )) [32].
where: k = 4 (i.e., the observed 2 × 2-pixel neighborhood; when k = 4, it means the combination of positions (x, y), (x + 1, y), (x, y + 1) and (x + 1, y + 1) in the image); N k signifies the maximum number of possible reflectance combinations, given a set number of reflectance values (bins), N; log (N k ⁄N) is used to normalize MIG values between 0 and 1; p(X i ) is the probability of locating a specific 2 × 2 combination of pixel reflectance; and p(Y i ) is the relative frequency or probability of locating reflectance value (Y i ) in the image irrespective of its location.
To avoid biasing due to undersampling of the 2 × 2 reflectance combination in the image, it is generally recommended that the ratio of the total number of pixels in the image to N k should be greater than 100. Based on this, we chose a bin value (classes of reflectance values), N = 18. We chose the highest theoretically feasible 2 × 2 reflectance combination to preserve as much information as possible [32].
The ME was computed according to Equation (2): where p(Y i ) is the probability of locating a specific pixel reflectance value in a 2-dimensional image independent of the position of that pixel in the image. The MIG and ME values ranges from 0 to 1 with the 0 corresponding to patterns with uniform spectral composition whilst high values close to 1 depict random or highly differentiable patterns ( Figure 4).
Remote Sens. 2021, 13, x FOR PEER REVIEW 9 of 29 p(Xi) is the probability of locating a specific 2 × 2 combination of pixel reflectance; and p(Yi) is the relative frequency or probability of locating reflectance value (Yi) in the image irrespective of its location. To avoid biasing due to undersampling of the 2 × 2 reflectance combination in the image, it is generally recommended that the ratio of the total number of pixels in the image to N k should be greater than 100. Based on this, we chose a bin value (classes of reflectance values), N = 18. We chose the highest theoretically feasible 2 × 2 reflectance combination to preserve as much information as possible [32].
The ME was computed according to Equation (2): where p(Yi) is the probability of locating a specific pixel reflectance value in a 2-dimensional image independent of the position of that pixel in the image. The MIG and ME values ranges from 0 to 1 with the 0 corresponding to patterns with uniform spectral composition whilst high values close to 1 depict random or highly differentiable patterns ( Figure 4).

Mangrove-Forest Classification
A forward feature selection (FFS) [50] was implemented on all three versions of the data (i.e., spectral reflectance, ME, and MIG) with the PRTools toolbox version 5.4.2 [51,52] in Matlab v2018b to reduce the dimensions of the data while identifying the optimal bands that best separates the classes. For the mangrove extent classification, 500 pixels of SCM and 6000 pixels of reflectance at the native spatial resolution (2.5 m) representing both terrestrial forest and mangroves were selected from one of the flight lines. We then implemented the FFS on these data based using the nearest neighbor (NN) criterion. The FFS algorithm selects the features (i.e., bands) by first identifying the most distinct, sequentially adding bands to the set in the order that they improve the separability of the classes [50].

Mangrove-Forest Classification
A forward feature selection (FFS) [50] was implemented on all three versions of the data (i.e., spectral reflectance, ME, and MIG) with the PRTools toolbox version 5.4.2 [51,52] in Matlab v2018b to reduce the dimensions of the data while identifying the optimal bands that best separates the classes. For the mangrove extent classification, 500 pixels of SCM and 6000 pixels of reflectance at the native spatial resolution (2.5 m) representing both terrestrial forest and mangroves were selected from one of the flight lines. We then implemented the FFS on these data based using the nearest neighbor (NN) criterion. The FFS algorithm selects the features (i.e., bands) by first identifying the most distinct, sequentially adding bands to the set in the order that they improve the separability of the classes [50].
Theoretically, to avoid overfitting, the maximum number of bands (F) necessary for separation of the number of classes can be determined from Equation (3) [53].
where n is the number of samples and g is the number of classes. Next, we extracted the optimal bands from the FFS to train and evaluate the classification performance of selected machine learning (ML) algorithms in MATLAB R2018b. Four ML classifiers frequently used in the literature, namely, k-nearest neighbor (KNN), quadratic support vector machine (Q-SVM), linear and quadratic discriminant (LDA and QDA) classifiers were tested. The classification performance of each ML algorithm was assessed using a 20% hold-out equivalent to minimum of 50 samples per class (i.e., using 80% of the dataset for training and 20% for testing).

Mangrove Species Classification
We used ArcGIS 10.7.1 to georeference published ground data of mangrove species distribution over the study area [41]. This reference map from [43] was produced using a combination of aerial photographs, Quickbird satellite imagery, and 1127 sample points from 77 field plots (60 m × 10 m) distributed across the study area. We overlaid the reference map on the HSI and extracted 181 ground truth regions of interest randomly distributed across the study area ( Figure S1). Each region covered approximately 1.6 ha and represented the six predominant classes (five mangrove species classes and a forest class). The mangrove species classes included 3 pure stands: Acrostichum aureum (ACAU), Pelliciera rhizophorae (PERH), Rhizophora racemosa (RHRA); two mixed stands: Acrostichum aureum-Rhizophora racemosa (ACAU-RHRA), Rhizophora racemosa-Pelliciera rhizophorae (RHRA-PERH); and a forest class. To compare the separability of these predominant mangrove species, the spectral reflectance data were re-sampled to the same spatial resolution as the SCM (nearest neighbor resampling). Next, an FFS was run separately on the reflectance data (both native resolution and spatially resampled) and the SCM using pixels within the ground truth target areas. Table 3 provides a summary of the number of training pixels used for the analysis per metric. We increased the total sample size to 30,000 pixels to constitute 5000 pixels per class to capture spectral variability of the reflectance for classification, due to the small pixel size of the reflectance data at the native spatial resolution. Using the optimal bands selected from the FFS, we trained KMM, LDA, and Q-SVM classifiers in MATLAB v2018b.
Next, the accuracy of each classifier was assessed using a confusion matrix. The sample size (i.e., >150 pixels) used for the calculation of the error matrix was consistent with the minimum sample requirement, as determined using a multinomial distribution equation [54]. For the six predominant species classes (k = 6) and a desired confidence level (α) of 90%, the minimum sample size can be calculated (Equation (4)): where:

Computation of Spectral Beta (β) Diversity
Finally, to determine the spectral variability of the predominant mangrove species, we calculated a measure of spectral β diversity for each mangrove class. For the reflectance data (2.5 m) from within each of the ground truth regions of interest for each class, 500 randomly sampled pixels were used (n = 83,500). For the SCM (25 m) and spatially resampled reflectance, (25 m), approximately 2000 pixels representing all 6 classes were used for the computation of β diversity. The spectral β diversity is a measure of the spectral variation of each mangrove class. Following [55], we calculated the spectral β diversity of the predominant mangrove species classes using MIG and ME at a spatial resolution of 25 m, and spectral reflectance at both 2.5 and 25 m. For the sum-of-squares partitioning approach to calculating the spectral β diversity it is imperative that all communities (regions of interest: ROI) have an equal number of pixels [55]. To achieve this, we sampled a constant (m) number of pixels in each ROI selected for each input data (i.e., SCM and reflectance). By extracting the mean of the (m) pixels in each ROI (k) and grouping per class, we computed β diversity (SS β,k ) using Equations (5) and (6). where: S kj = Squared deviation of the kth community (ROI) and jth band. y kj = The mean of m pixels of ROI (k) per class corresponding to the jth band. y j = The mean of each class (column) and corresponding to the jth band.
A Shapiro-Wilk test of normality was conducted for SS β,k of all classes. Based on the outcome of the normality test, either a Tukey post-hoc test or Kruskal-Wallis test was implemented to examine the differences in spectral variability between each pair of the mangrove species at a 95% confidence level.

Spectral Consistency
An example of the mean and standard deviation of vegetation spectra representing the same mangrove vegetation covering 41.8 ha (~67,000 pixels) from two neighboring flight lines before and after illumination normalization is shown in Figure 5. Prior to the illumination normalization, the spectra were quite dissimilar with differences of up to 30% for the VNIR and up to 20% for the SWIR. After normalization, the spectral similarity improved with differences < 5% across the spectral range indicating an improvement in the spectral consistency (Figure 5c,d) across the two flight lines.

Spectral Reflectance and Spectral Complexity Metrics
The mean and standard deviation of the spectral reflectance, ME, and MIG representing forest and mangrove, are shown in Figure 6. For the reflectance data, across the blue through red-edge wavelength range, the mean spectra of mangrove and forest are very similar (<1% difference). The difference increased to 1-4% difference in the NIR and up to 7% in the SWIR (Figure 6).

Spectral Reflectance and Spectral Complexity Metrics
The mean and standard deviation of the spectral reflectance, ME, and MIG representing forest and mangrove, are shown in Figure 6. For the reflectance data, across the blue through red-edge wavelength range, the mean spectra of mangrove and forest are very similar (<1% difference). The difference increased to 1-4% difference in the NIR and up to 7% in the SWIR ( Figure 6).

Mangrove Extent Classification
The summaries of the results for the FFS (reflectance and SCM) are presented in Figure 7 and Figure S2. With the reflectance data at the native spatial resolution, 33 bands were optimal in the VNIR, corresponding to a separability value of 0.97, while 26 bands were optimal (separability value = 0.90) in the SWIR. Figure 8 shows the respective positions of the optimal bands in the electromagnetic spectrum for both VNIR and SWIR reflectance (2.5 m). After the transformation of VNIR reflectance to the SCM, the best separability was achieved with a window size of 250 m (100 × 100 pixels). The optimal bands reduced to 18 for MIG, and 15 for ME, with separability values of 0.99 and 0.97, respectively (Figure 9a). For the SCM-SWIR, the best separability was achieved at the 62.5 m scale (Figure 7 and Figure S2). Six bands were optimal for MIG-SWIR with a separability value of 0.99, while 20 optimal bands corresponding to a separability value of 0.99 were selected for ME-SWIR. The position of the optimal spectral bands for MIG-SWIR is shown in Figure 9b. Figure S2 presents the results for the FFS from the other windows sizes.
The overall best mangrove extent classification accuracy using the optimal bands (Figures 7-9) is shown in Figure 10. The overall best mangrove classification accuracy attainable with the reflectance data at the native spatial resolution was 98.8% and 95.3% for CASI (VNIR) and SASI (SWIR), respectively (Q-SVM classifier). However, the SCM-SWIR (both MIG and ME) had a classification accuracy 2.7% higher than reflectance (i.e., 98%) ( Figure 10) for both MIG (KNN classifier) and ME (Q-SVM classifier) The overall best classification accuracy for MIG (VNIR) and ME (VNIR) was 98% (KNN classifier for both). . The MIG and ME values of forest were larger than that of mangrove from the VNIR to the SWIR region of the electromagnetic spectrum except at 1516 nm and 1792 nm. In the VNIR portion of the spectrum, the difference between forest and mangrove ranged between 0.03-0.1 for MIG and 0.02-0.08 for ME. In the SWIR portion of the electromagnetic spectrum, the difference between forest and mangrove ranged between 0.01 to 0.13 for MIG and 0.02-0.18 for ME. The greatest differences between both mean MIG and ME of forest and mangrove were recorded in the NIR (>765 nm) and between the wavelength ranges 1553 nm-1738 nm for SWIR ( Figure 6).

Mangrove Extent Classification
The summaries of the results for the FFS (reflectance and SCM) are presented in Figure 7 and Figure S2. With the reflectance data at the native spatial resolution, 33 bands were optimal in the VNIR, corresponding to a separability value of 0.97, while 26 bands were optimal (separability value = 0.90) in the SWIR. Figure 8 shows the respective positions of the optimal bands in the electromagnetic spectrum for both VNIR and SWIR reflectance (2.5 m). After the transformation of VNIR reflectance to the SCM, the best separability was achieved with a window size of 250 m (100 × 100 pixels). The optimal bands reduced to 18 for MIG, and 15 for ME, with separability values of 0.99 and 0.97, respec- . Scales with the best separability between forest and mangrove for the SCM are shown (see Section 3.3). The MIG and ME values of forest were larger than that of mangrove from the VNIR to the SWIR region of the electromagnetic spectrum except at 1516 nm and 1792 nm. In the VNIR portion of the spectrum, the difference between forest and mangrove ranged between 0.03-0.1 for MIG and 0.02-0.08 for ME. In the SWIR portion of the electromagnetic spectrum, the difference between forest and mangrove ranged between 0.01 to 0.13 for MIG and 0.02-0.18 for ME. The greatest differences between both mean MIG and ME of forest and mangrove were recorded in the NIR (>765 nm) and between the wavelength ranges 1553 nm-1738 nm for SWIR ( Figure 6).
The overall classification performance was comparable for reflectance (VNIR) and SCM (VNIR). However, with the SCM (SWIR) data, the overall classification was more accurate compared to reflectance (SWIR). The summary of classification performance of the different metrics is presented in Figure 10.

Reflectance (%)
Forest Mangrove    Figure 10. The mean classification accuracy for mangrove and forest achieved for each of the input datasets assessed in this study (i.e., Reflectance, MIG, and ME) for both VNIR and SWIR imagery. The error bars illustrate the minimum and maximum overall classification accuracy achieved for each dataset.

Feature Selection for Species Discrimination
Based on the FFS at the native spatial resolution of 2.5 m, for the spectral reflectance, 52 optimal bands (VNIR) were needed to separate the six classes resulting in a nearestneighbor (NN) criterion value of 0.81 (Figure 11a). For the SWIR reflectance data at 2.5 m, 34 bands were optimal (NN Criterion = 0.89) for the six classes (Figure 11b). This shows a better separability in the SWIR between the six predominant species classes compared to VNIR reflectance. It is important to note that due to the small pixel size of the imagery, different sets of randomly selected representative pixels will result in different sets of optimal bands. At the coarsest SCM scale (62.5 m), a maximum criterion value of 0.92 (38 Figure 10. The mean classification accuracy for mangrove and forest achieved for each of the input datasets assessed in this study (i.e., Reflectance, MIG, and ME) for both VNIR and SWIR imagery. The error bars illustrate the minimum and maximum overall classification accuracy achieved for each dataset.
The overall classification performance was comparable for reflectance (VNIR) and SCM (VNIR). However, with the SCM (SWIR) data, the overall classification was more accurate compared to reflectance (SWIR). The summary of classification performance of the different metrics is presented in Figure 10.

Feature Selection for Species Discrimination
Based on the FFS at the native spatial resolution of 2.5 m, for the spectral reflectance, 52 optimal bands (VNIR) were needed to separate the six classes resulting in a nearestneighbor (NN) criterion value of 0.81 (Figure 11a). For the SWIR reflectance data at 2.5 m, 34 bands were optimal (NN Criterion = 0.89) for the six classes (Figure 11b). This shows a better separability in the SWIR between the six predominant species classes compared to VNIR reflectance. It is important to note that due to the small pixel size of the imagery, different sets of randomly selected representative pixels will result in different sets of optimal bands. At the coarsest SCM scale (62.5 m), a maximum criterion value of 0.92 (38 optimal bands) was achieved for MIG-VNIR (Figure 12 The greatest separability between the species classes was found for an SCM window size of 25 m with 0.94 for both ME-VNIR (39 optimal bands) and MIG-VNIR (57 optimal bands) ( Figure 13). At the smallest SCM window size of 12.5 m, the separability of the six classes was the lowest at 0.85 for both ME-VNIR and MIG-VNIR. For SCM-SWIR, a separability of 0.82 was recorded for both ME and MIG (25 m spatial resolution). The lowest separability was recorded for the SWIR at the 12.5 m resolution: 0.68 for MIG and 0.72 for ME.    Figure 14 shows a comparison of the classification accuracies attained when the window size is varied from 12.5 to 62.5 m. For the VNIR, the lowest classification error was achieved with ME (93.6%, Q-SVM classifier) at a window size of 25 m. In comparison, the highest classification accuracy from the reflectance at the native spatial resolution was 89.7% (Q-SVM classifier). The best classification accuracy for the SWIR was achieved by Additionally, the results of the FFS for only the pure classes made up of PERH, ACAU, and RHRA show that at 2.5 m, 54 bands in the VNIR and 30 bands in the SWIR reflectance could attain a high NN criterion of 0.92 and 0.95, respectively. With 22 optimal bands, MIG-VNIR (25 m) and ME-VNIR (25 m) recorded criterion values of 1 to constitute the best separability for the pure classes. In contrast, the SCM-VNIR recorded a criterion value of 0.987 (17 optimal bands) for MIG and 0.987 (25 optimal bands) for ME at the coarsest scale (62.5 m). The outcome of the FFS also shows SCM-VNIR (25 m) having better separate specific class combinations (such as ACAU-RHRA versus RHRA-PERH) than the reflectance at native resolution. The results further show that the NN criterion values of all the metrics were highest for ACAU versus ACAU-RHRA ranging between 0.976-1. This indicates a greater separability of the ACAU and ACAU-RHRA class pair compared to the other classes examined in this study. Figure 14 shows a comparison of the classification accuracies attained when the window size is varied from 12.5 to 62.5 m. For the VNIR, the lowest classification error was achieved with ME (93.6%, Q-SVM classifier) at a window size of 25 m. In comparison, the highest classification accuracy from the reflectance at the native spatial resolution was 89.7% (Q-SVM classifier). The best classification accuracy for the SWIR was achieved by ME (84.5%, Q-SVM classifier, 25 m). However, the best SWIR classification was found for reflectance at the native spatial resolution (2.5 m) resulting in an accuracy of 94.8% with the Q-SVM classifier ( Figure 14). The overall best SCM-VNIR classification performance was found with the 25 m (10 × 10 pixel window) 93.1% and 93.6% for MIG and ME, respectively, in comparison to 80% for 25 m spatially resampled VNIR reflectance (Figure 14). At 25 m, SCM-SWIR recorded a classification accuracy between 68.8-83.7% comparable to what was recorded for SWIR reflectance (25 m) in the range of 70.1-82.7%. Figure 15 illustrates the confusion matrix of the best performing classifiers ME-VNIR at 25 m spatial resolution (Q-SVM classifier) and 2.5 m SWIR reflectance (Q-SVM classifier). The producer's accuracy for ME-VNIR ranged between 79.7-100% whilst the user's accuracy ranged between 79.4-100% (Figure 15a). The producer's accuracy for SWIR 2.5 m reflectance ranged from 83.5% to 99.6% and the user's accuracy ranged from 80.2% to 99.4% (Figure 15b). The best classification outcome for SCM-SWIR was achieved by ME (25 m) with an accuracy of 84.5%. Further evaluation of the confusion matrix of the best VNIR classifier revealed that most of the confusion was The overall best SCM-VNIR classification performance was found with the 25 m (10 × 10 pixel window) 93.1% and 93.6% for MIG and ME, respectively, in comparison to 80% for 25 m spatially resampled VNIR reflectance (Figure 14). At 25 m, SCM-SWIR recorded a classification accuracy between 68.8-83.7% comparable to what was recorded for SWIR reflectance (25 m) in the range of 70.1-82.7%. Figure 15 illustrates the confusion matrix of the best performing classifiers ME-VNIR at 25 m spatial resolution (Q-SVM classifier) and 2.5 m SWIR reflectance (Q-SVM classifier). The producer's accuracy for ME-VNIR ranged between 79.7-100% whilst the user's accuracy ranged between 79.4-100% ( Figure 15a). The producer's accuracy for SWIR 2.5 m reflectance ranged from 83.5% to 99.6% and the user's accuracy ranged from 80.2% to 99.4% (Figure 15b). The best classification outcome for SCM-SWIR was achieved by ME (25 m) with an accuracy of 84.5%. Further evaluation of the confusion matrix of the best VNIR classifier revealed that most of the confusion was between the RHRA and RHRA-PERH classes. For the best SWIR classifier (Figure 15b), the majority of the confusion was between PERH, RHRA, and RHRA-PERH. The confusion matrices for the other classifiers and scales are presented in Figures S3-S11. A species distribution map using ME-VNIR data (25 m) with the Q-SVM classifier is shown in Figure 16.

Discussion
The results from our study represent the first attempt to classify mangrove extent and mangrove species using SCM: MIG (spectral reflectance spatial heterogeneity) and ME (spectral reflectance aspatial heterogeneity) derived from airborne HSI. While the

Discussion
The results from our study represent the first attempt to classify mangrove extent and mangrove species using SCM: MIG (spectral reflectance spatial heterogeneity) and ME (spectral reflectance aspatial heterogeneity) derived from airborne HSI. While the highest accuracy separating mangroves from terrestrial forest in the VNIR was found for the reflectance data at the native spectral resolution (OA = 98.8%, Figure 10), classification accuracy of both SCM metrics outperformed the original spectral reflectance in the SWIR by 2.7%. In consideration of current and upcoming spaceborne HSI systems with coarser spatial resolutions (e.g., 30 m PRISMA, DESIS, EnMAP, HyspIRI), the classification accuracy from ME-VNIR with a 25 m window size also performed nearly as well (OA = 92%). Although the mean canopy spectral reflectance of forest and mangrove were comparable in the visible spectrum ( Figure 6), there were differences in the amplitude in the SCM spectra ( Figure 6). The observed differences in MIG and ME values for mangrove and terrestrial vegetation in the visible spectrum can be associated with differing chlorophyll absorption for those vegetation types [56]. Canopy structural differences between mangrove and forest is responsible for observable differences in MIG and ME beyond 680 nm wavelength range [57]. Furthermore, dissimilarity of the reflectance spectra for both classes in the shortwave infrared region can be attributed to differences in water content of the habitats of mangrove and terrestrial forest, with mangrove forest found in substrate with a high water content due to accumulation as a function of periodic flooding [58][59][60] (see Figure 2). Additionally, in the SWIR region, starch, sugar, lignin, protein, and nitrogen are the main canopy biochemical variables detectable at wavelengths of 1577 nm-1716 nm [61]. An earlier study conducted by [62] hypothesized that spectral differences expressed by these leaf components at a longer wavelength (e.g., SWIR and Mid infrared) can be useful for mangrove discrimination. Based on data from a field spectrometer, [9] showed that two mangrove species were separable due to their biophysical and chemical properties. This suggests that there is variability in the concentration of these components in the canopies of mangrove vegetation and terrestrial forest, thus serving as a potential indicator for separating mangrove from surrounding vegetation.
The values of the SCM are an indication of the variability of the reflectance. A value of 0.4 is generally accepted as the threshold between low and high spectral complexity. Here, forest often had a MIG and ME value above 0.4, indicating that its reflectance is more diverse than mangrove forest. Comparing both ecosystems, mangroves are considered as structurally simple (Figure 2a) in terms of species diversity with fewer microhabitats [63,64]. Conversely, tropical forests are among the most structurally complex ecosystems, characterized by high species diversity [65]. Since spectral diversity is positively correlated with species diversity [66], a unit area in an undisturbed tropical forest with high species diversity will exhibit variable spectral reflectance that can be associated with the species present. Notwithstanding, since the ME metric categorizes the landscape according to the reflectance variability, a higher ME value is expected for the adjacent tropical forest than the mangrove. Additionally, during MIG computation, spectral reflectance within a unit area is configured in a more spatially complex pattern; thus, a higher MIG value is also expected for a unit area with highly variable reflectance (high species diversity) and vice versa [27]. Computation of MIG and ME produces a spectral complexity signature that is specific to an ecosystem and can be used to discriminate different habitats [30,32]. This explains why quantifying spectral complexity from HSI in this study was largely successful in separating mangrove and terrestrial forest. Although multispectral imagery based indices such as spectral match degree (SMD), normalized difference mangrove index (NDMI), shortwave infrared absorption depth (SIAD), and a mangrove recognition index (MRI) have been proposed to discriminate mangroves from other vegetation [67,68], the classification accuracy attained in this study (OA = 98%) was higher than the overall classification accuracy (73.43-95%) reported for those indices. Additionally, the SCM also outperformed the classification accuracy (89.48%) reported for a study that employed a combination of different vegetation indices to classify mangrove forest [57].
To discriminate species, we demonstrate that unlike the SWIR reflectance, a transformation of VNIR reflectance to a measure of spectral complexity (25 m window size) can improve the classification performance (i.e., up to 93.6%) compared to the accuracy attained from the VNIR reflectance at the native spatial resolution (Figure 14). Mangrove species can grow in relatively small patches and linear stands ( Figure 2). Therefore, transforming high resolution HSI to SCM with 25 m spatial resolution could highlight reflectance heterogeneity that is characteristic of specific mangrove communities to aid their separability. Additionally, reflectance heterogeneity can be associated with differences in canopy biochemical traits, and physiological and structural properties of tree species [69,70]. Hence, a transformation of high spatial resolution HSI to SCM may highlight biochemical and structural differences specific to mangrove species. In addition, by visual examination of the HSI (Figure 2), differences between the various species can be observed. These could explain the classification accuracy attained for the SCM, despite the coarser spatial resolution of the non-overlapping window (25 m), thus serving as a useful metric for mangrove species mapping. This finding is important when considering the potential utility of spaceborne HSI (e.g., Hyperion, EnMAP, etc.) for classifying mangrove species with moderate spatial resolution (i.e., 30 m).
When comparing VNIR-SCM to VNIR-reflectance at the same spatial scale, we found that a better species classification performance is possible for the SCM than when reflectance is resampled to the same spatial scale (e.g., for 25 m resolution, ME = 93.6% and Reflectance = 80%; see Figures 14 and 15, and Figure S4). This is because resampling high spatial resolution HSI (2.5 m) leads to a loss of spectral detail (i.e., through averaging of mixed pixels) with potential impacts on classification accuracy [71]. Optimal detection of mangrove vegetation is feasible at specific spatial scales and pixel sizes; thus, a gradual decrease in classification accuracy is inevitable as high spatial resolution HSI is spatially degraded [71]. From Figure 2, gaps exist between the mangrove canopies; hence, spatially degrading high resolution HSI implies including non-mangrove spectra within the averaged spectra, whereas for SCM, the variability of mangrove canopies and non-trees captured within a 25 m window could highlight structural attributes. At the moderate resolution of the SCM (25 m), the accuracy attained in this study for MIG-VNIR and ME-VNIR (OA = 93.1% and 93.6%, respectively) was higher than in a recent study that employed Landsat 8 reflectance data (OA = 68.57%) [72] and also higher than the accuracy attained with AVIRIS-NG (spatial resolution = 5 m) for mangrove species classification (87.61%) [73]. A recent study that integrated LiDAR with HSI to map mangrove species reported overall accuracies varying from 86% to 88% [74]. Most hyperspectral remote sensing studies that have employed machine learning methods to map six or more mangrove species have reported an accuracy range between 76.12-93.6% [22,23,75], consistent with the accuracy range recorded in this study.
The key limitation of the SCM is the spatial resolution of the final product, equivalent to the size of the non-overlapping window used for the computation. This implies that mangrove communities smaller than the spatial extent of the window size cannot be detected. Originally, MIG and ME metrics have mostly been applied to terrestrial photographs from digital cameras which have much smaller pixels than the airborne HSI [27,32]. As demonstrated in this study, the choice of the window size impacts the classification accuracy ( Figure 14). Therefore, it is recommended that the suitable window size be determined based on the spatial resolution of the imagery and the scale of the analysis, before proceeding to the computation. In the future, as datasets from spaceborne HSI such as EnMap [76,77], HISUI [78], PRISMA [79], Planet HSI constellation [80], and others become widely accessible with global coverage, and new ultra-high resolution UAV-based HSI systems [81] become fully operational, the efficacy of SCM can be tested with these datasets to map mangrove extent and species composition.
Finally, spectral variability in reflectance is crucial for inter-species discrimination [26,82]. The results from the spectral β diversity analysis indicate significant differences (p < 0.05) between some predominant mangrove species from SCM and reflectance (VNIR and SWIR) data (Figures 17 and 18). At the canopy level, spectral variability is driven by factors such as vegetation type, leaf biochemical differences, plant health, background reflectance from water, soils, and other environmental factors [9,83]. Therefore, for a given neighborhood of pixels (e.g., 25 m window), the spectral composition may constitute reflected radiation from multiple targets (e.g., mangrove crowns, ferns, water, canopy shadows, gaps, etc.). These differences can result in varying estimates of SCM for each processing window even for mangrove species within the same class. Additionally, with the high spatial resolution of the airborne HSI, inter-pixel heterogeneity (e.g., locating pixels representing crown shadows or canopy gaps next to a pixel that represents tree crowns) is a common phenomenon often observed in high resolution scenes [84]. These may explain the significant differences in β diversity observed between individual classes from SCM and the reflectance data.
For SCM, except MIG-SWIR, the most variable class was found to be PERH or its association with RHRA (RHRA-PERH) while the forest class was the least variable ( Figures 17 and 18). Unlike the forest class, while RHRA and PERH are similar in terms of anatomical and physiological attributes, they differ in terms of stand heights, diameters, density, and flowering periods [85,86]; which are factors that influence spectral characteristics of those species [9]. Additionally, anthropogenic factors such as selective logging and agricultural activities commonly affect PERH, thus causing variation in stand structure [85,87], and usually colonization of the disturbed area by ACAU, a native fern whose occurrence often indicates habitat disturbance [87]. ACAU also prevents the establishment of other mangrove species, and in the context of restoration, mapping their extent can support restoration efforts [88][89][90]. Therefore, the structural and floristic variations coupled with environmental factors such as water and soil introduced reflectance variability, thereby making the PERH class and the association of PERH with RHRA (RHRA-PERH) the most variable classes.

Conclusions
The present study demonstrates the utility of spectral complexity metrics (MIG and ME), an information theory measure, derived from full range airborne hyperspectral imagery for mangrove classification. The spectral complexity metrics produced spectral signatures that can be associated with the mangrove and terrestrial forest. They can be used to not only differentiate both ecosystems but also for delineating mangrove species. Moreover, the limitation of SCM due to the spatial constraint imposed by the choice of the window size during the transformation does not permit the detection of mangrove communities smaller than the selected window size. Therefore, for optimal detection of mangrove species, selection of an appropriate window size is needed. Future studies may take advantage of the ultrafine spatial resolution (<5 cm) associated with the rapidly evolving UAV hyperspectral systems to quantify SCM to a finer spatial scale (e.g., <4 m) necessary for the detection of mangrove species at the tree level. Additionally, the results from this study suggest that SCM can be implemented on hyperspectral imagery from current and forthcoming spaceborne systems to permit monitoring of temporal trends in mangrove extent and species at large geographic scales (i.e., landscape, national, and global scales). Finally, SCM can serve as alternative tools for monitoring temporal changes in mangrove forests and potentially other habitat types to support conservation initiatives.

Institutional Review Board Statement: Not applicable.
Informed Consent Statement: Not applicable.

Data Availability Statement:
The data used in this study are available on request from the corresponding author.