Detectors for tiny objects (aerial vehicles, pests in trap images, berries on a bush) run the same network on every part of the image. They shrink the image step by step inside the network, and then delete boxes that overlap too much with a higher-scoring box. Each of these habits fails in the same place: small objects packed tightly together. Shrinking merges two 10-pixel neighbours into one feature cell. The overlap rule deletes the second box. Meanwhile, the uniform network has spent most of its effort on empty sea or bare field. Recent work adds dynamic compute, but it sends compute to where objects are. We propose sending it to where the model is confused about how many objects there are.
The signal for that confusion is cheap and already available. A density head is a small output layer that predicts, at each pixel, how much "object mass" is there; summed over a region, it estimates the count. Box detectors and density maps fail differently in crowds. Density maps keep counting correctly when objects touch, while box detectors collapse touching objects into one box. So the mismatch between the density count and the number of boxes in a region marks local overlap ambiguity. We re-run only those regions at full resolution and decode them with an explicit count constraint, under a fixed per-image budget. In effect this is an anytime refinement detector: it can stop after any number of refinement steps and still return valid output, and every step goes to the region most likely to be miscounted.
Core Claim
At a matched compute budget, allocating high-resolution re-processing by count–detection discrepancy recovers more true positives in crowded tiny-object clusters than allocating it by object density or by detector uncertainty. Decoding each re-processed region under its estimated count removes the local reliance on the overlap-deletion step. For a region $r$ we define the discrepancy
$$a_r = \Big|\sum_{p \in r} \hat{D}(p) \;-\; \sum_{i:\, c_i \in r} s_i\Big|,$$
where $\hat{D}(p)$ is the predicted density at pixel $p$, $c_i$ and $s_i$ are the centre and confidence of detection $i$ after the base detector's normal post-processing, and the sum over $i$ is a soft count of detections in the region. A dense but well-separated cluster has a high density sum and a matching box count, so $a_r$ is low and it gets no extra compute. A pair of touching objects detected as one box has $a_r \approx 1$ and gets refined. That distinction separates this proposal from density-guided allocation.
Relation to Prior Work
The closest work is Dome-DETR. It predicts a density heatmap, prunes empty attention windows, scales the number of object queries with density (338.4 to 398.9 GFLOPs), and relaxes the overlap threshold in dense regions. It reaches 34.6 AP on AI-TOD-v2 and 39.0 AP on VisDrone. Dome-DETR motivates this proposal and is its main competitor, and we differ on three points. Its allocation signal is density, not ambiguity. Its active windows are processed at the backbone's existing resolution, so touching tiny objects stay merged in the features. And it still relies on box regression plus a dynamic overlap-deletion step. Its authors also report frame-to-frame latency swings; our fixed budget of $K$ refinement crops bounds latency by design.
Two papers supply the method. Spatially Adaptive Computation Time showed that learned per-location halting can match full-depth COCO detection (27.61 vs. 27.2 mAP) at 56% of the FLOPs. Its halting is learned implicitly through a cost penalty and was never tied to overlap or tested on tiny objects. We borrow its premise but use an explicit, interpretable trigger. We also refine whole crops as dense batched tensors, which avoids the irregular sparse execution that keeps per-pixel halting from producing real speedups. Small instance detection by integer programming on object density maps showed that reconstructing a density map with discrete instances under count constraints separates merged small objects without the overlap-deletion step (93.67% F1 on synthetic merged cells). However, it solved a hard combinatorial problem over the whole image using hand-crafted features. Restricting count-constrained decoding to a few small crops, each with a known target count, makes that idea tractable with deep features.
Three further papers constrain the design. Rethinking Object Detection in Retail Stores avoids overlap failure by predicting one box per group plus a count. That approach collapses for small items (23.6% $AP^{lc}_{SS}$), which suggests that group-level counting without restored resolution does not work. The normalized Wasserstein distance paper shows that box overlap scores fall apart for tiny objects: a 3-pixel shift drops the overlap of a 5×8 box from 0.54 to 0.14. Our refinement head therefore uses its Wasserstein-based label assignment rather than overlap-based assignment. MaskCount shows that naive tiling with lost boundary context nearly doubles counting error (MAE 3.63 vs. 6.36 in its ablation). Our crops therefore carry a context margin and are placed around clusters, not on a fixed grid. Finally, LIP and MSR-RCNN preserve fine detail during downsampling (for example, LIP raises COCO $AP_s$ from 21.9 to 24.0). Both do so uniformly over the whole image, which is the cost we aim to avoid.
Research Program
The system has three parts.
Stage one is any strong base detector with an added density head. The density head is trained on Gaussian blobs at annotated object centres, using a regression loss alongside the detection loss. From it we compute $a_r$ on a coarse grid of overlapping regions.
Stage two selects up to $K$ regions with the highest discrepancy. Each region is expanded by a context margin and re-encoded from the original pixels at native or 2× upsampled resolution. This uses a shared refinement encoder whose earliest layers do not shrink the image, so touching objects occupy separate feature cells.
Stage three decodes each crop under its count target $k_r$, the rounded density sum, recomputed on the refined crop. Decoding picks exactly $k_r$ instance centres from the refined heatmap, enforcing a minimum separation, and regresses a box for each. Because $k_r$ is small (typically under 20), the selection can be solved exactly as a small integer program or with greedy peak selection under the count constraint. Refined detections replace the base detections inside the crop.
The refinement encoder is trained on a mixture of crops: crops sampled at high-discrepancy regions of the base model's training-set predictions, and random crops, so that it does not learn only failure cases. Label assignment inside crops uses the normalized Wasserstein distance.
The analysis then asks three questions. Is $a_r$ a good predictor of local recall loss? We measure this by rank correlation between $a_r$ and the number of missed ground-truth objects per region. How does accuracy grow with $K$? We trace an accuracy-versus-compute curve. Where do the gains land? We stratify ground-truth objects by distance to their nearest neighbour, measured in units of object size.
Baselines
The naive reference point is the unmodified base detector. We use D-FINE, the baseline Dome-DETR builds on, as well as Dome-DETR itself. Both run with standard post-processing at native resolution. This shows how much is lost in crowded strata before any intervention.
The strongest existing method is Dome-DETR. Its reported result is 34.6 AP on AI-TOD-v2 for Dome-DETR-L, which is 3.3 AP over D-FINE, and 39.0 AP on VisDrone. It is the right competitor because it already combines density-guided compute, tiny-object focus, and density-aware overlap handling. We will run its released configuration and also attach our refinement stage on top of it. That gives a clean test of whether ambiguity-driven refinement adds anything beyond density-driven sparsification. Comparisons use the same training data, schedule, and input resolution, and report total GFLOPs and both 50th- and 99th-percentile latency. Beating it means a gain of at least 1 AP overall on AI-TOD-v2 at equal or lower mean GFLOPs, with the gain concentrated in the stratum of objects whose nearest neighbour is within one object width. If the overall AP gain is smaller but the crowded-stratum recall gain is large and the 99th-percentile latency is lower, we will report that as a narrower result, not a full win.
Uniform high-resolution processing is the accuracy ceiling. It runs the base detector on the whole image at 2× upsampling with context-aware tiling. Our method should approach its crowded-stratum recall at a fraction of its compute.
Three ablations isolate the key ingredient by holding the refinement stage fixed and changing only how the $K$ crops are chosen. Density-guided selection picks regions with the highest density sum, mirroring Dome-DETR's signal. Uncertainty-guided selection picks regions with the most medium-confidence detections. Random selection is the third. A fourth ablation keeps discrepancy-guided selection but decodes refined crops with ordinary overlap-deletion instead of the count constraint. This separates the gain from extra resolution from the gain from count-constrained decoding.
For counting-only data, DIOCblueberry has MaskCount's reported result. That is a 49.16% MAE reduction relative to LOCA and CounTR; the file gives no absolute headline MAE beyond the ablation value of 3.63. On Locount, the reference is CLCNet's 43.5% $AP^{lc}$ and its 23.6% $AP^{lc}_{SS}$ on small items.
Why not just…?
Why not just run everything at high resolution with tiles? This is a real accuracy competitor, and we include it as the ceiling. The argument against it is cost. Aerial and trap images are mostly background, and Dome-DETR shows that much of that background can be skipped without loss. Naive tiling also cuts clusters at tile edges, which MaskCount shows nearly doubles counting error. The accuracy-versus-compute curve settles this. If uniform 2× tiling dominates our curve at every budget, the proposal fails.
Why not just allocate by density, as Dome-DETR does? This is the most serious threat, because in many datasets density and ambiguity are correlated. Our hypothesis is that density wastes budget on dense but well-separated clusters, such as rows of parked cars, and misses sparse touching pairs. The density-guided selection ablation, run at identical $K$ and with identical refinement, tests this directly. If it matches discrepancy-guided selection, the novelty reduces to the refinement stage, and we will say so.
Why not just refine wherever the detector is uncertain? Confidence is a simpler signal, and it may work. However, a merged box over two touching objects is often confidently wrong: the merged blob looks like one clean object, so its confidence is high. Discrepancy catches that case and confidence does not. The uncertainty-guided ablation, plus a per-region analysis of high-confidence merged boxes, will show whether this failure mode is common enough to matter.
Why not just fix the overlap-deletion step with soft or dynamic thresholds? Overlap scores are unreliable at this scale, as the normalized Wasserstein distance paper shows. And if the backbone has already merged two objects into one feature cell, no post-processing step can recover the missing box. Dome-DETR's dynamic threshold is already part of the strongest baseline, so any gain we show over it is gain beyond threshold tuning.
Proposed Experiments
The primary benchmarks are AI-TOD-v2 and VisDrone, using AP and AP at the very-tiny and tiny size splits. We add a crowding-stratified recall that bins each ground-truth object by nearest-neighbour distance normalized by object size, along with GFLOPs and latency percentiles. The first decisive check is the selection ablation at $K \in \{4, 8, 16, 32\}$: discrepancy-guided selection must beat density-guided and uncertainty-guided selection on crowded-stratum recall at every $K$, not just one. The second is the diagnostic correlation between $a_r$ and per-region missed objects, which must clearly exceed the same correlation for density alone. The third tests transfer to stacked, touching instances. On Locount we evaluate whether count-constrained refinement lifts the small-item stratum above CLCNet's 23.6% $AP^{lc}_{SS}$. On DIOCblueberry we compare counting MAE and compute against MaskCount, using our total output count. A last check fixes $K$ per image and reports 99th-percentile latency against Dome-DETR, to confirm that bounded refinement removes the latency swings its authors report.
References
- Dome-DETR: DETR with Density-Oriented Feature-Query Manipulation for Efficient Tiny Object Detection
- Spatially Adaptive Computation Time for Residual Networks
- Small instance detection by integer programming on object density maps
- Rethinking Object Detection in Retail Stores
- Detecting tiny objects in aerial images: A normalized Wasserstein distance and a new benchmark
- Benchmarking Dense and Indiscernible Object Counting with Blueberries
- LIP: Local Importance-Based Pooling
- MSR-RCNN: A Multi-Class Crop Pest Detection Network Based on a Multi-Scale Super-Resolution Feature Enhancement Module