ultralytics/callbacks
Fatih Akyon 931b81fe57
feat: add dinov3 distill recipe with photometric stack and wd schedule
Motivation
  fastvit-s x adaptor diverges at full scale on 7-source training (final knn
  5.9%, chance-level). Forensic smokes ruled out norm hot-swap, beta2 sweep,
  fixed-wd changes, and BN running-stat freezes. Two recipe-level mismatches
  with DINOv3 / EUPE / UNIC / DUNE distillation papers remained:
    * our pipeline still pulls Ultralytics defaults RandAugment + RandomErasing
      0.4 from cfg/default.yaml, while every reference recipe disables both
      and instead uses ColorJitter + Grayscale + GaussianBlur + Solarize;
    * we use fixed weight_decay 0.02 with ~1pct warmup, while DINOv3 ramps
      wd 0.04 -> 0.2 over training and warms up for 16pct of epochs.

What changed
  callbacks/distill_aug.py: classify_augmentations_distill, sibling to
    ultralytics/data/augment.py:classify_augmentations. Same signature plus
    grayscale, gaussian_blur, solarize knobs (default 0.0 = bit-equivalent
    to upstream). Order mirrors UNIC main_unic.py:485-521. Kept out of
    ultralytics/data/ to avoid touching the upstream cls training pipeline.
  callbacks/wd_schedule.py: half-cosine wd ramp matching DINOv3
    dinov3/optim/schedulers.py CosineSchedule, registered DDP-safe inside
    the trainer __init__ (per utils/dist.py:79 callbacks-on-rank-0 footgun).
  ultralytics/cfg/__init__.py: extend allowed_custom_keys with wd_end,
    grayscale, gaussian_blur, solarize so DDP arg serialisation passes.
  ultralytics/models/yolo/classify/train_image_encoder.py: switch
    _build_transforms to classify_augmentations_distill and forward the
    three new self.args knobs; register wd_schedule callback when wd_end > 0.
  run_enc_distill_phase1.py: new dinov3 recipe (lr0=2e-4, wd 0.04->0.2,
    warmup 18 ep, ColorJitter 0.4/0.4/0.2/0.1, grayscale 0.2, blur 0.5,
    solarize 0.2, auto_augment off, erasing off) plus override forwarding.
  Existing default / eupe / radio / unic recipes untouched.
2026-04-25 18:55:25 -05:00
..
__init__.py feat: add callbacks module for experiment config 2026-03-21 01:01:11 -05:00
alpha_schedule.py feat: add alpha schedule and stochastic depth callbacks 2026-03-26 03:13:54 -05:00
attn_prescale.py feat: add attention pre-scaling callback for fp16 stability 2026-03-23 23:08:07 -05:00
beta2_override.py feat: add beta2_override callback for AdamW optimizer tuning 2026-04-11 04:34:58 -05:00
cls_to_det_remap.py fix: drop original model.9 keys in cls-to-det remap 2026-04-11 17:51:48 -05:00
distill_aug.py feat: add dinov3 distill recipe with photometric stack and wd schedule 2026-04-25 18:55:25 -05:00
droppath.py feat: add alpha schedule and stochastic depth callbacks 2026-03-26 03:13:54 -05:00
grad_clip.py feat: add callbacks module for experiment config 2026-03-21 01:01:11 -05:00
grayscale.py feat: add grayscale augmentation callback 2026-03-23 05:02:06 -05:00
mixup.py feat: add classification mixup/cutmix callback 2026-03-23 23:09:28 -05:00
muon_w.py feat: add callbacks module for experiment config 2026-03-21 01:01:11 -05:00
nfs_sync.py fix: pin project to local and harden nfs_sync 2026-04-17 11:19:44 -05:00
paths.py feat: accept data= in paths.patch_resume 2026-04-18 11:31:06 -05:00
wandb_config.py feat: wandb fork_and_attach helper and LOCAL_PROJECT guard 2026-04-17 12:06:34 -05:00
wd_schedule.py feat: add dinov3 distill recipe with photometric stack and wd schedule 2026-04-25 18:55:25 -05:00