Some object detectors decide, image by image, how many "queries" to spend. A query is a slot that can claim at most one object, and these detectors use a small counting network to look at the image and choose a few hundred slots for an empty field or over a thousand for a crowded parking lot. Every such detector we know of trains that counter and the detector at the same time, from scratch. Early in training the counter is nearly random, so the detector learns under query budgets that are wrong in ways it will never see at test time. We propose to treat the budget itself as the thing to schedule. Training starts with budgets computed from the ground-truth object count, which are easy because there are always enough slots. It then moves gradually to the counter's own predictions and to deliberately perturbed budgets that are too small or too large. The pace of that move is set by how reliable the counter has become, tracked as a running average over training.
The payoff has two parts. The detector should train more stably, because the slot-to-object matching would no longer be shaken by budgets that swing between batches. It should also become robust to budget errors, so that at deployment the budget can be clamped to a fixed hardware limit without accuracy collapsing. That addresses the latency jitter that currently blocks dynamic-query detectors from real-time use. The idea differs from the obvious combination of these two fields, which is to show sparse images before crowded ones. That would schedule the data. We schedule the control signal that couples the counter to the decoder, and we include the data-ordering curriculum as a competitor.
Background and the gap
Detection transformers (DETRs) predict a set of boxes from a set of learned query vectors. During training, each query is paired one-to-one with a ground-truth object by Hungarian matching, an optimal one-to-one assignment algorithm. The pairing is slow to stabilize. DN-DETR showed that early, noisy predictions make the assignments flip between epochs, measured with an instability metric. It fixed this by adding a training-only task: the decoder reconstructs ground-truth boxes from noised copies of them. DN-DETR assumes a fixed budget of 300 queries and a fixed noise level. It motivates our proposal, because matching instability is the bottleneck, and it supplies one tool: its instability metric will be one of our measurements.
Three detectors make the budget input-dependent, and these are the systems we modify.
- DQ-DETR classifies scene density into four count bins and maps them to 300, 500, 900 or 1500 queries. It reaches 30.2 mAP on AI-TOD-V2 against 25.9 for DINO-DETR. It drops to 50.2 versus 51.3 on COCO.
- Dome-DETR predicts a density heatmap, prunes background windows and scales queries progressively. It reaches 34.6 AP on AI-TOD-V2 and 39.0 on VisDrone, while compute varies from 338.4 to 398.9 GFLOPs across scenes.
- Query-adaptive DETR (RAQG) predicts the rank of the lowest-scoring true object to set the budget, adds a fixed buffer of extra background queries, and reaches 39.4% miss rate on CrowdHuman.
All three train the budget predictor jointly with the decoder under uniform sampling. None treats the decoder's exposure to budget errors as something to control. The research file does not say whether DQ-DETR feeds ground-truth-derived budgets to the decoder during training, so we include both conventions as baselines rather than assume either.
The curriculum literature supplies the pacing mechanism and two constraints on its design.
- Pacing mechanism. Curriculum Learning by Dynamic Instance Hardness showed that a moving average of per-example loss is a far more stable difficulty signal than instantaneous loss. It reports 82.2% versus 79.6% on CIFAR-100 over plain SGD. We reuse its moving-average estimator, applied to the counter's error rather than to image loss.
- Constraint: keep the easy regime in the mix. How does Multi-Task Training Affect Transformer In-Context Capabilities? found that purely sequential easy-to-hard schedules cause forgetting, while a mixed curriculum that keeps a share of easy tasks succeeds. This rules out a hard switch from oracle budgets to predicted ones.
- Constraint: start where the model can already succeed. A Task-centric Theory for Iterative Self-Improvement with Easy-to-Hard Curricula proves easy-to-hard schedules help only when difficulty steps are bridgeable and the model starts with nonzero competence. A small model that violated the second condition regressed by 0.28% on GSM8K. This tells us to begin from budgets where matching is feasible and to grow the perturbation in bounded steps.
- Sample-selection precedent. Self-Paced Learning lets the learner admit harder examples as its loss allows. We borrow the principle of learner-driven pacing, not its alternating optimization.
Core Claim
The accuracy gap of dynamic-query detectors and their brittleness to budget changes come largely from exposure mismatch. The decoder is trained under budgets produced by an unreliable counter, but evaluated under budgets from a trained counter or from a deployment cap. A budget curriculum fixes this mismatch. It moves from oracle budgets, to perturbed oracle budgets, to the counter's own predictions, paced by the counter's tracked reliability, while keeping some oracle budgets throughout. Compared with uniform joint training at equal compute, it should improve tiny- and crowded-object accuracy and reduce matching instability. It should also make accuracy degrade gracefully when the budget is forcibly capped.
Research Program
Write $K^*(I)$ for the oracle budget of image $I$: the budget the architecture would assign given the true object count, meaning DQ-DETR's bin for the true count or RAQG's true lowest-positive rank plus its supplement. Write $\hat K(I)$ for the counter's prediction. At training step $t$ the decoder receives
$$\tilde K_t(I) = \begin{cases} \lfloor \rho\, K^*(I) \rfloor,\ \ \rho \sim \mathrm{Uniform}[1-\delta_t,\, 1+\delta_t] & \text{with probability } \pi_t \\ \hat K(I) & \text{with probability } 1-\pi_t \end{cases}$$
Here $\pi_t$ is the probability of using the (perturbed) oracle and $\delta_t$ is the perturbation width. Under-allocation ($\rho<1$) leaves some objects unmatched. This forces the decoder to learn which objects to claim when slots are scarce, which is exactly the skill needed under a deployment cap.
The schedule is not a hand-set timetable. Both quantities are driven by the counter's moving-average error $e_t$, computed per density bin in the style of dynamic instance hardness.
- $\pi_t$ falls toward a floor $\pi_{\min}$ as $e_t$ shrinks. The floor is the mixed-curriculum replay share.
- $\delta_t$ grows in bounded increments only while the matching instability metric stays below its warm-start level. This respects the bridgeable-step condition from the self-improvement theory.
The counter itself always trains on its own loss. Only what the decoder sees is scheduled.
We will build this on two code bases chosen to cover the two families of counter: DQ-DETR for discrete bins on AI-TOD-V2 and VisDrone, and RAQG for continuous rank prediction on CrowdHuman. If compute allows, we will add Dome-DETR to test the continuous-density case on the strongest tiny-object system.
The analysis has three parts.
- Training dynamics. We track matching instability, the counter's error by density bin, and the epochs needed to reach a fixed accuracy.
- Budget robustness. We plot accuracy against a forced fixed budget, from 25% to 150% of the predicted budget, to see whether the decoder can be clamped for constant latency.
- COCO generalization. We test whether the curriculum narrows DQ-DETR's COCO regression. This checks the hypothesis that the regression partly reflects a decoder mistrained by a poor counter on balanced-count images.
Baselines
Naive reference. The unmodified dynamic-query detector trained end-to-end with the counter's predicted budget from step one, as in DQ-DETR and RAQG. Its reported numbers anchor our reproductions: 30.2 mAP on AI-TOD-V2 and 37.0 on VisDrone for DQ-DETR, and 39.4% miss rate on CrowdHuman for RAQG. We rerun it with our seeds and schedule so that any gain is measured against our reproduction, not the paper figure.
Strongest existing method. On AI-TOD-V2 and VisDrone this is Dome-DETR, with Dome-DETR-L reporting 34.6 AP and 39.0 AP respectively. Applying our curriculum to Dome-DETR and beating its reproduced number at equal epochs is the strongest claim available. Applying it to DQ-DETR and closing part of the gap to Dome-DETR is a weaker but still informative result. On CrowdHuman the strongest reported dynamic-query result in the file is RAQG's 39.4% miss rate. On COCO the reference is DINO-DETR's 51.3 against DQ-DETR's 50.2, as reported in the DQ-DETR paper.
Fairness. All variants share backbone, augmentation, epoch count, learning-rate schedule and evaluation code. Curriculum hyperparameters ($\pi_{\min}$, the $\delta_t$ step size, the moving-average decay) get the same small tuning budget, three configurations on a validation split, as the baselines' own budget-related hyperparameters. We report at least three seeds.
What counts as winning. On AI-TOD-V2, VisDrone and CrowdHuman, the curriculum must beat the reproduced naive reference by more than the seed spread on AP, very-tiny AP and miss rate. It must also show lower matching instability, and at a 50% budget cap it must lose clearly less accuracy than the baseline.
Ablations that isolate the key ingredient are each run under the same protocol:
- oracle budgets only, without perturbation or annealing;
- perturbation applied at fixed width from step one;
- annealing driven by a fixed epoch timetable instead of the counter's tracked error;
- removing the replay floor ($\pi_{\min}=0$).
Why not just…?
Why not just order the data from sparse to crowded scenes? This is the obvious curriculum at this intersection, and we run it as a direct competitor at equal epochs. Our reason to doubt it is mechanistic. Sparse-first ordering delays the dense images where the counter must learn its hardest bins, and it does nothing about budget mismatch on images the model does see. The mixed-curriculum result in the function-class study also warns that sequential data orderings forget. If density ordering matches our method on accuracy, the budget-robustness curve still separates them. Data ordering gives no reason for the decoder to tolerate capped budgets, so a flat robustness curve for our method alone would show the budget schedule is the active ingredient.
Why not just use oracle budgets for the whole of training and switch to predicted ones at test time? This is the most serious threat, because it is simple and already removes early budget noise. It is the pure-sequential and zero-replay end of our design, and we expect it to suffer exposure bias. The decoder never sees an under-allocated budget, so when the counter errs at test time, or when a cap is imposed, it has learned nothing about prioritizing objects. If this baseline matches our method on both standard accuracy and the capped-budget curve, the curriculum is unnecessary and we will report that.
Why not just set a large fixed budget, such as 1500 or 2000 queries, and skip counting? RAQG reports that very large fixed query pools create foreground-background imbalance and false positives in sparse scenes. DS-Det shows sparse COCO images need only about 7% of DINO's queries while gaining 0.9 AP. We include a fixed-1500 DINO-style run to quantify this cost on our benchmarks.
Why not just add DN-DETR denoising to stabilize matching? Denoising stabilizes matching for the queries it adds, but it does not touch the coupling between counter and decoder. The two are complementary, so all our variants, baselines included, will use denoising queries. Any gain we report is then on top of that stabilizer.
Proposed Experiments
The decisive experiment trains DQ-DETR and RAQG under five regimes at equal epochs on AI-TOD-V2, VisDrone and CrowdHuman: the naive joint training, the sparse-to-crowded data curriculum, oracle-then-switch, the fixed large budget, and the full budget curriculum. We report AP, very-tiny AP, miss rate, matching instability per epoch, and counter error per density bin. Where compute allows, we repeat the comparison with Dome-DETR on AI-TOD-V2 against its reported 34.6 AP.
The second experiment is the budget-cap sweep. For each trained model we force the budget to fixed fractions of the predicted value and plot accuracy against GFLOPs and measured latency variance. The prediction is that only the curriculum-trained decoder keeps most of its accuracy at 50% of the budget. That would turn Dome-DETR-style compute variation into a deployable fixed-latency setting.
The third experiment trains DQ-DETR on COCO with and without the curriculum and asks whether the 1.1-point gap to DINO-DETR shrinks. A shrinking gap would support exposure mismatch as a cause of the regression. An unchanged gap would point back to the scale-specific feature enhancement that DQ-DETR's authors blame.
The proposal fails cleanly if two things hold together: oracle-then-switch equals the full curriculum on both standard accuracy and the capped-budget curve, and the counter-error-driven pacing performs no better than a fixed timetable.
References
- DN-DETR: Accelerate DETR Training by Introducing Query DeNoising
- DQ-DETR: DETR with Dynamic Query for Tiny Object Detection
- Dome-DETR: DETR with Density-Oriented Feature-Query Manipulation for Efficient Tiny Object Detection
- Query-adaptive DETR for Crowded Pedestrian Detection
- Curriculum Learning by Dynamic Instance Hardness
- How does Multi-Task Training Affect Transformer In-Context Capabilities? Investigations with Function Classes
- A Task-centric Theory for Iterative Self-Improvement with Easy-to-Hard Curricula
- Self-Paced Learning for Latent Variable Models
- DS-Det: Single-Query Paradigm and Attention Disentangled Learning for Flexible Object Detection