Standard YOLO inference silently loses small objects when high-resolution drone images are downscaled to the model's input size. This post walks through how the AgriDrone Vision pipeline uses SAHI sliced inference and a COCO-based evaluation layer to make that trade-off measurable — and why the real deliverable is a georeferenced map, not a bounding box.
By admin on Aug, 11 2026
This post is based on the AgriDrone Vision Evaluation Pipeline case study — a sanitized, documentation-only release of a precision-agriculture computer vision system. No client data, real coordinates, or unpublished experimental results are included; examples are illustrative.
The failure nobody sees at 640 pixels
Agricultural drones capture beautiful data: 4K-and-above orthophotos where every plant in a field is visible. The objects you actually care about — seedlings, weeds, individual plants — often occupy only a few dozen pixels of that frame.
Here is the trap. YOLO-family detectors resize the input image to the model's working size, typically 640 pixels. Feed it a 3840×2160 drone frame and the image is downscaled roughly six-fold: an object that was 30 pixels wide is now about 5 pixels — below what the network's feature maps can meaningfully represent. Detections for small objects simply vanish.
What makes this failure dangerous is that it is silent. The standard training and validation loop evaluates on images processed the same way, so the metrics look reasonable. It is only when you evaluate at native field resolution that the gap between "validation mAP" and "what the agronomist sees on real imagery" becomes visible. That resolution-scaling effect, and the shift in object size distribution that comes with it, is precisely what this pipeline was built to expose.
Sliced inference with SAHI
SAHI (Slicing Aided Hyper Inference) attacks the problem by refusing to downscale. Instead of resizing the full frame, it:
- cuts the image into overlapping tiles at (or near) native resolution,
- runs the detector independently on each tile,
- projects the tile-level detections back into full-image coordinates, and
- merges duplicates in the overlap zones.
The small object never shrinks, so the detector sees it at the pixel density it was trained for. But nothing is free: inference cost multiplies with the number of tiles, objects cut by tile boundaries need careful merging, and the overlap ratio becomes one more hyperparameter to tune. Whether SAHI is worth it for a given crop, camera and flight altitude is an empirical question — which means you need an evaluation setup capable of answering it.
An evaluation layer that keeps the comparison honest
The core design decision in the pipeline is that direct YOLO inference and SAHI sliced inference are evaluated through exactly the same code path. Ground truth annotations and predictions from both modes are converted from YOLO format into COCO-compatible JSON, and metrics are computed with pycocotools:
- global AP@[.50:.95] and AP50, plus per-class metrics — because in agriculture the rare class is usually the one that matters;
- size-stratified AP (small / medium / large) — this is where the two inference strategies actually diverge, and the stratification is what turns "SAHI feels better" into a number;
- reports exported as JSON, CSV and plots, so every run is reproducible and comparable with the previous one.
It sounds obvious, but the alternative is common: comparing one model's validation numbers against another tool's console output, with different IoU thresholds and different ground truth handling. A shared evaluation contract is what turns two inference modes into one experiment.
From bounding boxes to maps
In precision agriculture, a bounding box is not the deliverable — a georeferenced map is. The pipeline extracts EXIF/GPS metadata from each frame, transforms coordinates with pyproj, and exports detections as GeoJSON, Shapefile and QGIS-compatible CSV. The end user never sees a tensor: they open a QGIS layer and see every detection positioned on the orthomosaic of their own field.
This last mile is easy to underestimate. It is also where a computer-vision exercise becomes an agronomic tool.
What it is — and what it isn't
The public case study is deliberately explicit about maturity: this is a research-grade batch pipeline, not a productionized MLOps platform. Orchestration is script-driven, modules are coupled through filesystem conventions, and automated test coverage is still pending. The documentation includes the roadmap to change that — a configuration layer, storage abstraction, formal orchestration — but does not claim it is already done.
I consider that honesty part of the engineering: knowing the precise boundary between "works reproducibly in research conditions" and "ready for unattended production" is itself a technical result.
Takeaways
- If your objects are small relative to the frame, your detector's input resizing is probably your biggest silent accuracy loss — measure it before buying a bigger model.
- Sliced inference trades compute for small-object recall; whether the trade is worth it is an empirical question per dataset.
- Comparisons are only as good as the evaluation contract: one ground truth, one metric implementation, one code path for every inference mode.
- Ship the output in the user's coordinate system — in agriculture, that means GIS formats, not JSON blobs.
The full architecture, methodology and limitations are documented in the public case study repository.
También disponible en español: Objetos pequeños, imágenes gigantes: evaluando YOLO y SAHI en imágenes de dron 4K.
Comments
No comments.