Skip to content

[犀牛鸟-A2]:Add configurable scale-aware TAL assignment for small objects - #274

Open
YilinWang121054 wants to merge 1 commit into
Tencent:mainfrom
YilinWang121054:review/a2-stal-final
Open

[犀牛鸟-A2]:Add configurable scale-aware TAL assignment for small objects#274
YilinWang121054 wants to merge 1 commit into
Tencent:mainfrom
YilinWang121054:review/a2-stal-final

Conversation

@YilinWang121054

Copy link
Copy Markdown
Contributor

Summary

Small VisDrone objects can contain too few anchor centers for TAL, even with a larger top-k. This change adds an explicit stal_mode=tal|fixed|adaptive switch. Adaptive mode expands the candidate region of small GT boxes, adds nearby candidates when coverage is insufficient, and uses separate top-k values for small, medium, and large objects.

The configuration lives in default.yaml, with checks for types, finite values, ranges, and parameter relationships. The default remains fixed-stride expansion. Alpha, beta, and the IoU ranking metric are unchanged. The candidate-conflict fix is already merged in #253 and is a dependency of this work, not a second bug-fix contribution.

Tests

The review checkout, merged with upstream main at 7bfbfd3, passes the STAL, default-configuration, model-configuration and TAL conflict tests on CPU:

python -m pytest tests/test_stal_assignment.py tests/test_default_config_integrity.py tests/test_master_model_configs.py tests/test_tal_conflict_resolution.py tests/test_tal_mps_regression.py -q -o addopts=''
33 passed, 1 skipped

Coverage includes candidate geometry, area boundaries, empty GT, tiny boxes, overlapping targets, candidate conflicts, configuration injection and invalid parameters (including NaN/Inf). MPS is unavailable in this run. The autocast test exercises a small assignment/loss fixture; this CPU run does not certify real-batch CUDA AMP parity. The changed files retain 15 Ruff diagnostics already present in current main, with no new diagnostics; their formatting and spelling checks pass. Repository-wide quality checks are not clean, and their outputs are retained separately.

Experiments

The full-data experiments use YOLO-Master v0.1-N, VisDrone2019-DET, imgsz=800, batch=4, FP32, Mosaic on, and 120 epochs. The primary checkpoint is last.pt from epoch 120. APs uses original-image GT area <32² and maxDets=500, after the VisDrone ignore-region filter. These area bins are an A2 supplement.

Seed fixed APs adaptive APs ΔAPs (pp)
20260824 13.5280 13.3655 −0.1625
20260825 13.0766 12.7361 −0.3405
20260826 12.6454 training pending

These results do not meet the A2 +1.0 APs target. Seed 20260824 also differs from later seeds in actual optimizer momentum (0.937 versus 0.9), so the rows are not presented as a uniform three-seed aggregate. A fixed-subset smoke reduced small-GT zero-positive rates, but this has not translated into higher APs in the completed pairs.

The locked acce839 P0 baseline has also completed 120 epochs and full 548-image validation. Its supplemental APs/APm/APl are 12.5117/30.7556/39.7667. All 120 online assignment records were checked against the original files and cover 194,160 training batches. This baseline is recorded separately from the fixed comparison, which includes #253.

Research report (Chinese) · P0 metrics, predictions and 120 assignment records · Evidence index · Regression test log. These links are pinned to the verified evidence commit. This PR does not claim an accuracy improvement or P1 acceptance.

Limitations

The minimum candidate count is enforced before conflict resolution; it does not guarantee that every GT retains that many positives. Candidate counts also do not measure normalized target weights. Full online per-epoch statistics are available for the new P0 baseline, not retrospectively for the older TAL/fixed/adaptive runs. The remaining paired runs and Mosaic interaction are incomplete.

The original MATLAB devkit could not run on this host because MATLAB R2024a reports MathWorks error 5201. The review package includes a MATLAB-source audit port and concrete prediction-level counterexamples for the older Python port; its runtime parity remains pending until the original tool runs on a licensed host. P2 threshold/warmup scans and a second dataset/task have not been completed. The latest-main diff was checked to exclude the already merged #253 fix.

Consolidated onto upstream 7bfbfd3. The complete tree matches local tested merge 6f55860. Training evidence retains its original source commits.
@YilinWang121054

Copy link
Copy Markdown
Contributor Author

CI follow-up (2026-09-11): I compared the failing Windows and Ubuntu Python 3.13 jobs against the exact upstream base, 7bfbfd3. Both shards have the same failing test names and error summaries as the base.

  • Windows: base 3 failed / 1947 passed; this PR 3 failed / 1965 passed.
  • Ubuntu x64: base 2 failed / 1950 passed; this PR 2 failed / 1968 passed.

The shared failures are the foundation configuration error-message assertion and cached-response distillation's feature/stride count mismatch. Windows also has the offline-cache key validation failure. Although one traceback points to tal.py, make_anchors is unchanged; the foundation files and these test files are also unchanged.

Comparison, original job links, preserved logs and local reproduction. The local Windows sandbox blocks the offline test's attempted root-directory write, so its final exception differs from hosted CI; this is documented separately.

I have not skipped these tests or changed foundation behavior to make the checks green. This note explains the two checked failures; it does not claim that all CI passes.

@YilinWang121054

Copy link
Copy Markdown
Contributor Author

P0 评测材料补充(2026-09-11)

补交一份官方 DET 源码与 Python 实现的逐项对照,参考版本锁定为 VisDrone2018-DET-toolkit 的 0054457。这次重点核对了取整、同分排序、ignore-region 积分边界、GT 匹配和 AP 汇总,29 项边界测试已通过。

使用原始 P0 第120轮 last.pt 对应的548份预测重新评测,Python输出与原记录逐字节一致:AP=21.7003、AP50=39.3606、AP75=20.6084、AR500=38.2194。需要说明的是,本机仍没有成功运行 MATLAB;这里提交的是源码级核验,不能将 Python 自身复算一致说成跨语言数值对齐。

报告保留了 adaptive 的负结果。seed 20260824 因 auto/momentum 差异单列为探索性,早期缺完整逐轮统计的组仅供参考,不用于正式三seed的 P1 达标判定。原始基线的完整配置、checkpoint SHA-256、120轮统计和原始日志都已公开。如果源码对应关系还有遗漏,欢迎指出,我会继续补充。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants