Skip to content


Sliced Inference on 4K Drone Imagery: Why Small Objects Need SAHI (a Simulation)


A synthetic, fully reproducible illustration of the core mechanism behind the AgriDrone Vision Evaluation Pipeline: when a 4K frame is resized to the 640-px input of a YOLO detector, a 30-px weed becomes a 5-px smudge. Slicing the frame into native-resolution tiles (SAHI) keeps the object at its real size — at the cost of one forward pass per tile.
Under a fixed detector, how much recall on small objects is lost to resizing alone, and how much of it does slicing recover?

AgriDrone Vision case study Blog: Small objects, big images


Step by step


Method

1) Scatter 150 objects with log-normal sizes (8–120 px) over a 3840×2160 frame. 2) Full-frame mode: scale every size by 640/3840 and sample a detection from the toy curve. 3) Sliced mode: same curve at native size; count the 640-px tiles with 20 % overlap that SAHI would produce. 4) Report recall by COCO-like size bins and the inference cost (number of forward passes).


IMAGE_W, IMAGE_H = 3840, 2160      # 4K frame
INPUT_SIZE = 640                   # detector input (longest side)
SLICE_SIZE, OVERLAP = 640, 0.2     # SAHI tiles

full_scale = INPUT_SIZE / max(IMAGE_W, IMAGE_H)       # 0.167: objects shrink 6x
p_full   = detection_probability(sizes * full_scale)   # whole frame, resized
p_sliced = detection_probability(sizes)                # tiles at native resolution
                    

The scene and the slicing grid

150 synthetic objects over a 3840×2160 frame, covered by 32 tiles of 640 px with 20 % overlap. Green: detected in both modes. Orange: recovered only by slicing. Red: missed in both.

Synthetic 4K frame with SAHI slicing grid

Detection probability by inference mode

Resizing multiplies every object size by 0.167 before the network sees it. The same toy detector, evaluated on the shrunken sizes, collapses for anything under ~60 px in the original frame; at native resolution it keeps most objects above 12 px.

Detection probability vs object size

Recall by object size and the cost of slicing

Overall recall in this simulation: 16.0 % full-frame vs 96.0 % sliced. The price: 33 forward passes per frame instead of 1 (tiles plus the full frame, which SAHI keeps for large objects).

Objects Recall full-frame (%) Recall sliced (%)
bin
< 16 px 18 11.1 66.7
16-32 px 76 10.5 100.0
32-64 px 52 21.2 100.0
> 64 px 4 75.0 100.0
All 150 16.0 96.0

Limits: The detector curve is an assumption, not a fit. Tile-border effects, NMS merging across overlapping tiles, false positives and the latency of 32+ passes per frame are deliberately left out; they are exactly what the real pipeline measures.


Show Code