Detectors that find very small objects need to look at the image at full resolution, but on small devices full resolution does not fit in memory. The problem is not the weights. It is the intermediate feature maps, the temporary arrays each layer produces, which are largest in the first layers where the image has not yet been shrunk. Two families of work attack pieces of this. Systems work overwrites a layer's input with its output inside one shared buffer once input pixels are no longer needed. Detection work preserves fine spatial detail so that an 18-pixel person or an 8×8-pixel drone is not averaged into the background. They collide at one structural point. Tiny-object detectors rely on "skip" or "lateral" connections that carry the high-resolution early feature map forward until coarse, deep features come back down to meet it. That early map must stay alive through the entire network, and the in-place literature names exactly this pattern as the thing that breaks buffer overwriting.
We propose to remove the collision by reversing the order of computation. First, a cheap pass over a downsampled copy of the image computes the coarse "context" features that the high-resolution branch would normally wait for. Then the full-resolution image is streamed through the early layers row by row, overwriting each buffer in place as rows go stale. The precomputed context is added to each finished row, a small head emits detections for that band of the image, and the row is discarded. The full-resolution feature map is never stored whole. Peak memory becomes the small context map plus a few rows per layer. The research question is whether context computed from a downsampled image is good enough, at equal peak memory, to beat every simpler way of fitting a tiny-object detector onto a constrained device.
Core Claim
In a standard feature-pyramid detector, the high-resolution level must be kept alive for as long as the network is deep. We call this an unbounded-lag dependency. Ordinary residual blocks inside the early layers, by contrast, only need their input delayed by the few rows the block's receptive field spans, a bounded-lag dependency. Under row-streaming execution, bounded-lag skips cost only a short delay line of rows. The unbounded-lag lateral connection can then be turned into an element-wise addition of a precomputed tensor. Element-wise operations are exactly the case where full in-place sharing is known to work. The claim is that this reordering lets a detector run at several times higher input resolution under a fixed memory budget than patch-based or overwriting schedules applied to a conventional detector, and that the gain in small-object accuracy outweighs the loss from using coarse-image context.
For a stream of $L$ early layers, peak activation memory is approximately
$$ M_{\text{peak}} \approx |C| + \sum_{l=1}^{L} (K_l + s_l - 1)\, W_l\, D_l\, b , $$
where $|C|$ is the size in bytes of the context map, $K_l$ is layer $l$'s kernel height, $s_l$ its vertical stride, $W_l$ and $D_l$ the width and channel count of its input, and $b$ the bytes per value. The form follows from the safe-offset argument: a row can be overwritten once the trailing edge of the kernel has passed it, so each layer holds only $K_l + s_l - 1$ live rows. Residual delay lines add a term of the same form. The key property is that memory grows linearly in image width and does not depend on image height.
Relation to Prior Work
Our mechanism reuses three lines of in-place and scheduling work.
Improving Memory Utilization in Convolutional Neural Network Accelerators derives the minimum distance a write pointer must trail a read pointer so that a sliding-window convolution can overwrite its own input. It reports 19.6% to 48.8% activation savings on fixed networks. It also states that residual connections force parallel buffers. We reuse its offset rule and show that under row streaming the residual cost shrinks to a bounded delay line.
Memory-Optimal Direct Convolutions for Maximizing Classification Accuracy in Embedded Applications pushes traversal order to the memory minimum. It needs only 434.5 bytes on MNIST, but inference takes 684 ms. That result constrains us: exotic traversal orders are too slow for detection, so we restrict ourselves to plain raster order.
In-Place Activated BatchNorm for Memory-Optimized Training of DNNs shows that one-to-one operations can fully share a buffer, and that the saved memory buys larger crops and better segmentation. We use the same one-to-one sharing at inference time for the context fusion step.
The closest scheduling work, and the motivation for this proposal, is Memory-efficient Patch-based Inference for Tiny Deep Learning (MCUNetV2). It runs the memory-heavy early layers patch by patch, cuts peak SRAM by 4 to 8×, and shows that higher input resolution raises microcontroller detection mAP on Pascal VOC by 16.9%. That is strong evidence that resolution is what memory buys. However, its patch stage ends by writing out a whole downsampled map, and its detector heads are conventional. A high-resolution pyramid level would still have to be stored in full. It also pays for overlapping patch borders with recomputation. Row streaming at full width has no border overlap in the horizontal direction. More importantly, the reordering addresses the pyramid dependency, which MCUNetV2 does not.
On the resolution side, two groups of papers motivate the need for fine detail and supply the evaluation.
Scale Match for Tiny Person Detection and Detecting tiny objects in aerial images: A normalized Wasserstein distance and a new benchmark show how fragile objects under 20 pixels are. The first finds that features change character below that size. The second finds that a few pixels of shift destroy overlap-based label assignment. We adopt the latter's distance-based assignment in all our detectors, so that gains cannot be attributed to label assignment.
Content-Adaptive Downsampling in Convolutional Neural Networks, DPNet: Dynamic Pooling Network for Accurate and Efficient Size-Aware Tiny Object Detection and LIP: Local Importance-Based Pooling keep resolution where it matters, in order to save computation. All three count multiply-adds and assume a standard memory allocator. We target peak memory instead, and our streaming schedule could run under any of them.
Global-Local MAV Detection under Challenging Conditions based on Appearance and Motion (GLAD) is the closest in spirit: a coarse global pass followed by high-resolution local inspection. It runs two separate detectors and crops a 300×300 window. We instead share one network in which coarse context conditions every full-resolution row. The deconvolution-based magnifiers, Single Shot Multibox Detector With Deconvolutional Region Magnification Procedure and MSR-RCNN, enlarge features and so move in the opposite direction on memory. We treat them only as accuracy references.
Research Program
The work has three parts.
The first part is a memory model and compiler pass. It takes a detector graph and classifies every skip connection as bounded-lag or unbounded-lag. It then computes the row delay each bounded skip needs and applies the Jokic et al. safe offset to every convolution in the streamed stem. Finally, it emits a static schedule with an exact peak-memory figure. We validate the figure against measured allocation on device.
The second part is the context-first detector. A small backbone runs on the image downsampled by a factor $r$ from 2 to 8. It produces a stride-32-equivalent context tensor, whose size is the $|C|$ term in the equation above. A full-resolution stem of stride 8 (or stride 4 for AI-TOD-v2, whose mean object size is 12.7 px) streams rows. At each stride-8 output row, the matching upsampled context row is added in place. A lightweight head then decodes boxes for that band. The whole network is trained jointly. Streaming is an exact reordering of the same computation, apart from boundary handling that we make identical in training.
The third part is an optional content-adaptive skip. The context pass predicts a coarse objectness map, and stream bands with no plausible objects are skipped. This saves time, not memory, and is kept as a separable addition so that the main claim does not depend on it.
Baselines
The naive reference point is a conventional detector of the same family, trained with the same label assignment, whose input is downsampled until its double-buffered peak memory fits the budget. This is what a practitioner does by default. Beating it shows only that resolution matters under the budget, which MCUNetV2 already suggests. It fixes the floor.
The second baseline applies the Jokic et al. pointer offsets to that same conventional detector (Improving Memory Utilization in Convolutional Neural Network Accelerators). The input resolution is raised as far as the freed memory allows, with pyramid laterals held in separate buffers as that paper requires. This isolates what in-place overwriting alone buys without the reordering.
The strongest existing method is MCUNetV2-style patch inference (Memory-efficient Patch-based Inference for Tiny Deep Learning). We reimplement it on the same detector, re-searching the patch stage to fit each budget, with the input resolution set to the largest that fits. Its published detection gain is relative ("16.9% higher mAP on Pascal VOC"). No reported result was found on Lacuna for MCUNetV2 on TinyPerson or AI-TOD-v2, so we will produce that number ourselves under identical training.
The third competitor is tile-based inference. The image is cut into overlapping tiles, each run through the conventional detector. This is the common practical choice for tiny objects and has no global context at all.
All methods share the same backbone family, NWD-based assignment, training schedule, augmentation, and a matched hyperparameter search budget. They are compared at the same peak memory budgets and the same target hardware.
Unconstrained accuracy references frame how far below full-scale detectors we sit. On TinyPerson, Monotone Scale Match reports $AP_{50}$ = 47.29% (Scale Match for Tiny Person Detection). On AI-TOD-v2, DetectoRS with NWD-RKA reports 24.7 AP (Detecting tiny objects in aerial images). We do not expect a microcontroller-scale model to match these.
Beating the strongest competitor means higher $AP_{50}$ on TinyPerson and higher AP on AI-TOD-v2 than patch-based inference at two or more matched memory budgets, with latency within 1.5× of it.
Four ablations isolate the key ingredient:
- Stream-only: removes the context pass entirely.
- Oracle context: replaces coarse-image context with context from a full-resolution backbone that is allowed to exceed the budget. The gap measures what coarse context costs.
- Double-buffered stream: removes in-place overwriting inside the stream.
- Stored laterals: keeps the conventional lateral order but streams the stem.
Why not just…?
Why not just use MCUNetV2's patch-based inference with a standard pyramid detector? This is the real threat. Patch inference already turns high resolution into a small memory footprint. Our argument is structural. A detector that needs a stride-4 or stride-8 pyramid level for 12–18 px objects must eventually hold that level whole, or tile the heads as well, which loses context. The comparison at matched budgets settles it. If patch inference matches our AP at every budget, the reordering is unnecessary, and we will report it that way.
Why not just tile the image and run a standard detector on each tile? Tiling bounds memory by tile size and is trivially implemented. It gives up global context and repeats computation on overlaps. GLAD's local search raised appearance recall from 0.17 to 0.51 only when guided by a global stage (Global-Local MAV Detection under Challenging Conditions based on Appearance and Motion). That suggests context matters, but it does not prove it for our datasets. The stream-only ablation is essentially tiling by rows. If it matches the full method, context is not pulling its weight.
Why not just shrink the input, or apply in-place overwriting to an ordinary detector? Shrinking destroys objects near 20 px, as Scale Match's analysis of the sub-20-pixel regime shows (Scale Match for Tiny Person Detection). Plain in-place overwriting stalls at the lateral connections that Jokic et al. identify as its failure point. Both are included as baselines. The Jokic-on-conventional comparison directly measures how much of our gain comes from overwriting versus from reordering.
Proposed Experiments
The primary benchmarks are TinyPerson (mean object height 18 px) and AI-TOD-v2 (mean object size 12.7 px), with VisDrone as a denser secondary set. On VisDrone, the challenge's Cascade R-CNN baseline reports 16.09% AP and the top ensemble 29.62% AP (VisDrone-DET2019). We reuse the MMDetection-based tooling in ucas-vg/PointTinyBenchmark for TinyPerson data handling and Scale Match pretraining.
Memory budgets are 256 kB and 512 kB, on a microcontroller-class target and in a cycle-accurate allocator simulation. We also run a looser embedded-GPU budget so the results can be compared with GLAD-style systems. The metrics are:
- $AP_{50}$ and AP on the standard splits;
- AP split by object size;
- measured and predicted peak memory;
- latency and energy per frame.
The first decisive check is the accuracy-versus-peak-memory curve. Our method should dominate all baselines at the low-memory end, and its advantage should shrink as the budget grows, because under generous memory the conventional pyramid fits. If there is no crossover at all, the result is suspicious.
The second check is the coarse-versus-oracle context gap as a function of the downsampling factor $r$. If context computed from a 4×-downsampled image loses more than a third of the oracle's advantage over stream-only, the central premise fails. That would point toward a learned compression of full-resolution features instead.
The third check is whether the memory model predicts measured peak memory within a few percent across architectures with residual stems. That would confirm that bounded-lag skips really cost only delay-line rows.
References
- Improving Memory Utilization in Convolutional Neural Network Accelerators
- Memory-Optimal Direct Convolutions for Maximizing Classification Accuracy in Embedded Applications
- In-Place Activated BatchNorm for Memory-Optimized Training of DNNs
- Memory-efficient Patch-based Inference for Tiny Deep Learning
- Scale Match for Tiny Person Detection
- Detecting tiny objects in aerial images: A normalized Wasserstein distance and a new benchmark
- Content-Adaptive Downsampling in Convolutional Neural Networks
- DPNet: Dynamic Pooling Network for Accurate and Efficient Size-Aware Tiny Object Detection
- LIP: Local Importance-Based Pooling
- Global-Local MAV Detection Under Challenging Conditions Based on Appearance and Motion
- Single Shot Multibox Detector With Deconvolutional Region Magnification Procedure
- MSR-RCNN: A Multi-Class Crop Pest Detection Network Based on a Multi-Scale Super-Resolution Feature Enhancement Module
- VisDrone-DET2019: The Vision Meets Drone Object Detection in Image Challenge Results