add 4-class fiber/ink self-distillation trainer (scripts/fiber_5class)#985
Conversation
3D UNet for bg / vertical fiber / horizontal-angular fiber / ink, self-distilled from frozen fiber+ink teachers (no GT). Per-crop GPU pseudo-labels: fiber prob -> cuws watershed -> per-instance PCA orientation split; ink overrides fibers; raw<90 forced to background. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4140564b28
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| model = build_fiber_unet( | ||
| crop_size=crop_size, | ||
| target_name=target_name, | ||
| out_channels=out_channels, | ||
| activation=activation, | ||
| in_channels=in_channels, | ||
| ) |
There was a problem hiding this comment.
Rebuild teachers from their checkpoint config
When a frozen teacher checkpoint was trained with any non-default NetworkFromConfig layout (for example guided, MedNeXt, or manual-width configs stored in the repo's model_config/config checkpoints), this rebuilds a default autoconfig UNet using only the target name and channel count, then loads with strict=False. Missing or unexpected non-head weights are only printed, so pseudo-label generation can silently run with an untrained or differently wired teacher instead of reconstructing the checkpoint architecture or failing.
Useful? React with 👍 / 👎.
| payload = { | ||
| "model": student_module.state_dict(), | ||
| "optimizer": optimizer.state_dict(), | ||
| "step": step, |
There was a problem hiding this comment.
Record the next step when checkpointing
This payload is written after the optimizer update for the current loop iteration, so storing step makes resumes replay a step that has already been completed (for example, a checkpoint saved at loop step 1000 resumes with step=1000). The same off-by-one means the example num_iterations=30000/save_every=1000 run never writes a checkpoint for the final completed boundary; use step + 1 for the saved progress/trigger or add an explicit final save.
Useful? React with 👍 / 👎.
3D UNet for bg / vertical fiber / horizontal-angular fiber / ink, self-distilled from frozen fiber+ink teachers (no GT). Per-crop GPU pseudo-labels: fiber prob -> cuws watershed -> per-instance PCA orientation split; ink overrides fibers; raw<90 forced to background.