Skip to content

Add synthetic convergence benchmark test#638

Draft
Borda wants to merge 8 commits intodevelopfrom
ci/benchmark
Draft

Add synthetic convergence benchmark test#638
Borda wants to merge 8 commits intodevelopfrom
ci/benchmark

Conversation

@Borda
Copy link
Member

@Borda Borda commented Feb 4, 2026

This pull request adds a new benchmark test to ensure that training on a synthetic dataset improves model performance, specifically mean average precision (mAP@50) and validation loss. The test generates a synthetic COCO-style dataset, evaluates the model before and after training, and asserts that training leads to measurable improvements.

New synthetic benchmark test:

  • Added a slow-running test test_synthetic_training_improves_map50 to tests/benchmarks/test_synthetic_convergence.py that:
    • Generates a synthetic COCO-format dataset with basic shapes.
    • Evaluates an untrained RFDETRNano model's baseline mAP@50 and validation loss.
    • Trains the model for 2 epochs on the synthetic data.
    • Evaluates the trained model and asserts that mAP@50 increases and validation loss decreases.
    • Saves diagnostic results to synthetic_benchmark.json.

This commit introduces a new test case to benchmark synthetic dataset training convergence, verifying improvements in mAP@50 and validation loss after training.
@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54%. Comparing base (2b3f550) to head (a81ea42).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #638     +/-   ##
========================================
+ Coverage       25%    54%    +29%     
========================================
  Files           47     47             
  Lines         6342   6342             
========================================
+ Hits          1577   3400   +1823     
+ Misses        4765   2942   -1823     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Borda added 7 commits February 5, 2026 00:07
- Use `tqdm.auto` for better progress bar compatibility.
- Extract synthetic dataset generation logic into a reusable pytest fixture.
- Simplify benchmark test by integrating the fixture.
…rgence test

- Introduce `synthetic_color_dataset_dir` for color-based dataset generation.
- Rename `synthetic_dataset_dir` to `synthetic_shape_dataset_dir` for clarity.
- Refine synthetic convergence test with stricter assertions on mAP@50 and validation loss.
…vergence test configuration

- Delete `synthetic_color_dataset_dir` fixture as it is no longer used.
- Update model initialization to disable pretrain weights.
- Increase training epochs in synthetic convergence test.
- Relax mAP@50 assertion threshold and refine validation loss message.
…eneration

- Enable control over the minimum and maximum number of objects per image.
- Update `generate_synthetic_sample` calls and docstrings accordingly.
… loss tracking

- Add GPU support fallback for test execution.
- Include train dataset evaluation and diagnostics for better loss comparison.
- Refine loss and mAP@50 assertions for improved test accuracy.
- Update assertion messages to include variable names for better readability.
- Adjust messages to improve debugging context in test failures.
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.

1 participant