OpenStreetMap

Detect tree species automatically with PlantNet

Posted by Pieter Vander Vennet on 14 September 2022 in English. Last updated on 15 September 2022.

PlantNet.org offers an API which tries to determine the plant species based on some pictures.

I integrated this API into MapComplete, together with some queries to Wikidata. As a result, linking a tree to the correct species identifier is easier then ever and can be done with a few clicks:

Discussion

Comment from SK53 on 15 September 2022 at 14:01

This is a good idea & I believe Pl@ntNet is associated with TelaBotanica a French botany project with a good deal of folk in common with OpenStreetMap France.

Always take these ML identifications with a pinch of salt, and ideally retain pictures somewhere so that someone else can verify them (unless MapComplete uploads to Pl@ntNet itself). This is particularly true of trees in parks, gardens & other plantings as some may be fairly exotic with few representatives in the ML database. A good example is that I came across a Wollemi Pine recently planted local to me. Despite the considerable interest in this tree (and the presence of another one in the city) there were only 5 examples on the iNaturalist database. Often these unusual trees are the ones which are most deserving of being mapped!

Derick has been using the API for a while, and it’s certainly given decent identifications for plants on his twitter stream.

There are plenty of other apps which do the same thing, and can be used in association with OSM. I personally use iNaturalist, mainly because it works across plants and animals. In Belgium & The Netherlands the app produced on behalf of Waarneming has a very large database, but only applies ML to those two countries. There’s also a plant identification app fairly specific to DACH countries which is good: Flora Incognita.

One other thing to watch is how much personal info these apps may leak. Collections of observations around one’s home may enable people to identify where you live with a high degree of certainty. Not all observation apps automatically obscure or degrade geolocation data of observations.

Comment from Pieter Vander Vennet on 15 September 2022 at 14:09

Hi,

Yup! I know that these ML-identifications might not be perfect - which is why the end-user is still responsible of picking an appropriate species. Furthermore, the source (plantnet-ai) is indicated in both the changeset-tags and the object itself, so that other mappers know that this was an AI-detection.

Pictures are uploaded to IMGUR and must be available, that is where PlantNet fetches them too.

I’m aware of Waarnemingen.be (I’m from Belgium), but this integration was due to a mail on the dev mailing list. As it turned out, it was quite easy to integrate, so here we are :p

And privacy leaks are indeed an issue. In this case, the IP-address and those images are sent to plantnet, so that is acceptable. MapComplete does not collect info (only basic statistics via goatcounter), but leaks a bit about the user location via the changesets. This privacy of the mapper is however a broader discussion we should have within the community.

Comment from Binnette on 24 September 2022 at 19:08

Hi Pieter, you are my hero! I love to add trees in OSM. Until now I was adding trees by using OsmGo on Android and my tree knowledge. I am mainly focused on adding fruit trees, nuts trees, edible flowers trees, etc.

Thanks a lot for your work on this. I wasn’t expecting PlantNet to have a public API and I was not expecting MapComplete to handle API call or other external ressources. I need to check MapComplete source code some time to find all it’s possibilities. 😇👍

Thanks again and have a nice day

Comment from westnordost on 26 September 2022 at 11:28

Awesome!

Comment from Pieter Vander Vennet on 26 September 2022 at 18:09

Thanks for the encouragement!

This all started by chance, by PlantNet posting something on the dev mailing list ;)

Comment from JLZIMMERMANN on 26 September 2022 at 20:50

Great job ! Plannet is done by french enterprises. It would be cool to use the code to do machine learning and recognize tagging for OSM :)

Comment from Lostmonkey on 1 December 2022 at 09:06

Anyone know of an app that displays tree species info? I use OsmAnd but sadly it does not.

Comment from SK53 on 1 December 2022 at 19:20

@LostMonkey: I did create some SVG files based on scans of different kinds of trees, and I think I also at some stage created icons from these.

Log in to leave a comment