#24621·ultralytics

Anti-Forgetting Sampling Strategy (AFSS) for Faster YOLO Training

Author: Youho99Created May 27, 2026Updated Sep 5, 2026
Labelsenhancementdetect

Current status — 2026-09-06

Optional, paused research; no core integration planned and no production blocker. PR #26017 was closed after a full review. Its 544 net non-documentation lines spread sampling policy across shared dataset, augmentation, trainer, DDP, checkpoint, configuration, and validation paths. The maintenance cost is not justified by the available benefit evidence. No replacement implementation is requested.

The review also reproduced incorrect score attribution at b32d24281c5044d32c55e0aa532eb40278bbbb56: with the actual YOLO26n/COCO8 loader and validator, 2 of 4 training images received each other's precision/recall because the scoring dataset's aspect-ratio order differs from the training dataset's order. This is a local CPU correctness reproduction, not a performance benchmark or a current-main regression; AFSS has not been merged.

The paper's speedup claim and the reported slow 170k-image run on an unofficial branch remain historical evidence from different configurations. They do not establish a net benefit for this PR. Any future reconsideration would need both a substantially smaller design at the existing owner and representative comparisons reporting total wall time (including scoring), held-out accuracy, and supported distributed/resume behavior. A speedup on one workload alone would not justify this maintenance burden.

Earlier invitations to explore a minimal opt-in sampler remain below as historical context. The existing sampler is unchanged; this issue is retained for the research discussion rather than an active implementation commitment.


Original report and historical context

Search before asking

  • I have searched the Ultralytics issues and found no similar feature requests.

Description

AFSS (Anti-Forgetting Sampling Strategy) is a dynamic image sampling method proposed in a recent paper that reduces YOLO training time by skipping already-learned images each epoch, while preventing forgetting via periodic resampling.

It measures a per-image learning sufficiency score as min(recall, precision) and categorizes each image as easy / medium / hard, each with a tailored sampling policy:

Level Sampling policy
Easy Sparsely resampled; priority to long-unseen images to prevent forgetting
Medium Partially sampled; recently unseen images prioritized
Hard Fully sampled every epoch

Use case

Training YOLO on large datasets (COCO-scale and above) is time-consuming because every image is processed every epoch, even those the model has already mastered.

AFSS would allow users to get >1.43× training speedup with no accuracy loss — or even slight gains — simply by replacing the default sampler.

The paper evaluates AFSS on YOLOv8, v10, v11 and v12 using the Ultralytics framework directly, across four benchmarks: MS COCO 2017, PASCAL VOC 2007, DOTA-v1.0 and DIOR-R.

Paper: https://arxiv.org/abs/2603.17684 Does YOLO Really Need to See Every Training Image in Every Epoch? — Xie et al., March 2026

Additional

The implementation would consist of a custom Sampler plugging into the existing DataLoader pipeline — non-invasive by design.

An optional training flag such as sampler=afss would be sufficient to expose the feature to users.

The authors conducted all their experiments directly on the Ultralytics codebase, which should make a future PR relatively straightforward.

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!