Skip to content

Save and display OOD scores#814

Merged
mihow merged 15 commits intodeployments/ood.antenna.insectai.orgfrom
feat/save-ood-scores
Apr 30, 2025
Merged

Save and display OOD scores#814
mihow merged 15 commits intodeployments/ood.antenna.insectai.orgfrom
feat/save-ood-scores

Conversation

@mihow
Copy link
Copy Markdown
Collaborator

@mihow mihow commented Apr 25, 2025

Summary

  • Save OOD scores from the ML backend responses for each classification of each detection (if the backend returns one)
  • Determine & update the overall OOD score of the Occurrence based on the average of its detections
  • Display the scores in a minimal way in the frontend (Occurrences table)

image
(Warning: this example shows Oregon moths or non-moths run with the Panama classifier)

@mihow mihow changed the base branch from main to feat/save-classification-features April 25, 2025 22:37
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 25, 2025

Deploy Preview for antenna-preview canceled.

Name Link
🔨 Latest commit 60c3b47
🔍 Latest deploy log https://app.netlify.com/sites/antenna-preview/deploys/6811bb425823c20008e5b10c

@mihow mihow requested a review from Copilot April 26, 2025 00:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces support for saving and displaying out‐of‐distribution (OOD) scores. Key changes include:

  • Adding a new UI column and cell component (OODScoreCell) to display the OOD score.
  • Extending the Occurrence model with getters for determinationOODScore and determinationOODScoreLabel.
  • Updating ML pipeline processing, API schemas, serializers, and migrations to include and propagate the new OOD score field.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ui/src/pages/occurrences/occurrence-columns.tsx Adds a new column and UI cell component (OODScoreCell) to display the OOD Score.
ui/src/data-services/models/occurrence.ts Defines getters for determinationOODScore and determinationOODScoreLabel.
ami/ml/schemas.py Adds the optional ood_score field to the ClassificationResponse schema.
ami/ml/models/pipeline.py Updates classification creation by including ood_score in the NEW_FIELDS array and passing it through.
ami/main/models.py Adds new fields (ood_score, determination_ood_score) and updates occurrence determination logic in update_occurrence_determination().
ami/main/migrations/0063_classification_ood_score_and_more.py Creates new database fields for ood_score and determination_ood_score.
ami/main/api/views.py & ami/main/api/serializers.py Updates API view filtering and serializer definitions to include determination_ood_score and ood_score.

Comment thread ami/main/models.py Outdated
@mihow mihow changed the base branch from feat/save-classification-features to deployments/ood.antenna.insectai.org April 29, 2025 15:53
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 29, 2025

Deploy Preview for antenna-ood canceled.

Name Link
🔨 Latest commit 60c3b47
🔍 Latest deploy log https://app.netlify.com/sites/antenna-ood/deploys/6811bb42e28d670008a05829

mohamedelabbas1996 and others added 8 commits April 29, 2025 18:55
* feat: Added pgvector extension

* feat: Added features field to the Classification model

* changed taxon and detection to autocomplete fields in the ClassificationAdmin model

* feat: added similar action to the ClassificationViewset

* chore: changed features vector field name to features_2048

* chore: changed features vector field name to features_2048

* feat: read features vector from processing service ClassificationResponse and save it to Classification object

* test: added tests for PGVector distance metrics

* updated docker-compose.ci.yml to use the same postgres image as docker-compose.yml
@mihow mihow force-pushed the feat/save-ood-scores branch from de1fbd1 to 2a75c23 Compare April 30, 2025 02:06
@mihow mihow force-pushed the deployments/ood.antenna.insectai.org branch from e7bed1a to 74d606b Compare April 30, 2025 03:39
@mihow mihow marked this pull request as ready for review April 30, 2025 05:45
@mihow mihow changed the title [Draft] Save and display OOD scores Save and display OOD scores Apr 30, 2025
@mihow mihow merged commit 5518f0d into deployments/ood.antenna.insectai.org Apr 30, 2025
4 checks passed
@mihow mihow deleted the feat/save-ood-scores branch April 30, 2025 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants