Introduction

Protecting and restoring forests is essential to meeting the Paris Climate Agreement and the new Global Biodiversity Framework goals, conserving biodiversity, and addressing food security and livelihood needs (Chazdon et al. 2017a; UN SDG 2017; Lewis et al. 2019; CBD 2022). Many reforestation activities are being conducted worldwide, at both local and landscape scales. While local-based projects could help determine the best specific solution for the target area, landscape-scale projects require a broader perspective and planning for restoration activities (Mansourian and Vallauri 2014). The forest landscape restoration (FLR) is a holistic approach that considers the relationship between landscape structure (the spatial patterning of different land uses across space) and landscape functioning (ecological processes), and holds promises to achieve both ecological and social goals. It also provides long-term, multi-objective and large-scale means to implement international targets in field interventions (Turner 2005; Hall et al. 2011, 2015; Holl 2017; Stanturf and Mansourian 2020). Within the different forest recovery scenarios, natural recovery, or “passive restoration” sensu Holl and Aide (2011), can play a major role in large-scale landscape restoration in tropical regions (van Breugel et al. 2013a, b; Chazdon and Guariguata 2016; Chazdon and Uriarte 2016; Hall et al. 2022).

Significant progress in recovering ecosystem services found in mature tropical forests have been observed in as little as two decades of naturally recovering secondary forests. For example, Martin et al. (2013) found aboveground carbon pools can recover to xxxx in yyy time while Rozendaal et al. (2019) reported an 80% recovery of tree species diversity in 20 years across the Neotropics. Poorter et al. (2021) found significant recovery of functional traits within this same time period for a sub sample of these same sites. Working at Agua Salud in Panama on water related ecosystem services, Hassler et al. (2011) found a significant recovery in saturated hydraulic conductivity, a measure of soil water infiltration in 12 to 15 years of natural forest recovery in the top layer of the mineral soils. Birch et al. (2021) reported recovery of hydraulic flow paths at the catchment scale at Agua Salud up to 30 cm depth within a decade of forest recovery while Chavarria et al. (2021) report a significant shift in stream water bacterial communities and measures of water quality at the same site and time scale. This means that to achieve an effective restoration of forest landscape, forests not only need suitable conditions to grow, but also to persist in time (Sloan 2022), where persistence is defined as a time-dependent process where forests grow, mature and continue to be present in time, without being cut again. Persistence of naturally regenerating forests could translate into a “forest transition” event, which has been increasingly observed in the tropics since the 1990s (e.g., Rudel et al. 2002; Aide et al. 2013; Sloan 2022). Several studies have found that newly recovered forests are frequently re-cleared before they can recover to pre-disturbance conditions (Breugel et al. 2013a, b; Mbow et al. 2017; Meli et al. 2017; Brondizio et al. 2019; Reid et al. 2019). Detecting this dynamic and identifying the context where naturally recovered forest do not persist could provide support for a more effective forest landscape restoration planning (Smith et al. 2003; Fagan et al. 2013; Sloan 2016; Reid et al. 2017; Schwartz et al. 2017, 2020; Borda-Niño et al. 2020). To our knowledge, no studies have yet provided spatially explicit insights and/or landscape attributes related to the persistance of naturally recovering secondary forests in central Panama.

Central Panama is a dynamic and heterogeneous area with a diversity of ecosystems and habitats in a relatively small area, including tropical lowland and pre-montane moist forests, freshwater wetlands, and mangroves (Holdridge et al. 1967; Ibanez et al. 2002), where its provision and dependence on ecosystem services are well known. The region hosts one of the most important inland commercial waterways, the Panama Canal, which is important for international trade and a crucial economic driver for the country (Adamowicz et al. 2019). It contains two large artificial freshwater lakes—Gatun Lake and Alhajuela Lake—both created to ensure canal operations and freshwater supply for Panama City, the city of Colon, and numerous towns in between (Hall et al. 2015). The long-term maintenance and sustainability of central Panama biodiversity and water supply depends on the preservation of the tropical forest cover; the latter is accomplished in part through a system of 21 protected and/or restricted areas (see, e.g. Hall et al. 2022). Nevertheless, it has experienced rapid economic growth over the past decade, followed by intense land use/land-cover changes (Heckadon Moreno at al. 1999; Condit et al. 2001; Ibanez et al. 2002; Walker et al. 2020) which led to the construction of roadways and the expansion of pastures. This has stimulated the decrease of forest cover capable of regulating water supply and maintaining connectivity between the protected areas (Rompre et al. 2008).

As people have migrated to cities in central Panama to take advantage of economic opportunities found there, significant areas that had been cleared for agriculture have regenerated (Wright and Samaniego 2008; Sloan 2015) and also reduced the rate of deforestation by over 80% in recent decades (Walker 2020; Hall et al. 2022). It is therefore an area where the recovery and the conservation of forests is key to support ecosystem services supply and where it is crucial to assess wether and how the natural expansion of secondary forests is allowed to establish into forest transition. Yet, we do not know how much of the naturally recovered secondary forests persisted longer than 20 years, much less the relationship between landscape attributes and the probability to persist.

In this paper, we aim to identify the landscape context for naturally recovered forest to persist in time within central Panama. We studied the forest areas that naturally recovered in the two decades between 1990 and 2010 and persisted until 2020 using the random forest classification (RFC) method and relying on the tuning of important RFC parameters, to identify areas with higher likelihood of persistence success.

Materials and methods

Study area

Our study area is identical to that of Hall et al. (2022) and represents 23% of the country’s land area (Fig. 1). The study area includes the Panama Canal Watershed (PCW), an area of critical relevance for biodiversity conservation and economic development (Ibanez et al. 2002; Adamowicz et al. 2019). Previous projections of deforestation and carbon storage have found that the unrealistic scenario of halting deforestation and allowing all available forested land within the study region to be protected, to grow, and to persist, central Panama could sequester between 56.0% of its national goal. In contrast, were deforestation rates to revert to those before the year 2000, it would have devastating consequences releasing an additional 73 million Mg CO2e by 2050, making it extremely difficult for Panama to achieve its planned land-based carbon sequestration objective (Hall et al. 2022).

Fig. 1
figure 1

Study area (Panama Canal Watershed)

Data processing and quantification of persistence

A unique 30-year time-series data set (1990–2020) of central Panama vegetation cover compiled by Walker (2020) was used to identify areas where natural regeneration occurred spontaneously and persisted between 1990 and 2020 (Fig. 2a–c). Vegetation cover layers were based on epochal composite of dry-season Landsat 4, 5, 7, 8 images with less than 70% total cloud cover and at least 10% clear pixels images (30 m). All images were downloaded as Landsat Surface Reflectance Products through the EROS science processing architecture (ESPA) interface with standard pre-processing for L1T data to correct for positional and atmospheric conditions and hand-classified in five macro-categories and 23 sub-categories (Table 1). Sub-categories provide additional information regarding habitat, disturbance and land-use, allowing for a better understanding of land-cover change dynamics. Unlike previous land-cover maps of Panama, which applied dichotomous or categorical definitions of forests, these maps are based on an ordinal scale to define vegetation, distinguishing different age classes of secondary forests: low vegetation (1–2 yrs), medium vegetation (3–5 yrs), high vegetation (6–20 yrs) and forest (≥ 20 yrs), and therefore capturing small and ephemeral clearings. Such gradient reflects the natural process of regeneration and acknowledges the fuzzy boundaries between forest and non-forest classes. The Walker forest cover and forest-cover change maps were designed to achieve an adequate spatial and temporal resolution; before these maps became available Panama lacked a consistent dataset by which to assess baselines for land-cover changes.

Fig. 2
figure 2

Panama Canal Watershed Land-Cover Maps: a 1990; b 2010; c 2020

Table 1 Macro and Sub-categories of land-cover maps

The regeneration and persistence dynamics were observed working at macro-categories level (NOVEG, LOWVEG, MEDVEG, HIGHVEG and FOREST), while the pre-selection of eligible patches also considered sub-categories. We adopted a patch-based approach, where a patch is defined as a minimum 0.5 ha width, homogeneous area that differs from its surroundings (Forman and Godron 1981; Farina 2000). The patches classified as HIGHVEG in 1990 were excluded from the dataset to limit the fuzziness and highlight the transition from non-forest to forest. The patches classified as NOVEG, as LOWVEG sub-categories low crops rainfed (18) and low crops irrigated (28), and as MEDVEG sub-category high crops (48) were not considered in the analysis as our goal was to assess the forest-landscape natural regeneration potential in a multifunctional landscape, without altering the presence of urban/agricultural land-uses. Finally, we excluded the patches classified as FOREST sub-category evergreen plantations (68) to focus on natural regeneration only. We designated patches with 0 = natural recovery BUT NO persistence or 1 = natural recovery AND persistence histories as follows: Patches 0 were identified as ≥ 0.5 ha patches classified as LOWVEG or MEDVEG in 1990, as FOREST in 2010 and again as LOWVEG or MEDVEG in 2020 land-cover map; patches 1 were identified as ≥ 0.5 ha patches classified as LOWVEG or MEDVEG in 1990 land cover map and as FOREST in both subsequent 2010 and 2020 land cover maps, for at least 50% of their total area. Our sample was composed by 1,234 patches ranging from 0.5 to 35,978 ha, representing a total area of 150,381 ha.

Explanatory variables

While climatic and edaphic factors affect plant germination, growth, and survival, leading variations in the regeneration process across regions, landscape context determines where regeneration is permitted to occur and persist, playing a central role in driving successional pathways within human-modified landscapes, such as tropical ones (Jakovac et al. 2021). Nine remote-sensed, easily collectable explanatory variables linked to anthropic use and access of the area were measured for each of the 1234 patches included in the dataset (Table 2): mean patch elevation (meanElev); mean patch slope (meanSlope); minimum distance from the patch centroid to the nearest road (RoadsDista); minimum distance from the patch centroid to the nearest river (Hydro123D); minimum distance from the patch centroid to the nearest urban area (UrbanDista), defined by the National Institute of Statistics and Census of Panama as the populated places that concentrates 1500 or more inhabitants; minimum distance from the centroid to the nearest rural area (RuralDist), defined by the National Institute of Statistics and Census of Panama as the populated places that concentrates > 1500 inhabitants; minimum distance from the patch centroid to either Gatun or Alajuela lake (LLDistDi); minimum distance from the patch centroid to the nearest protected area (PADistanc); mean distance between the centroid and the patch’s edge (distpole). The selection of explanatory variables was based on a previous study on deforestation scenarios and future carbon dynamics conducted in the PCW (Hall et al. 2022). The variable distpole, which was not used in the previous study, was included to consider the patch nature of our samples and their variability in terms of extent..

Table 2 Independent/explanatory variables

Data analysis

Random forest classification

We evaluated the associations between secondary forest persistence success and landscape-context predictors using the Machine-Learning (ML) based method of random forest classification (RFC) (Breiman 2001). The advantage of ML over traditional statistical techniques is the ability to model highly dimensional and non-linear data—such as ecological data (Knudby et al. 2010; Thessen 2016)—with complex interactions. There are several types of tasks that ML techniques can perform. The task we were interested in was the classification, the process of predicting the class of given data point (Kotsiantis 2007). RFC is the most widespread classifier ML technique, especially when working with land use/land cover change (LULC) (Vitale et al. 2014; Lowe and Kulkarni 2015; Pelletier et al. 2016; Nguyen et al. 2018; Talukdar et al. 2020). RFC is a supervised algorithm based on decision trees and improved bagging and bootstrap techniques that utilizes several classifiers to work together to identify the class label for each observation (Yang et al. 2010). In addition, RFC provides variable importance measures, which can be used to identify most relevant features and/or their effect (Archer and Kimes 2008). However, like most classifiers RFC faces problems when learning from an extremely unbalanced training data set (Zakariah 2014). As it is constructed to minimize the overall error rate, it will tend to focus more on the prediction accuracy of the majority class, which often results in poor accuracy for the minority class. However, there are several techniques that can be used with RFC to solve class imbalance problems (Chen 2004; Kuhn and Johnson 2013; More and Rana 2017). We solved the class unbalance problems to the training set, and we validated the model on the unbalanced test set to assess the performance of the model with real frequencies. The study used the randomForest package running in Rstudio (CRAN) (Liaw and Wiener 2002).

Training dataset balancing

The dataset was composed of 0 = 182 and 1 = 1052 units. We divided the dataset into training and test sets following the rule of 70–30%, as it is demonstrated to represent the ratio with the best performance in ML models (Nguyen et al. 2021). The balance problem was solved for the training set through up-sampling technique (upSample function in the caret package running in Rstudio (CRAN)). Up-sampling is an oversampling technique that randomly selects and duplicates observations in the minority class to balance the dataset. We obtained a balanced training set with a total of 1474 samples. The optimal number of decision trees (n = 1000) and number of explanatory variables randomly sampled as candidates at each split (n = 3) were evaluated based on the lowest out of bag (OOB) error. The RFC is trained through bagging technique, where each new decision tree is fit from a subsample of the training units. The OOB error is the average classification error of the remaining training units not included in the subsample. That allows to fit and also validate the RFC while being trained (Breiman 1996).

Tuning

The tuning consists of the identification of a set of optimal RFC hyperparameters’ values to maximize the model’s performance and produce better outputs. Hyperparameters are parameters whose values control the learning process of the model and can be tuned to increase some specific metrics like accuracy or precision. In our case, the RFC model was validated on an unbalanced test set to assess the real frequencies of 0 and 1 found in the PCW, within the past 30 years. Since RFC is designed to minimize the overall error rate, with an unbalanced dataset it will tend to focus more on the prediction accuracy of the majority class, which often results in poor accuracy for the minority class. For this reason, accuracy was not a suitable measure for our model’s performance. We instead focused on the tuning of precision for 1, and recall for 0 (Table 3a, b). Here precision is defined as the ability of a classifier not to label “as TRUE” an instance that is actually “FALSE”. For each class, it is defined as the ratio of real trues (RT) to the sum of real trues and false trues (FT), Eq. (1):

$${\text{Precision}} = \frac{{{\text{RT}}}}{{{\text{RT}} + {\text{FT}}}}$$
(1)
Table 3 Confusion matrix parameters for class 1 and 0

Thus, the precision measures how good the model is at predicting a specific category. The recall (also known as sensitivity) is the ability of a classifier to find all the RT instances for the specified class. It is defined as the ratio of RT to the sum of RT and false false (FF), Eq. (2):

$${\text{Recall}} = \frac{{{\text{RT}}}}{{{\text{RT}} + {\text{FF}}}}$$
(2)

Recall is a measure of how many times the model was able to detect a specific category. To maximize the precision of 1, we needed to improve the Recall of 0. In other words, we needed to reduce as much as possible the misclassification errors (FT) of 0. A straightforward approach to improve the performance of a classifier that predicts probabilities with unbalanced dataset is to tune the threshold used to map probabilities to class labels. ML algorithms predicts the probability or scoring of class membership by using a threshold. All values equal to or greater than the selected threshold are mapped to one class and all the other values are mapped to another class. We therefore tested several thresholds until identifying 0.90 as the optimal one to improve the precision of 1 and recall of 0, as described above. Scores above 0.90 were classified as 1, those below as 0.

Tuning one of these quantities nevertheless entails a trade-off: as we increase the precision of a class, we decrease the recall for the same class, and viceversa. In our case, this trade-off leads to low sensitivity for class 1 (several 1 RT were lost), and consequently low precision for class 0 (a high percentage of the total patches that were predicted as 0, were actually 1).

Relative importance of independent variables and partial dependencies

To evaluate the specific behavior of each of the explanatory variables in the persistence dynamic we did not rely on the thresholds derived by the tree graph, rather on the relative importance of the independent variables and their partial dependencies. The underlying RFC algorithms are trained by randomly selected subsets of data, which makes thresholds potentially different for each of the “n” trees produced by the RFC, and therefore approximate for the purpose of our work. The relative importance of independent variables indicates their predictive power. It can be used to sort variable from most to least predictive, allowing to have more insights on the problem and to perform feature selection when there are too many input variables. The order of importance of the variables was measured through mean decrease in Gini (MDG). MDG is a measure of how important a variable is for estimating the class across all of the trees that make up the forest (Grömping 2009). A higher MDG indicates higher variable importance. The most important variables to the model will have the largest MDG. Conversely, the least important variable will have the smallest MDG values. In addition, partial dependencies plots contributed to clarifying which predictors have positive and negative effects on the persistence success. The RFC model allows graphical examination of partial dependencies of the model on each predictor. Partial dependencies plots show how the variables marginally affect the prediction based on the RFC model. Assuming all other variables fixed at the center, the values of a given predictor that increases along the y-axes indicate a positive effect on the prediction, while the values that decreases along the y-axes indicate a negative effect on the prediction.

Results

Secondary forest persistence analysis

From a total of ~ 62,203,260 ha of LOWVEG and MEDVEG occurring in 1990 in the study area, ~ 150,380 ha (0, 24%) were classified as FOREST (natural regeneration) in 2010. Within this forest subset, approximately ~ 36,400 ha (24%) were cleared again by 2020, while ~ 113.900 ha (76%) persisted.

Random forest classification performance analysis

As shown in Table 4, in the training phase the RFC model discriminated between the two classes (0–1) with an OOB error rate of about 2% and a class specific error of 0.001 (0.1%) for the 0, and 0.046 (4.6%) for the 1. By tuning, Precision of 1 and Recall of 0 reached, respectively, 0.94 (94%) and 0.83 (83%) in the validation test (Table 5).

Table 4 Random forest classification training performance
Table 5 Random forest classification test performance

Relative importance of independent variables and partial dependencies plots

Variables are sorted and displayed in the Variable Importance plot (Fig. 3). The variables with more predictive power were meanElev and RuralDist, followed by LLDistDi, UrbanDist, meanSlope, PADistanc, RoadsDista, distpole and Hydro123D. Figure 4a–i shows the variables-specific partial dependencies plots, which represent how each variable marginally affected the persistence of secondary forests. The variables meanElev, meanSlope, RoadsDista, UrbanDist and RuralDist appeared to be directly proportional to the probability of 1, while distpole, PADistanc and LLDistDi were inversely proportional to the probability of 1.

Fig. 3
figure 3

Variables order of importance based on mean decrease of Gini index

Fig. 4
figure 4

Partial dependence plots for the marginal effects of the predictors on the random forest classification model: estimated probability of no persistence/persistence (0–1) versus the observed values of each predictor in the combined data: a elevation (meanElev); b slope (meanSlope); c area and shape (distpole); d nearest river (Hydro123D); e nearest road (RoadsDista); f nearest urban area (UrbanDista); g nearest rural area (RuralDist); h nearest protected area (PADistanc); i nearest lake (Panama Canal/Alajuela lake (LLDistDi)

Prediction map of secondary forests persistence

Based on the RFC model, we developed a prediction map of central Panama areas that have high (≥ 90%) and low (< 90%) probability of secondary forests persistence success within the next 20 years (Fig. 5). From a total of 286,593 ha of LOWVEG and MEDVEG present in 2020 within our study area, only 16% (~ 48,179 ha) have a probability ≥ 0.90% to recover and persist until, at least, 2050.

Fig. 5
figure 5

Map of secondary forest persistence potential within 2020–2050

Discussion

Natural regeneration following land abandonment has been globally recorded starting from 1950 and is seen as an important opportunity for carbon sequestration and habitat restoration (Holl and Aide 2011; Chazdon et al. 2017b; Hall et al. 2022). Yet, those benefits largely depend on the persistence of the forests, which has been found to be largely transient across the globe, with an average residence time of ~ 14.22 years (Crawford et al. 2022). Walker (2020) found significant secondary forest regeneration in central Panama. Our analysis, however, reveals that the secondary forest expansion recorded in the past 30 years did not necessarily persist. Indeed, 24% of the naturally regenerating secondary forest found in 2010 was lost by 2020. As pointed out by several authors, the potential ephemeral nature of secondary forests could result in a limited role for these forests in mitigating climate change and ecosystem service recovery. Piffer et al. (2022) found that the re-clearance of native secondary forests in the Atlantic Forests of Brazil greatly limited carbon sequestration, where second-growth forests could have sequestered over three times more carbon than the actual estimated carbon sequestration. Van Breugel et al. (2013a, b) noted that the proportion of species that could sustain reproductive populations (effective diversity) in a dynamic patchwork of young secondary forests found in central Panama depended on how old the secondary forests became and how many tree species were able to reach reproductive size within that time frame. By investigating the role of secondary forests in providing habitat for many vertebrates within tropical region, Acevedo‐Charry et al. (2019) recorded slow recovery of species composition (at least 40 years) and strongly argued for the role of secondary forest persistence for the conservation of forest specialist’s species as well as for source populations to recover in secondary forest sites. Identifying conditions that encourage the persistence of naturally regenerated forests is therefore crucial in assessing the real potential for ecosystem restoration within dynamic landscapes as those found in the tropics, as well as for informing evaluation of the specific supporting actions needed to reach the UN goals and to ensure a sustained ecosystem services provision. With a precision of 94%, we predicted areas with high (≥ 90%) and low (> 90%) probability of natural forest regeneration and persistence success within the next 30 years in central Panama (Fig. 5). These results demonstrate that a set of remotely sensed, easily collected landscape context variables could be used to predict persistence success of secondary forests. The two variables with more predictive power were found to be the elevation and the distance to rural areas. Naturally regenerated forests lasted longer in patches that were at higher elevation, further from rural communities, roads and urban areas, and on steeper slopes. This findings underlie the contribution of remoteness in achieving forest transition, mirroring what found in other areas within the tropics (Aide et al. 2013, 2019; Molin et al. 2017; Calaboni et al. 2018; Reid et al. 2019). Ashton et al (2001) provided a framework for tropical forest restoration in Sri Lanka that is adaptable throughout the tropics (see, e.g., Griscom and Ashton 2011 for an example involving dry forest in Panama). They point out that the ability for forests to recover depends upon the level of degradation and the disturbance regime in terms of both chronicity and acuteness. More recently, Chazdon et al. (2021) commented on ecosystems recovery following damage or destruction. People can participate in enabling natural mechanisms of recovery of a targeted ecosystem by interventions that both facilitate the inherent capacity for natural recovery and inhibit drivers of ecosystem degradation. Our approach contributes to restoration planning by identifying areas where forests have higher and/or lower potential to persist in time, setting the scene for the identification of the stakeholders involved and the potential drivers of ecosystem degradation, allowing informed prioritization and planning of appropriate actions for the support of forest natural regeneration and its persistence in time. In addition, our approach allows for a more detailed future exploration of the social and economic drivers underlying the ephemerality of secondary forests within central Panama and represents a basis for future investigations and management decisions for successful, long-term forest-landscape restoration.