Published May 13, 2024 | Version 0.1.0
Software Open

iNaturalist-Pl@ntNet workflow

Creators

Description

Brief step-by-step and troubleshooting

Nadja Pernat, 2024-06-06


Introduction

This very brief step-by-step manual explains how to use the automatic data exchange workflow between iNaturalist and PlantNet. When using this workflow with Isodontia mexicana, results may vary slightly due to changes on iNaturalist. Observations made within the investigated time period might have been added, removed, had their license changed, or lost their research-grade status. Note that Pl@ntNet may also perform differently over time as its algorithm is continuously trained with new images, potentially resulting in different species suggestions or scores. To reproduce our results, we also provided our data as excel sheets.


Step 1: Running the adapted `get_inat_obs()`

The original `get_inat_obs()` command retrieves observations for only one year. We adapted the function slightly so that it can loop over multiple years without stopping. Please run this code first ("get_inat_obs_nostop").


Step 2: iNaturalist-PlantNet data exchange workflow  

Run the `get_inat_obs_nostop()` function with Isodontia mexicana or any other `taxon_name` from the data preparation script. The looping over years creates a list that needs to be converted into a dataframe. You can also select the variables you want to keep.
To facilitate testing and reproducing results without retrieving observations from iNaturalist again, we have provided our data table after downloading the image URLs ("isomex_experts.xlsx" - we called it experts, because it was also used by the experts to identify the plant species on the given images). 

To access the Pl@ntNet API via the `plantnet` package, you need an API key, which you can obtain at Pl@ntNet (https://my.plantnet.org/). Without a key, it is not possible to run the code. We also adapted the `identify()` command to loop over all image URLs. The result is a list of lists that needs to be converted into a dataframe. At this step, it is advisable to write the dataframe as a backup.

You also may experience trouble in installing the `plantnet` package via devtools. We solved the problems via re-installing the packages `devtools` and `R.Utils`. Please note, that there are limitations for the daily rate of identification via the Pl@ntNet API (500), but there are exceptions for non-profits. Not-for-profits can enter a pricing plan. 
 
Step 3: Preparing the data

Actually, you are now done to let Pl@ntNet identify the plants on any citizens science image. If you want to work with our data, use the iso_new.xls table. However, you might have generated a huge dataset including all plant species candidate suggestions. There can be over 30 suggestions for one image. In our study, at this point we then filtered the dataframe for only the FIRST (best) plant species candidate suggestion, retaining only the plant suggestion with the highest score for each iNaturalist image. 

As a last step you would need to create genus and family names in case you plan to work on these taxonomic levels. PlantNet only provides species names, so we needed to extract the genus name using the `stringr` package's `word()` function and the family names using the `plantminer()` function from the `taxize` package. If `plantminer()` does not smoothly identify the families, check the Latin names of the species provided by Pl@ntNet. Sometimes, the name of hybrids or import errors in the CSV table create unusual letter combinations. These errors are typically exceptions and not very frequent; we recommend manually substituting these letters using `gsub()` or `stringr::str_replace()`.

 
Step 4: Do your own research or reproduce our results 

This completes the iNaturalist-Pl@ntNet workflow. Further code describes how we merged the data with the expert dataset, cleaned it, analyzed the matches, and produced the plots and tables. The code is commented, but if you encounter any issues, please do not hesitate to contact the corresponding author.

 

Files

npernat/iNat_plantNet_workflow-0.1.0.zip

Files (3.2 MB)

Name Size Download all
md5:0f57b85bac00bc6cb130b3ac511ea68d
3.2 MB Preview Download

Additional details

Related works