Skip to content

Adds YOLO-Master-EsMoE-N LoRA adaptation examples for brain-tumor and VisDrone #69

Open
Alanxtl wants to merge 2 commits into
Tencent:mainfrom
Alanxtl:new
Open

Adds YOLO-Master-EsMoE-N LoRA adaptation examples for brain-tumor and VisDrone #69
Alanxtl wants to merge 2 commits into
Tencent:mainfrom
Alanxtl:new

Conversation

@Alanxtl

@Alanxtl Alanxtl commented Jun 30, 2026

Copy link
Copy Markdown

Summary

Fixes #50.

This PR adds YOLO-Master-EsMoE-N LoRA adaptation examples for two vertical scenarios: dense aerial detection on VisDrone and sparse medical detection on brain-tumor. It includes scenario-specific LoRA configs, a reusable rank-sweep script, recorded sweep results, and a guide covering rank selection, target-module choices, and common dataset pitfalls.

Edits to main code

ultralytics/validator.py is currently missing import for torch_distributed_zero_first and LOCAL_RANK. Missing inplement for convert_ndjson_to_yolo_if_needed

I add them

Changes

  • Added yolo_master_visdrone_lora.yaml for dense aerial VisDrone LoRA fine-tuning.
  • Added yolo_master_brain_tumor_lora.yaml for sparse brain-tumor LoRA fine-tuning.
  • Added run_yolo_master_lora_rank_sweep.py to run rank sweeps with r=4,8,16.
  • Added yolo_master_lora_rank_sweep_results.csv with recorded metrics, trainable params, training time, and peak VRAM.
  • Added yolo_master_lora_scenarios_README.md with:
    • scenario comparison
    • rank recommendations
    • LoRA target-module guidance
    • routing/gating exclusion rationale for MoE
    • common pitfalls for medical and aerial datasets
  • Updated the LoRA examples README to reference the new YOLO-Master scenarios.
  • Added NDJSON-to-YOLO conversion helper wiring used by validation utilities.

LoRA Design Notes

Both scenario configs expose the requested LoRA controls:

  • lora_r
  • lora_alpha
  • lora_use_rslora
  • lora_target_modules
  • lora_include_attention
  • lora_gradient_checkpointing

For YOLO-Master-EsMoE-N, the default recipes adapt convolution and expert-projection modules while excluding router/gating layers:

lora_exclude_modules: ["router", "routing", "gate", "gating"]

This keeps expert routing stable during short few-shot fine-tuning runs. Router LoRA can still be evaluated separately as an ablation.

Experiments

Rank sweeps were run within the 20-50 epoch constraint.

Scene Rank Epochs Fraction mAP50-95 Best epoch Trainable params Adapter params Train time Peak VRAM
brain-tumor 4 40 1.0 0.27129 36 468,290 123,116 13.31 min 3.20 GB
brain-tumor 8 40 1.0 0.31259 40 596,782 251,608 13.74 min 3.21 GB
brain-tumor 16 40 1.0 0.33535 37 848,390 503,216 14.82 min 3.30 GB
VisDrone 4 30 0.25 0.01239 20 472,410 123,116 34.82 min 12.50 GB
VisDrone 8 30 0.25 0.0149 23 600,902 251,608 35.12 min 12.50 GB
VisDrone 16 30 0.25 0.02615 26 852,510 503,216 36.04 min 12.60 GB

@Alanxtl Alanxtl changed the title finish brain_tumor and visdrone Adds YOLO-Master-EsMoE-N LoRA adaptation examples for brain-tumor and VisDrone Jun 30, 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.

【2026犀牛鸟开源人才专属】【低难度】训练优化专项:垂类场景 LoRA 高效微调适配

1 participant