A reproducible workflow for modelling insect diversity and computing biodiversity intactness across Africa
This repository contains all scripts, workflows, and resources used for the study:
“An insect- and EO-based indicator reveals microhabitat-driven biodiversity intactness across Africa.”
The repository provides a complete implementation of the insect-based Biodiversity Intactness (IBI) indicator, including:
- Preprocessing of insect occurrence data
- Derivation of environmental predictor layers
- Random Forest species distribution modelling
- Per-pixel biodiversity intactness computation
- Uncertainty quantification
- Visualizations and statistical comparisons
- R ≥ 4.2
- Python ≥ 3.9
- QGIS ≥ 3.22
- Google Earth Engine account
terra,raster,sf,dismospThinggplot2,dplyr
scikit-learnrasterio,geopandasnumpy,pandas
This repository implements the full workflow for creating the Insect-Based Biodiversity Intactness (IBI) indicator.
Modelled using a Random Forest classifier trained on:
- Coleoptera, Lepidoptera, Odonata occurrences
- Sentinel-2 spectral metrics
- GEDI canopy height
- SRTM elevation
- Pseudo-absence/background points
Spatial block cross-validation ensures no spatial leakage.
Baseline values for pre-human potential diversity, assigned per habitat class.
Two scenarios included:
- High P
- Low P
Used for sensitivity analysis.
Derived from the Global Human Modification (GHM) dataset, normalized 0–1.
[ \text{IBI} = \frac{D}{P} \times (1 - hF) ]
Outputs range from 0 (degraded) to 1 (intact).
Combined from:
- Distance-to-occurrence
- Predicted suitability
- Spatial block CV performance
Used to identify data-poor or model-uncertain regions.
Rscript 1_data_preprocessing/occurrence_cleaning.R
Rscript 1_data_preprocessing/spatial_thinning.R
Rscript 1_data_preprocessing/pseudo_absence_generation.R