Expose a detection level for sequences and alerts

Open
#718 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 7 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
fastapi, postgresql, python
Domain
api, backend

Research direction

Start by reading the API's sequence and alert response definitions and the configuration for TEMPORAL_MODEL_THRESHOLD; the issue does not name their files. Then inspect how annotated sequences store is_wildfire and how model scores are recorded. Done means sequences and alerts return documented levels, thresholds are configurable, and their distribution is checked against annotated data; the alert aggregation and model version behavior still need decisions.

Written by the indexing model from the issue text.

Description

type: feat
Context & Objective

Part of the epic pyronear/roadmap#28 (Alert analysis and follow-up). The API already exposes temporal_model_score per sequence. Users and tenders ask for something readable: how reliable is this alert? We want the API to translate the score into a few levels, so that every client shows the same thing.

What is done currently
  • Each sequence has temporal_model_score with its model versions. An alert groups the sequences that were triangulated together.
  • The score threshold used for validation lives in the API (TEMPORAL_MODEL_THRESHOLD). Nothing translates the score into levels.
What has to be done
  • Define three levels (high, medium, limited) from temporal_model_score, with the thresholds in configuration.
  • Return the level with sequences and alerts. For an alert, derive it from its sequences.
  • Handle sequences without a score (never scored, model unavailable, version change).
  • Look at the distribution of annotated sequences (is_wildfire) by score, to choose the thresholds: which share of each category falls in each level.
Open questions
  • How is an alert level built from its sequences: highest, or a combination?
  • What happens to stored levels when the model version changes?
  • Do we need a quick analysis of the thresholds (for Mateo), or are the validation threshold and its study (pyronear/vision-rd#143, pyronear/vision-rd#156) enough?
Done when
  • Sequences and alerts return a level, documented
  • Thresholds are in configuration and checked on annotated data
Dominant language
Python
Stars
31
Forks
15
Avg merge
7d 18h
Merged PRs (30d)
17

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pyronear/pyro-api

All issues in pyronear/pyro-api

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.