Single-Shot vs Two-Stage vs Transformer Detectors: Why YOLO Wins on the Edge
Three families, one deployment constraint
Choosing an object detection model for a retail shelf is a choice between three architectures, and the deployment target — a low-power device in the store — is what decides it.
The three families
- Two-stage (Faster R-CNN style). Propose candidate regions, then classify each. A strong accuracy pedigree, well understood, but slow because it's two passes over the image.
- Transformer-based (DETR style). Attention-based, the newer research direction. Slow to train — follow-up work cites roughly 500 training epochs against 12 to 36 for a two-stage detector — and in its original form matched to two-stage speed, not single-shot speed.
- Single-shot (YOLO style). One forward pass, built for real-time inference.
The speed gap in numbers
An independent comparison found a single-shot detector running at roughly 73 FPS against a two-stage one at about 12 FPS — better than a 6x gap, driven by one pass versus two. A secondary GPU-latency benchmark put a current single-shot model at around 1.3ms against roughly 54ms for two-stage, directionally about 40x — cited from a non-peer-reviewed engineering comparison, not as a promise, but the direction is consistent.
Why the edge changes the answer
On a low-power accelerator in a store, you can't spend 50ms per image and keep up with a continuous photo stream across 150-plus locations. And transformer attention operations don't yet have the mature, optimised support on edge accelerators that convolutional single-shot architectures do. On our computer vision project that constraint ruled out more of the architecture than any accuracy number did.
Which single-shot variant
Not the largest. The server-class variant scores around 54 mAP but doesn't fit the edge inference budget. A mid-size variant gives enough accuracy for shelf-level product and gap detection while staying inside what the accelerator can sustain — and the current-generation mid-size model scores roughly 45 mAP against about 37 for the equivalent previous generation, a real gain at the same speed class.
The accuracy that actually matters
For shelf gap detection you don't need the top of the accuracy leaderboard. A gap is a large, high-contrast visual feature; a mid-size single-shot model at around 45 mAP clears that bar comfortably. The marginal accuracy of a server-class model buys you nothing you can act on while costing you the edge deployment entirely. And COCO mAP isn't your metric anyway — what matters is precision and recall on your classes, in your store conditions, measured on your evaluation set of real photos.
The eval set does the deciding
None of the architecture comparison matters more than measuring the candidates on your own data. Take a few hundred labelled shelf photos from your hardest stores — glare, odd angles, promo packaging — and run each candidate model against them. The one that gives you the precision and recall you need on gap detection, inside the edge inference budget, is the answer, regardless of where it sits on a public leaderboard.
When to revisit the choice
If the task expands from "gap or no gap" to "identify exactly which of 40 near-identical SKUs is on the shelf," the accuracy requirement jumps, and a mid-size single-shot model on the edge may not clear it. That's a different project — potentially a two-stage detector and cloud inference — and it's worth recognising as a scope change rather than trying to tune the edge model into a job it wasn't chosen for.
Where this stops being right
- Cloud inference on GPUs — a two-stage or transformer detector's accuracy edge may be worth the latency there; the edge constraint is what forces single-shot.
- A task needing fine-grained detection — reading a label, not spotting a gap — may need a two-stage detector and can't run on the edge.
- Benchmark multipliers vary wildly by hardware and model — treat them as directional, not as spec.
FAQ
Is YOLO the most accurate detector? No — two-stage detectors have the accuracy pedigree. Single-shot wins on speed, which is what edge inference needs.
Why not a transformer detector? Slow to train, and transformer attention isn't as optimised on edge accelerators as convolutional architectures. Newer ones are fast but target GPU servers.
Which variant should we use? A mid-size one. The largest is server-class and won't fit the edge inference budget.
Can we fine-tune the detector on our own shelf images? Yes, and you should — a detector fine-tuned on your SKUs and store conditions beats an off-the-shelf one on the metrics that matter. It needs less data than training from scratch: a few thousand labelled shelf images across varied stores is a realistic start, growing over time from the review queue's verdicts.
ISTRALLEN picks the detector for the deployment target — single-shot for edge shelf monitoring; see AI for Retail.