Skip to content

docs(lora): add YOLO-Master domain adaptation configs#67

Closed
xie-guangzhen wants to merge 1 commit into
Tencent:mainfrom
xie-guangzhen:lora-domain-adaptation-50
Closed

docs(lora): add YOLO-Master domain adaptation configs#67
xie-guangzhen wants to merge 1 commit into
Tencent:mainfrom
xie-guangzhen:lora-domain-adaptation-50

Conversation

@xie-guangzhen

Copy link
Copy Markdown

Description | 描述

Adds YOLO-Master-EsMoE-N LoRA adaptation examples for two visually different vertical scenarios requested in #50:

  • VisDrone dense aerial detection
  • brain-tumor sparse medical detection

The PR includes scenario-specific LoRA configs, a reproducible rank sweep launcher, and README guidance for rank selection, target module policy, MoE routing handling, and common pitfalls.

Related Issue | 关联 Issue

Fixes #50

Change Type | 修改类型

  • Bug fix | Bug 修复
  • New feature | 新功能
  • Documentation update | 文档更新
  • Training/example configuration | 训练/示例配置

Files Added | 新增文件

  • examples/lora_examples/yolo_master_visdrone_lora.yaml
  • examples/lora_examples/yolo_master_brain_tumor_lora.yaml
  • examples/lora_examples/domain_lora_rank_sweep.py

Implementation Details | 实现说明

VisDrone

  • Uses VisDrone.yaml
  • Uses YOLO-Master v0.5 nano detection config: ultralytics/cfg/models/master/v0_5/det/yolo-master-n.yaml
  • Default rank: r=16, alpha=32
  • Enables lora_include_moe=True and lora_include_attention=True
  • Uses larger imgsz=960, multi_scale=True, and max_det=500 for dense small-object aerial scenes

brain-tumor

  • Uses brain-tumor.yaml
  • Uses YOLO-Master v0.5 nano detection config: ultralytics/cfg/models/master/v0_5/det/yolo-master-n.yaml
  • Default rank: r=8, alpha=16
  • Enables lora_include_moe=True, keeps lora_include_attention=False
  • Freezes BN and disables mosaic-style late scheduling for sparse medical data stability

MoE routing policy

Both configs intentionally do not explicitly target routing modules. The router controls top-k expert assignment and can overfit or collapse under short few-shot schedules. The configs adapt Conv/Linear feature transforms and MoE expert/projection paths while keeping routing decisions stable.

Rank Sweep | Rank 对比

Added domain_lora_rank_sweep.py to run the required r=4,8,16 comparisons:

python examples/lora_examples/domain_lora_rank_sweep.py --scenario visdrone --device 0
python examples/lora_examples/domain_lora_rank_sweep.py --scenario brain_tumor --device 0

The script launches one yolo train command per rank and writes a CSV summary including:

  • mAP50-95
  • train time
  • peak memory when available from logs/results
  • run directory
  • trainable parameter note for trainer logs

The README includes the comparison table template and scenario recommendations.

Self-test Checklist | 自测清单

  • Verified Python syntax for the sweep script
  • Verified VisDrone dry-run commands for r=4,8,16
  • Verified brain-tumor dry-run commands for r=4,8,16
  • Verified diff has no whitespace errors

Commands run locally:

python3 -m py_compile examples/lora_examples/domain_lora_rank_sweep.py
python3 examples/lora_examples/domain_lora_rank_sweep.py --scenario visdrone --dry-run
python3 examples/lora_examples/domain_lora_rank_sweep.py --scenario brain_tumor --dry-run
git diff --check

@xie-guangzhen

Copy link
Copy Markdown
Author

Superseded by #70 after the valid RhinoBird claim window opened on July 1.

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