Skip to content

[Draft] Make processing service support model retraining - #167

Draft
mohamedelabbas1996 wants to merge 1 commit into
mainfrom
feat/bioclip-antenna-integration
Draft

[Draft] Make processing service support model retraining#167
mohamedelabbas1996 wants to merge 1 commit into
mainfrom
feat/bioclip-antenna-integration

Conversation

@mohamedelabbas1996

Copy link
Copy Markdown

Summary

Antenna is gaining the ability to retrain a classifier head from species that people have verified. Only some models are worth retraining — a classifier head over a frozen backbone is cheap, a detector or a model trained end to end is not — so Antenna needs to be told which is which before it can offer retraining for a pipeline.

This adds that one flag. A model declares trainable, the worker reports it in the algorithm config it registers with Antenna, and Antenna uses it to decide whether retraining applies. Nothing else changes: no model is trainable unless it says so, and nothing here trains anything.

List of Changes

# What it does How
1 A model can declare that its head can be retrained trainable attribute on InferenceBaseClass, defaulting to False
2 Antenna is told which algorithms can be retrained trainable field on AlgorithmConfigResponse
3 Both places that build an algorithm response pass the flag through make_algorithm_response() and make_algorithm_config_response()

Detailed Description

The flag is per algorithm rather than per service. A processing service usually hosts several pipelines and only one of them has a retrainable head, so a single service-level flag would not tell Antenna which head to touch.

The default is False everywhere, and the builders read it with getattr(model, "trainable", False), so a model written before this change is treated as not trainable rather than being assumed retrainable.

This matches the field Antenna reads from /info, which it mirrors onto its own Algorithm records. The corresponding Antenna change is in RolnickLab/antenna#1407.

Verification

trapdata/tests/test_trainable_flag.py covers the default, the response default, a model that declares the flag, and a model that predates the attribute.

Note: these tests have not been run locally — the working tree had no Python environment and building one pulls in torch. The schema field itself was checked in isolation with pydantic. CI runs the rest.

Antenna is gaining the ability to retrain a classifier head from species people
have verified, but only some models are worth retraining: a head over a frozen
backbone is cheap, a detector or a model trained end to end is not.

A model now declares whether its head can be retrained, and the worker reports
that in the algorithm config it registers with Antenna. The flag is per algorithm
rather than per service, because a service usually hosts several pipelines and
only one of them has a retrainable head.

Nothing is trainable unless it says so, and nothing here trains anything.

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mohamedelabbas1996 mohamedelabbas1996 changed the title [Draft] Report which algorithms can be retrained [Draft] Tell Antenna which models can have their classifier head retrained Sep 3, 2026
@mohamedelabbas1996 mohamedelabbas1996 changed the title [Draft] Tell Antenna which models can have their classifier head retrained [Draft] Make processing service support model retraining Sep 3, 2026
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.

1 participant