RF-DETR-Large(DINOv2 ViT-L + LW-DETR,端到端免 NMS)在 DsPCBSD+ 九類資料集上的三階段接力微調。這是研究展示,不是產線檢驗工具。 RF-DETR-Large (DINOv2 ViT-L + LW-DETR, end-to-end, no NMS) fine-tuned in a three-stage relay on the nine-class DsPCBSD+ dataset. A research showcase, not a production inspection tool.
inference/infer/class_names.json
from inference/infer/class_names.json
三種子實驗:seeds 0/1/2 在 cudnn.deterministic=True 下結果完全相同 → CI95 收斂為 0,代表的是推論可重複性,不是模型品質的不確定度。訓練迴路的 EMA 峰值 0.5411(v11a ep9)另行保留並標明定義,不冒充主指標。
Three-seed run: seeds 0/1/2 give identical results under cudnn.deterministic=True → CI95 collapses to 0, which evidences inference reproducibility, not uncertainty about model quality. The training-loop EMA peak 0.5411 (v11a ep9) is kept separately with its definition stated.
AP@0.5 AP@0.5:0.95 · 右側為驗證集 GT 框數(169–929,落差 5.5×) right column = val GT boxes (169–929, a 5.5× spread)
GT 數為作者紀錄(C→B 級):由 valid/_annotations.coco.json 統計,該標註檔未隨倉發布,但 eval_val.py 會在下載資料後逐類打印 GT 數,九類加總 4,092 與 A 級 evaluated_on 字串吻合。
GT counts are an author record (grade C→B): tallied from valid/_annotations.coco.json, which is not shipped; eval_val.py prints them per class after the data download, and the nine values sum to 4,092 — matching the grade-A evaluated_on string.
實例最多的 SP(929 框)AP@0.5:0.95 最低(0.4025),實例最少的 SH(169 框)卻是第二高(0.5805)。若瓶頸是稀有類樣本不足,SH 應該最差 → 這個資料集上的真正瓶頸是框的精確定位與類間形態重疊,不是樣本量。九類 AP@0.5 與 AP@0.5:0.95 平均差 0.3277(= 0.8670 − 0.5393;逐類差距取平均同為 0.3277):大致抓得到,框不準。 The most frequent class SP (929 boxes) has the lowest AP@0.5:0.95 (0.4025) while the rarest SH (169 boxes) ranks second (0.5805). If scarcity were the bottleneck SH would be worst → the real bottleneck is localisation precision and morphological overlap between classes, not sample count. Mean AP@0.5 minus AP@0.5:0.95 across classes is 0.3277 (= 0.8670 − 0.5393): roughly found, poorly boxed.
| 單變數實驗Single-variable probe | 唯一變更Change | 結果(EMA)Result (EMA) | 判定Verdict |
|---|---|---|---|
| v10 | 續跑 lr 1e-4continue at lr 1e-4 | 0.5410 / 0.5380 / 0.5392 | 持平,lr 已過大flat, lr already too high |
| v11b | 解析度 640 → 768resolution 640 → 768 | 0.5410 (僅 2 epoch)(2 epochs only) | AP@0.5 升但框精度未跟上AP@0.5 up, localisation not |
| v12 | lr 5e-5 → 2e-5lr 5e-5 → 2e-5 | 0.5380 / 0.5362 | 低於有效學習率below the effective lr |
三個單變數實驗都未超越 v11a ep9 → 作者判定 0.5411 為此配方的天花板。這是「同配方、同資料、單變數」的內部結論,不構成對其他方法上限的主張。 None of the three single-variable probes beat v11a ep9 → the author concludes 0.5411 is the ceiling for this recipe. That is an internal, same-recipe conclusion and makes no claim about the limits of other methods.
| # | 路徑/倉內實作Path / implementation | 初步結果Preliminary result | 為何不算定論Why it is not a verdict |
|---|---|---|---|
| 1 | NWD · src/losses/nwd_loss.py | 未提升,以精度換極小召回no gain, traded precision for tiny recall | 早期 ablation,未在新配方重測early ablation, not re-run |
| 2 | WIoU v3 · src/losses/iou_losses.py | mAP 0.42825 (22 ep) | 未跑至收斂(基準 100 ep)not converged (baseline 100 ep) |
| 3 | MPDIoU · src/losses/iou_losses.py | 框更緊但 mAP 無增益tighter boxes, no mAP gain | 同上脈絡,可重測same context, re-runnable |
| 4 | SupCon · src/losses/supcon_head.py | λ∈{0.05…0.5} 未跨越 0.49never crossed 0.49 | grid 範圍窄、單次訓練narrow grid, single run |
| 5 | 768 + P2 · src/training/train.py | mAP 0.22 崩潰collapse | 可能源自 LR/warmup 不匹配likely LR/warmup mismatch |
| 6 | 知識蒸餾Distillation · train.py --distill-model | Neck 4 vs 3 IndexError | 程式碼不相容,非架構否定code incompatibility |
| 7 | VFL · src/losses/vfl_loss.py | mAP 0.143 (10 ep) | 100 ep 版因 RAM OOM 未執行100-ep run blocked by OOM |
| 8 | SAHI · src/evaluation/eval_sahi.py | 較基準 −23%−23% vs baseline | 未試 slice 160–200slices 160–200 untested |
| 9 | D-FINE-S · src/training/train_dfine.py | ep2 mAP 0.0009 即終止halted | lr 對 re-init 過高,無 warmup 補償lr too high for re-init |
| 10 | 5-fold WBF · src/evaluation/eval_wbf_pycocotools.py | mAP 0.4778 (−1.2%) | 僅 2 模型融合,多樣性不足;設計完成未執行only 2 models fused |
| 11 | DINOv3 LTDETR · train_dinov3_pcb_v2.py | fp16 下 step 100 NaNNaN at step 100 | 屬精度 bug 而非架構判定numerics bug, not an architecture verdict |
內部起點記錄為 YOLO26x 100 epoch、mAP@0.5:0.95 = 0.4896,因此「+0.0515/+10.5%」這個數字過去確實出現在實驗紀錄裡。本倉不把它當展示主軸:YOLO26x 並非可驗證的公開發表模型,倉內 vs_yolo26x_baseline 欄位也明寫該對照未留存。對外只講自己量到的數字。
The internal starting point was logged as YOLO26x at 100 epochs with mAP@0.5:0.95 = 0.4896, so “+0.0515 / +10.5%” did appear in the experiment record. This repository does not present it as a headline: YOLO26x is not a verifiable published model, and the in-repo vs_yolo26x_baseline field states the comparison was not retained. Only self-measured numbers are shown.
逐指令重現(資料下載、再平衡、COCO 轉換、三階段接力、pycocotools 重評)見倉庫 docs/reproduction.md;架構取捨與測試地圖見 docs/architecture.md;數字來源分級見 docs/results.md。
Command-by-command reproduction (download, re-balancing, COCO conversion, the relay, the pycocotools re-evaluation) is in docs/reproduction.md; architecture trade-offs and the test map in docs/architecture.md; metric provenance grades in docs/results.md.