Data from: Using artificial intelligence to optimize ecological restoration for climate and biodiversity
Data files
Oct 21, 2026 version files 1.01 GB
-
CAPTAIN_restoration_data.zip
1.01 GB
-
README.md
35.82 KB
Oct 22, 2026 version files 1.01 GB
-
CAPTAIN_restoration_data.zip
1.01 GB
-
README.md
35.82 KB
Abstract
The restoration of degraded ecosystems is critical for mitigating climate change and reversing biodiversity loss. Depending on the primary objective – such as maximizing carbon sequestration or protecting threatened species – and within the boundaries of budget limitations, different spatial priorities have been identified at global and regional scales. Funding mechanisms to support such work comprise public sources, philanthropy, and the private sector, including the sale of carbon and biodiversity credits. However, effectively exploring trade-offs among restoration objectives and estimating the price of biodiversity and carbon credits to design financially viable projects remain scientifically challenging. Here we harness the power of artificial intelligence implemented in the software CAPTAIN to identify spatial priorities for ecological restoration that maximize multiple objectives at once and to allow a robust evaluation of biodiversity and climate outcomes. We find through a series of simulations that even low-to-moderate consideration of biodiversity in the design of restoration projects leads to the selection of restored areas that disproportionately improve the conservation of threatened species, while the carbon captured is only slightly reduced. We propose the bundling of biodiversity and carbon credits to support restoration efforts even in areas previously excluded for economic reasons. Applying our methodology to plant diversity in the Atlantic Forest of eastern South America, one of the most biodiverse and threatened ecosystems globally, we demonstrate its potential to guide restoration and to quantify trade-offs between multiple optimization scenarios. Our study provides a robust, scalable method to maximize the joint benefits of ecological restoration for climate and nature.
Dataset DOI: 10.5061/dryad.r7sqv9svg
Silvestro D., Goria S., Rau E.-P., de Lima R. A. F., Groom B., Jacobsson P., Sterner T., Antonelli A. Using artificial intelligence to optimize ecological restoration for climate and biodiversity. Global Change Biology (accepted). Preprint: https://doi.org/10.1101/2025.01.31.635975
Description of the data and file structure
This dataset contains the code, input data, trained models, and result files needed to reproduce the analyses in the paper. We used the reinforcement learning software CAPTAIN (Conservation Area Prioritization Through Artificial INtelligence) to select areas for ecological restoration that balance three objectives: carbon sequestration, reduction of species extinction risk, and restoration cost.
Two archives: data on Dryad, code on Zenodo
The files are split into two zip archives that unzip into the same captain_codes_data/ folder:
CAPTAIN_restoration_data.zip(this Dryad dataset, CC0): this README, the simulated-environment inputs, trained and fine-tuned models, species data, species distribution models, environmental layers and all result files.CAPTAIN_restoration_code.zip(published on Zenodo through Dryad, GNU AGPL-3.0): the CAPTAIN library,setup.py, all scripts and config files, the run instructions (simulations/README.md,atlantic_forest/README.md),README_CODE.mdandLICENSE.
The scripts expect code and data side by side, so download both and unzip them in the same place:
unzip CAPTAIN_restoration_code.zip
unzip CAPTAIN_restoration_data.zip
The tables below describe the combined folder. Files marked as code are in the code archive.
The combined folder has three parts:
| Folder | Content | Paper section |
|---|---|---|
captain/ |
The CAPTAIN Python library (version 0.2.9) used for all analyses (code). | Methods |
setup.py, LICENSE, README_CODE.md |
Installation script, AGPL-3.0 licence and code README (code). | – |
simulations/ |
Scripts, simulated-environment inputs, trained models and summary results for the experiments on simulated data. | Results; Methods: Simulations, Carbon and biodiversity credits; Supplementary Methods and Results |
atlantic_forest/ |
Species data, species distribution models, environmental layers, scripts, fine-tuned models and restoration priority maps for the Brazilian Atlantic Forest. | Results; Methods: Empirical analysis; Supplementary Methods and Results |
simulations/ and atlantic_forest/ each contain their own README.md (code archive) with step-by-step commands to rerun the analyses. All .py scripts and the Atlantic Forest config files (atlantic_forest/scripts/*.txt) are in the code archive.
Restoration policies
All models are trained with a reward that weights three objectives: carbon (c), species extinction risk (s) and restoration cost (b). Model and result file names encode these weights, e.g. c0.25_s0.25_b0.5. The five policies in the paper are:
| Policy | Carbon (c) |
Extinction risk (s) |
Cost (b) |
Used in |
|---|---|---|---|---|
| 1 | 0.50 | 0.00 | 0.50 | simulations, Atlantic Forest |
| 2 | 0.40 | 0.10 | 0.50 | simulations |
| 3 | 0.25 | 0.25 | 0.50 | simulations, Atlantic Forest |
| 4 | 0.10 | 0.40 | 0.50 | simulations |
| 5 | 0.00 | 0.50 | 0.50 | simulations, Atlantic Forest |
File formats
.py: Python 3 scripts..txt(config files): plain-text settings read by the Atlantic Forest scripts (INI format)..txt(summary tables),.log: tab-separated text tables with a header row..csv: comma-separated text table with a header row..tif: GeoTIFF rasters (single band, float32 unless stated otherwise)..npy,.npz: NumPy arrays (open withnumpy.load)..pdf,.png: figures..zip: compressed archive.
Missing values are coded as NA in CSV files and as NaN or the raster's no-data value in arrays and rasters.
Files and variables
captain/
The CAPTAIN library source code. Main modules:
biodivsim/: the simulated environment (grid, species populations, disturbance, climate, extinction risk).biodivinit/: initialisation of simulated species and environments.agents/: the neural network policy and the features it observes.algorithms/: training (evolution-strategies policy gradient) and prediction routines.utilities/: helper functions, including biodiversity metrics (metrics.py) and species distribution model handling (sdm_utils.py,sim_sdm.py).plot/: plotting functions.captain2rs/captain2rs.so: an optional compiled extension (macOS, Apple silicon) that speeds up some computations. CAPTAIN runs without it on other platforms.
simulations/
Scripts
| File | Purpose |
|---|---|
train_models.py |
Trains a restoration policy on the simulated reference region. |
run_simulations.py |
Runs trained policies on 100 simulations of the reference region (new species and disturbance in each). |
run_rnd_simulations.py |
Runs trained policies on 100 randomly placed regions with different extent and resolution. |
run_greedy_search.py |
Runs the three rule-based (non-parametric, greedy) selection models on the 100 reference-region simulations. |
plot_one_sim.py |
Plots maps and time series for a single simulation. |
parse_captain_output.py |
Summarises the result tables across simulations, makes summary plots and computes the financial outcomes under different biodiversity credit valuations. |
data/data_prep/captain_extracting_squares.py, data/data_prep/geoprocessing_functions.py |
Extract and process the climate and elevation rasters for the random regions. |
data/data_prep/rebuild_elevation_layers.py |
Recreates the elevation layers (not included here) from the HydroSHEDS DEM. |
Input data: simulations/data/
env_data/condit_tifs/: present-day climate and elevation for the reference region (128 × 128 cells, 25 km resolution at the equator, in Central and South America): annual mean temperature (CHELSA_bio1_1981-2010_V.2.1.tif), annual precipitation (CHELSA_bio12_...), and minimum temperature of the coldest month (CHELSA_bio6_...). All layers indata/are cropped and resampled to the region's grid (EPSG:4326) and rescaled to 0–1.env_data_f/condit_tifs/: the same layers for the future (2071–2100, GFDL-ESM4, SSP3-7.0).drawn_squares/square_000tosquare_100/: climate rasters (CHELSA_bio1,bio6,bio12) for the reference region (square_000) and the 100 random regions (128 × 128 cells each).- Elevation layers are not included because they are third-party data under their own licence. The simulation scripts need them, so recreate them first with
data/data_prep/rebuild_elevation_layers.py(seesimulations/README.md). This writeshyd_glo_dem_30s.tifinto each random region's folder andelevation_0.0083deg_wgs84.tifintoenv_data/condit_tifs/,env_data_f/condit_tifs/anddrawn_squares/square_000/. The random-region layers are rebuilt exactly as in the original workflow. The reference-region layer is a close approximation, because it was made with an earlier workflow. drawn_squares/disp_probs_sp500_c126_th3.npz: precomputed dispersal probabilities between cells, stored as a sparse COO array (data,coords,shape,fill_value; load with thesparsePython package).square_track.csv: location and resolution of each random region.
square_track.csv variables:
| Variable | Description |
|---|---|
uid |
Region identifier, matching the folder names in drawn_squares/ |
x |
Longitude of the region's reference corner (decimal degrees, WGS84) |
y |
Latitude of the region's reference corner (decimal degrees, WGS84) |
resolution_at_equator |
Cell size at the equator (m): 2,500, 10,000 or 25,000 |
Trained models
trained_models/: the five policies (sims_pareto_mlt_c*_s*_b*.log) with two hidden layers of 3 and 2 nodes, used for all main results and as starting points for the Atlantic Forest fine-tuning.trained_models_nn16_8/: the same five policies trained with a larger network (two hidden layers of 16 and 8 nodes; Supplementary Methods and Results, Testing a larger neural network).
Each .log file is a tab-separated table with one row per training epoch. The columns record the reward, environment state, and the network parameters at that epoch:
| Variable | Description |
|---|---|
epoch |
Training epoch |
reward |
Reward obtained in the epoch |
protected_cells |
Number of cells selected for restoration |
budget_left |
Remaining budget |
time_last_protect |
Time step of the last restoration action |
running_reward |
Moving average of the reward |
avg_cost |
Average cost of the restored cells |
extant_sp, extant_sp_value, extant_sp_pd |
Number, summed value and phylogenetic diversity of surviving species |
tot_carbon |
Total carbon in the system |
CR/EX, EN, VU, NT, LC |
Number of species in each IUCN Red List category (CR and extinct are combined) |
CR/EX_pr ... LC_pr |
Same counts, restricted to species occurring in restored cells |
non_protected_species |
Number of species not occurring in any restored cell |
R_carbon, R_species_risk, R_cost |
Reward components (only in the Atlantic Forest fine-tuned models) |
coeff_0 ... coeff_n |
Neural network parameters. CAPTAIN reads these to rebuild the trained model. |
Results: simulations/simulation_results/
| File | Content |
|---|---|
fixed_region_summary_stats.txt |
100 reference-region simulations × 5 policies |
fixed_region_summary_stats_nn16_8.txt |
Same, using the larger networks |
fixed_region_greedy_search_summary_stats.txt |
100 reference-region simulations × 3 non-parametric models |
rnd_regions_summary_stats.txt |
101 random regions × 5 policies |
Each row is one simulation run under one model. Variables:
| Variable | Description |
|---|---|
square_id |
Random region identifier (only in rnd_regions_summary_stats.txt) |
rep |
Simulation replicate |
model |
Trained policy (file name) or non-parametric model. The non-parametric models are: potential_carbon_cost (NPM 1: carbon and cost), CR_EN_VU_NT_LC_not_protected_potential_carbon_cost (NPM 2: carbon, extinction risk and cost) and CR_EN_VU_NT_LC_not_protected_cost (NPM 3: extinction risk and cost) |
tot_costs |
Total restoration cost of the selected cells (relative units) |
tot_relative_net_carbon_gain |
Net carbon gain summed over restored cells, each cell's gain divided by the maximum theoretical gain |
carbon_credit_scaler_0.2 |
Factor converting tot_relative_net_carbon_gain into carbon credit revenue that yields a 20% net profit over tot_costs |
CR, EN, VU, NT, LC |
Number of species in each Red List category at the end of the simulation |
CR_init ... LC_init |
Number of species in each category at the start |
n_extinct_sp |
Number of species with no remaining range |
n_restored_sp |
Number of species occurring in restored cells |
MSA, MSA_init |
Mean species abundance relative to the natural state, at the end and at the start |
PDF, PDF_init |
Potentially disappeared fraction of species, at the end and at the start |
STAR-t, STAR-s, STAR-t_init, STAR-s_init |
Species Threat Abatement and Restoration metric components (threat abatement and restoration), at the end and at the start |
n_sp_worse |
Number of species that moved to a higher extinction risk category |
n_sp_better |
Number of species that moved to a lower extinction risk category |
n_sp_no_longer_threatened |
Net decrease in the number of threatened species (CR, EN, VU) |
atlantic_forest/
The grid covers the Atlantic Forest (WWF Global 200 definition) at 10 km resolution: 363 rows × 250 columns in Web Mercator projection (EPSG:3857). Cells inside the region are marked in af_mask.tif.
Species data
- Occurrence records: The species occurrence records used to fit the SDMs are not included here, because they are third-party data. They are available from de Lima et al. (2024), Science, https://doi.org/10.1126/science.abq5099, with data and code at https://doi.org/10.5281/zenodo.8253431.
species_info.csv: one row per species (4,948 species). Variables:
| Variable | Description |
|---|---|
sp_name |
Species name |
index |
Species index (1–4,948), matching the number in the SDM file names |
original |
Number of occurrence records within the Atlantic Forest bounding box |
thinned |
Number of records after spatial thinning (NA if thinning was not applied) |
thin_perc |
Percentage of records kept after thinning |
data_used |
Records used to fit the SDM: original or thinned |
n_used |
Number of records used |
flag |
Data availability class: abundant (≥ 30 records), sparse (15–29) or insufficient (< 15) |
RedList_international_Category_2023 |
IUCN Red List category (2023): CR, EN, VU, NT, LC, DD, EX, or no_data (not assessed). Missing categories were imputed in the analyses. |
GrowthForm |
Growth form, used to set relative growth rates and sensitivity to disturbance |
MaximumHeight_m |
Maximum height (m) |
WoodSpecificGravity |
Wood density (g cm⁻³) |
maxH_use_mean |
TRUE if maximum height was filled with a mean value |
WSG_use_mean |
TRUE if wood density was filled with a mean value |
MaximumDiameter_cm |
Maximum diameter at breast height (cm), estimated from maximum height |
AGB_kg |
Maximum above-ground biomass per tree (kg), Chave et al. (2005) model; used as a proxy for carbon |
AGB_approx |
Same, using the simplified approximation of the same model |
Species distribution models: atlantic_forest/sdms/sdms.zip
3,885 GeoTIFF rasters (pred_gam_NNNN.tif), one per species with an SDM that passed the performance filters. NNNN is the species index in species_info.csv. Values are habitat suitability scores from 0 to 1. Unzip into atlantic_forest/ before running the scripts (this recreates atlantic_forest/sdms/).
Environmental layers: atlantic_forest/env_data/
All layers are single-band float32 GeoTIFF rasters (363 × 250 cells, 10 km, EPSG:3857). Cells outside the region are NaN.
| File | Description |
|---|---|
af_mask.tif |
1 for cells inside the Atlantic Forest region, 0 outside |
disturbance_score.tif |
Disturbance (0–1), the land-cover-weighted mean of class disturbance scores (MapBiomas Collection 10 and secondary vegetation age, Collection 9) |
cost_reclassified.tif |
Relative restoration cost (0–1): mean of rescaled travel time to cities, elevation and agricultural production value. The elevation layer used to compute it is not included; it came from geodata::elevation_global in R (SRTM and GTOPO30). |
land_suitability_score.tif |
Land suitability score (not used in the final analyses) |
Scripts and settings: atlantic_forest/scripts/
| File | Purpose |
|---|---|
af_train.py |
Fine-tunes a policy trained on simulated data on the Atlantic Forest data |
af_predict.py |
Uses a fine-tuned policy to select restoration priorities (30 runs) |
af_predict_sensitivity_tests.py |
As af_predict.py, with simulated error in carbon or cost |
af_config_finetune_c_b.txt, af_config_finetune_c_s_b.txt, af_config_finetune_s_b.txt |
Fine-tuning settings for Policies 1, 3 and 5 |
af_config_pred_c_b.txt, af_config_pred_c_s_b.txt, af_config_pred_s_b.txt |
Prediction settings for Policies 1, 3 and 5 |
Fine-tuned models: atlantic_forest/fine_tuned_models/
af_<seed>_c*_s*_b*.log: the fine-tuned Policies 1, 3 and 5. Same format as the trained models above.
Results: atlantic_forest/result_files/
policy_1/,policy_3/,policy_5/: restoration priorities for each policy.sensitivity_tests/policy_<N>_carbon_error/andsensitivity_tests/policy_<N>_<carbon/cost>_error/: the same, with simulated error in carbon (log-normal error on species above-ground biomass) or cost (spatially structured ±25% error).
Each folder contains:
| File | Content |
|---|---|
af20251011_protection_priorities_geo.tif |
Restoration priority map (3-band GeoTIFF, EPSG:3857). Band 1 is the fraction of the 30 runs in which the cell was selected, scaled to 0–255 (255 = selected in every run). The other two bands have no information. The final priorities shown in the paper are the 4,800 most frequently selected cells. |
af20251011_protection_priorities.png |
Image of the priority map |
af20251011_protection_matrix.npy |
Array (30 runs × 363 × 250): 1 if the cell was selected for restoration in that run, 0 if not |
af20251011_history.npy |
Array (30 runs × 33 time steps × 15 variables) with the state of the system over time. The 15 variables, in order: number of extant species, species value, phylogenetic diversity, total carbon, total population, fraction of species in CR, EN, VU, NT, LC, MSA, cost spent, number of species in restored cells, net carbon change, carbon in restored cells |
summary_stats*.txt |
One row per run (tab-separated); variables below |
results*.pdf |
Summary plots |
Variables in summary_stats*.txt (where not already defined for the simulation results):
| Variable | Description |
|---|---|
carbon, carbon_init |
Natural log of total carbon summed over all cells, after restoration and at the start |
max_carbon |
Natural log of total carbon in the reference state used for comparison |
Code/software
The code is published on Zenodo under the GNU Affero General Public License v3.0 (AGPL-3.0), linked from this dataset (CAPTAIN_restoration_code.zip; see Two archives above). The analyses use CAPTAIN 0.2.9 (included in the code archive), which needs Python 3.10–3.12. Install CAPTAIN and its dependencies from the captain_codes_data folder with python -m pip install (see simulations/README.md). setup.py lists the dependencies. The sensitivity tests also need pyperlin, and the region extraction scripts need cartopy and gdgtm (https://github.com/pete-jacobsson/gdgtm).
The species distribution models, disturbance and cost layers were produced in R 4.3.3 (packages listed in the paper's Methods). Those R scripts are not part of this dataset; the resulting layers are provided.
Access information
Other publicly accessible locations of the data:
- None. The archive shared during peer review (ETH polybox link in the paper) is superseded by this dataset.
Data were derived from the following sources:
- Species occurrences, traits, and Red List assessments: de Lima R. A. F. et al. (2024) Comprehensive conservation assessments reveal high extinction risks across Atlantic Forest trees. Science. https://doi.org/10.1126/science.abq5099. Data and code: de Lima R. A. F. & Dauby G. (2023), Zenodo, https://doi.org/10.5281/zenodo.8253431. The occurrence records are not redistributed here; download them from this source.
- Climate (simulations): CHELSA V2.1, released under CC0 1.0 (https://chelsa-climate.org). Karger D. N. et al. (2017) Climatologies at high resolution for the earth's land surface areas. Scientific Data 4, 170122, https://doi.org/10.1038/sdata.2017.122. Data: Karger D. N. et al. (2021), EnviDat, https://doi.org/10.16904/envidat.228. The processed (cropped, resampled and rescaled) layers are included in
simulations/data/. - Climate (Atlantic Forest SDMs): WorldClim 2.1 (Fick & Hijmans 2017, International Journal of Climatology, https://www.worldclim.org). Not redistributed here.
- Elevation (simulations): HydroSHEDS v1 30 arc-second void-filled DEM and land mask (
hyd_glo_dem_30s,hyd_glo_msk_30s), https://www.hydrosheds.org/hydrosheds-core-downloads. Lehner B., Verdin K. & Jarvis A. (2008) New global hydrography derived from spaceborne elevation data. Eos 89(10), 93–94. Not redistributed here; seesimulations/data/data_prep/rebuild_elevation_layers.py. - Elevation (Atlantic Forest cost layer):
geodata::elevation_globalin R, based on SRTM (Farr et al. 2007, Reviews of Geophysics) and GTOPO30 (U.S. Geological Survey). Not redistributed here. - Land cover: MapBiomas Brazil, Collection 10 (land cover and use) and Collection 9 (secondary vegetation age), https://brasil.mapbiomas.org.
- Travel time to cities: Nelson et al. (2019), Scientific Data.
- Agricultural production value: SPAM (MapSPAM), via the
geodataR package. - Atlantic Forest boundary: WWF Global 200 (Olson & Dinerstein 2002).
Changes after Oct 21, 2026: added scripts for the SDMs.
