Skip to content

Support for "geo-fencing" approach to improve prediction accuracy for regional species list #797

Open

Description

@mihow

Summary

As an alternative to training regional models, we should be able to use the Taxa List feature in a post-processing step to provide much more accurate predictions.

Detailed Description

TBD

Implementation Details

Filter the global model predictions (30k) to a regional list and re-weight the softmax scores

Related Issues

#777

Additional Context

Needed for CFIA moth monitoring project (ports of entry)

Activity

  1. changed the title [-]Support for "geo-fencing" approach to improve prediction accuracy of global model[/-] [+]Support for "geo-fencing" approach to improve prediction accuracy for regional species list[/+] on Apr 3, 2025
  2. jbowden18 commented on Apr 3, 2025

    @jbowden18

    if there was a user friendly approach to filtering species to create ones own 'regional' pipeline would be great --also species come and go

  3. mihow commented on Jul 17, 2025

    @mihow
    CollaboratorAuthor

    Notes from call about implementation:

    • Receive all raw classifications from the processing backend (e.g the global species classifier)

    • All occurrences have a determination, which is a Taxon from the global classifier

    • Import the regional list of species that exist for a given deployment

    • Run post-processing step in Antenna

    • Each "Classification" has a prediction for all 20k species in the global list (every item in the model's category map). Each entry is associated with a Taxon instance in the Antenna DB

    • The regional taxa list has a subset of species names that were matched to Taxon entries in the Antenna DB when imported

    • Create a new CategoryMap with the subset of labels

    • Create a new Algorithm entry (called "World Moths (filtered for Pennsylvania)")

    • A,5,0.9; B,2,0.1; C;1,0.1;

    • A,5,0.9; C,1,0.2;

    • The masking function will remove all items from the labels, scores & logits fields that have the same index - which is mapped to a species which is not in the regional list

    • The scores will be recalculated so they add up to 1 (softmax)

    • Some occurrences will have a new determination

    • "Zeroing" entries instead of deleting them is another approach to consider. (set scores of unwanted species to zero, rather than deleting them) - Needs to be a very low negative number since these are logits (zero could be center).

  4. mihow commented on Jul 17, 2025

    @mihow
    CollaboratorAuthor

    Usage in our test branch feat/logistic-binning

    docker compose run --rm  django python manage.py test_class_masking --project 18 --taxa-list 4 --collection 11 --algorithm 12
    
    • Process some images with global classifier
    • Run test command
    • Update code to create a new Algorithm & CategoryMap on the fly
    • Update code to add a new Classification when the masking is run, rather than replace values in the existing classification
  5. mihow commented on Sep 3, 2026

    @mihow
    CollaboratorAuthor

    This is now being pursued as #1364 / #1367 (build a project taxa list from a region, and track which species a model can predict), building on class masking (#999) and the post-processing framework (#1289). Leaving open as the original geo-fencing proposal, since #1364/#1367 cover the 'generate the list' half rather than every idea here, but linking so the two threads don't diverge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions