Batch estimation of species' IUCN Red List threat status using neural networks.
- install IUCNN directly from Github using devtools.
install.packages("devtools")
library(devtools)
install_github("azizka/IUCNN")
- Python needs to be installed, for instance using miniconda and reticulated from within R (this will need c. 3 GB disk space). If problems occur at this step, check the excellent documentation of reticulate.
install.packages(reticulate)
library(reticulate)
install_miniconda()
If python has been installed before, you can specify the python version to sue with reticulate::use_python()
- Install the tensorflow module
reticulate::py_install("tensorflow==2.0.0", pip = TRUE)
A vignette with a detailed tutorial on how to use IUCNN is available as part of the package: vignette("Approximate_IUCN_Red_List_assessments_with_IUCNN")
. Running IUCNN will write files to your working directory.
library(tidyverse)
library(IUCNN)
#load example data
data("training_occ") #geographic occurrences of species with IUCN assessment
data("training_labels")# the corresponding IUCN assessments
data("prediction_occ") #occurrences from Not Evaluated species to prdict
# Training
## Generate features
geo <- geo_features(training_occ) #geographic
cli <- clim_features(training_occ) #climate
bme <- biome_features(training_occ) #biomes
features <- geo %>%
left_join(cli) %>%
left_join(bme)
# Prepare training labels
labels_train <- prepare_labels(training_labels)
# train the model
train_iucnn(x = features,
labels = labels_train)
#Prediction
## Generate features
geo <- geo_features(prediction_occ)
cli <- clim_features(prediction_occ)
bme <- biome_features(prediction_occ)
features_predict <- geo %>%
left_join(cli) %>%
left_join(bme)
predict_iucnn(x = features_predict,
model_dir = "iuc_nn_model")
library(IUCNN)
citation("IUCNN")
Zizka A, Silvestro D, Vitt P, Knight T (2020). “Automated conservation assessment of the orchid family with deep learning.” Conservation Biology, 0, 0-0. doi: doi.org/10.1111/cobi.13616 (URL: https://doi.org/doi.org/10.1111/cobi.13616), <URL: https://github.com/azizka/IUCNN>.