inaturalist / iNaturalistMLWork

0 stars 0 forks source link

Implement common ancestor calculation into inatVisionAPI #34

Closed pleary closed 4 months ago

pleary commented 4 months ago

Currently the node API is responsible for calculating a "common ancestor" of vision results, which we display to users on the website and current mobile apps. If the python inatVisionAPI was able to map outdated taxa to their current equivalents, it should be able to generate the same common ancestor and include it in API responses. We could also then include statistics about common ancestor precision, accuracy, and recall in model evaluations, and track these metrics over time ensuring our continued ability to generate a reasonable common ancestor.

The goal of this ticket is to implement a method to return a common ancestor for a image scoring request as closely as possible to how it is currently being generated with the node API. We should incorporate the common ancestor taxon in the API response, which may require a breaking change to the response and bumping the version of the API. The ability to map changed taxa may not be a blocker for implementation of this feature, but is likely a blocker to releasing this feature.

pleary commented 4 months ago

This has been incorporated into the inatVisionAPI. A starting point to the logic would be this method. We can continue to tweak the parameters that go into calculating a common ancestor. I tested and replicated exactly the parameters the node API was using, and made some minor changes to those parameters that give a slightly higher F1 score, and that's what the inatVisionAPI is using right now