{"id":13724531,"url":"https://github.com/IUCNN/IUCNN","last_synced_at":"2025-05-07T18:32:42.981Z","repository":{"id":82509381,"uuid":"293626039","full_name":"IUCNN/IUCNN","owner":"IUCNN","description":" Train neural networks based on geographic species occurrences, environmental data and existing IUCN Red List assessments to predict the conservation status of \"Not Evaluated\" species, for any taxon or geographic region of interest. https://iucnn.github.io/IUCNN/","archived":false,"fork":false,"pushed_at":"2024-03-26T17:05:55.000Z","size":950791,"stargazers_count":25,"open_issues_count":9,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-29T22:30:18.376Z","etag":null,"topics":["conservation","conservation-prioritization","deep-learning","machine-learning","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IUCNN.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-09-07T20:28:46.000Z","updated_at":"2024-08-20T16:50:13.000Z","dependencies_parsed_at":"2023-09-21T19:32:12.753Z","dependency_job_id":"a7877149-6972-43ff-b184-ec4c0b9ac300","html_url":"https://github.com/IUCNN/IUCNN","commit_stats":{"total_commits":341,"total_committers":7,"mean_commits":"48.714285714285715","dds":0.5689149560117301,"last_synced_commit":"5fef93d00674ddbfc04dfb7cb033b587d890380d"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IUCNN%2FIUCNN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IUCNN%2FIUCNN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IUCNN%2FIUCNN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IUCNN%2FIUCNN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IUCNN","download_url":"https://codeload.github.com/IUCNN/IUCNN/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222281079,"owners_count":16960154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conservation","conservation-prioritization","deep-learning","machine-learning","tensorflow"],"created_at":"2024-08-03T01:01:58.824Z","updated_at":"2024-11-14T14:31:13.280Z","avatar_url":"https://github.com/IUCNN.png","language":"R","funding_links":[],"categories":["Biosphere"],"sub_categories":["Biodiversity Data Access and Management"],"readme":"\u003c!-- badges: start --\u003e\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![DOI](https://zenodo.org/badge/293626039.svg)](https://zenodo.org/badge/latestdoi/293626039)\n[![R-CMD-check](https://github.com/IUCNN/IUCNN/actions/workflows/check-standard.yaml/badge.svg)](https://github.com/IUCNN/IUCNN/actions/workflows/check-standard.yaml)\n\u003c!-- badges: end --\u003e\n\n**IUCNN has been updated to version 3.0 on github and will shortly be updated on CRAN to adapt to the retirement of sp and raster. The update may not be compatible with analysis-pipelines build with version 2.x**\n\n# IUCNN\nBatch estimation of species' IUCN Red List threat status using neural networks.\n\n# Installation\n1. Install IUCNN directly from Github using devtools (some users, will need to start from the step 2 before installing the package). \n```r\ninstall.packages(\"devtools\")\nlibrary(devtools)\n\ninstall_github(\"IUCNN/IUCNN\")\n```\n\n2. Since some of IUCNNs functions are run in Python, IUCNN needs to set up a Python environment. This is easily done from within R, using the `install_miniconda()` function of the package `reticulate` (this will need c. 3 GB disk space).\nIf problems occur at this step, check the excellent [documentation of reticulate](https://rstudio.github.io/reticulate/index.html).\n```r\ninstall.packages(\"reticulate\")\nlibrary(reticulate)\ninstall_miniconda()\n```\n\n3. Install the tensorflow python library. Note that you may need a fresh\nR session to run the following code.\n```r\ninstall_github(\"rstudio/tensorflow\")\nlibrary(tensorflow)\ninstall_tensorflow()\n```\n\n4. Install the npBNN python library from Github:\n\n```r\nreticulate::py_install(\"https://github.com/dsilvestro/npBNN/archive/refs/tags/v0.1.11.tar.gz\", pip = TRUE)\n```\n\n\n# Usage\nThere are multiple models and features available in IUCNN. A vignette with a detailed tutorial on how to use those is available as part of the package: `vignette(\"Approximate_IUCN_Red_List_assessments_with_IUCNN\")`. Running IUCNN will write files to your working directory.\n\nA simple example run for terrestrial orchids (This will take about 5 minutes and download ~500MB of data for feature preparation into the working directory):\n\n```r\nlibrary(tidyverse)\nlibrary(IUCNN)\n\n#load example data \ndata(\"training_occ\") #geographic occurrences of species with IUCN assessment\ndata(\"training_labels\")# the corresponding IUCN assessments\ndata(\"prediction_occ\") #occurrences from Not Evaluated species to prdict\n\n# 1. Feature and label preparation\nfeatures \u003c- iucnn_prepare_features(training_occ) # Training features\nlabels_train \u003c- iucnn_prepare_labels(x = training_labels,\n                                     y = features) # Training labels\nfeatures_predict \u003c- iucnn_prepare_features(prediction_occ) # Prediction features\n\n# 2. Model training\nm1 \u003c- iucnn_train_model(x = features, lab = labels_train)\n\nsummary(m1)\nplot(m1)\n\n# 3. Prediction\niucnn_predict_status(x = features_predict,\n                     model = m1)\n```\nAdditional features quantifying phylogenetic relationships and geographic sampling bias are available via `iucnn_phylogenetic_features` and `iucnn_bias_features`.\n\n\nWith model testing\n\n```r\nlibrary(tidyverse)\nlibrary(IUCNN)\n\n#load example data \ndata(\"training_occ\") #geographic occurrences of species with IUCN assessment\ndata(\"training_labels\")# the corresponding IUCN assessments\ndata(\"prediction_occ\") #occurrences from Not Evaluated species to predict\n\n# Feature and label preparation\nfeatures \u003c- iucnn_prepare_features(training_occ) # Training features\nlabels_train \u003c- iucnn_prepare_labels(x = training_labels,\n                                     y = features) # Training labels\nfeatures_predict \u003c- iucnn_prepare_features(prediction_occ) # Prediction features\n\n\n# Model testing\n# For illustration models differing in dropout rate and number of layers\n\nmod_test \u003c- iucnn_modeltest(x = features,\n                            lab = labels_train,\n                            mode = \"nn-class\",\n                            dropout_rate = c(0.0, 0.1, 0.3),\n                            n_layers = c(\"30\", \"40_20\", \"50_30_10\"),\n                            cv_fold = 5,\n                            init_logfile = TRUE)\n\n# Select best model\nm_best \u003c- iucnn_best_model(x = mod_test,\n                          criterion = \"val_acc\",\n                          require_dropout = TRUE)\n\n# Inspect model structure and performance\nsummary(m_best)\nplot(m_best)\n\n# Train the best model on all training data for prediction\nm_prod \u003c- iucnn_train_model(x = features,\n                            lab = labels_train,\n                            production_model = m_best)\n\n# Predict RL categories for target species\npred \u003c- iucnn_predict_status(x = features_predict,\n                             model = m_prod)\nplot(pred)\n\n```\n\nUsing a convolutional neural network\n\n```r\nfeatures \u003c- iucnn_cnn_features(training_occ) # Training features\nlabels_train \u003c- iucnn_prepare_labels(x = training_labels,\n                                     y = features) # Training labels\nfeatures_predict \u003c- iucnn_cnn_features(prediction_occ) # Prediction features\n\n```\n\n# Citation\n```r\nlibrary(IUCNN)\ncitation(\"IUCNN\")\n```\n\nZizka A, Andermann T, Silvestro D (2022). \"IUCNN - Deep learning approaches to approximate species’ extinction risk.\" [Diversity and Distributions, 28(2):227-241 doi: 10.1111/ddi.13450](https://doi.org/10.1111/ddi.13450). \n\nZizka A, Silvestro D, Vitt P, Knight T (2021). “Automated conservation assessment of the orchid family with deep\nlearning.” [Conservation Biology, 35(3):897-908, doi: doi.org/10.1111/cobi.13616](https://doi.org/10.1111/cobi.13616)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIUCNN%2FIUCNN","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIUCNN%2FIUCNN","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIUCNN%2FIUCNN/lists"}