Skip to content

v0.4.0

Choose a tag to compare

@xtmtd xtmtd released this 09 Sep 15:14
· 12 commits to main since this release

What's new since v0.3.0

Training augmentation profiles

  • otuformer pretrain --augmentation global-barcode|color-robust|legacy — new-run default global-barcode: orientation-aware whole-specimen barcode augmentation with edge-derived background fill, expanded rotation, modest photometric jitter, and asymmetric blur.
  • otuformer finetune --augmentation none|conservative — default none (unchanged deterministic Resize → CenterCrop → ToTensor → Normalize); conservative is an experimental background-aware affine/photometric profile.
  • legacy reproduces OTU-Former 0.2.1 augmentation exactly, for old-run continuation and comparison.

Orientation policy

  • New --orientation-policy invariant|sensitive on both training commands. The new-run default is sensitive: rotation [-15°, 15°] and no horizontal reflection for every global/local pretraining view and for fine-tuning conservative. invariant is the opt-in broad-rotation + horizontal-reflection policy for orientation-insensitive markers. Neither policy is inferred from the image or taxon.

Reproducibility and resume

  • Checkpoints store config.augmentation_profile and a fully expanded config.augmentation_config (including orientation_policy).
  • Resume inherits omitted profile/policy/local-view values and rejects conflicts. Fine-tuning initialized from --checkpoint never inherits the pretraining profile, and inherits the saved orientation policy when omitted.
  • Checkpoint metadata is validated for self-consistency: a top-level/nested profile mismatch, a missing nested profile, or an unknown saved policy is rejected as malformed augmentation metadata.

CLI

  • Detailed augmentation contract in pretrain --help / finetune --help.
  • Shell completion for --augmentation and --orientation-policy values.
  • --local-crop-size / --local-crops inherit the checkpoint values on --resume.

Platform fix

  • PYTORCH_ENABLE_MPS_FALLBACK is enabled before augmentation validation, so the new default profile works on Apple Silicon with --device auto.

Breaking changes

  • New pretraining runs default to global-barcode + orientation-policy=sensitive instead of the historical augmentation. Resuming pre-0.4.0 checkpoints keeps the compatible legacy/invariant behavior.