← CS Lab AI & Machine Learning / YOLO Grid Open standalone ↗

YOLO looks at the whole image once and predicts every box in a single pass — by laying an S×S grid over it and making each cell responsible for the objects centred inside it. Detection as one shot, not a search.

Where you meet it

What it does

It reframes detection as filling in a grid. Instead of asking "is there an object here?" at thousands of window positions, YOLO passes the image through one network that outputs, for every grid cell at once, a few candidate boxes and what class they would be.

YOLO turns "find the objects" into "fill in one fixed grid of numbers" — detection becomes a single tensor the network predicts in one go.

How it works

Split the image into an S×S grid. Each cell predicts B boxes; each box is five numbers — x, y (the box centre, measured inside the cell, 0 to 1), w, h (the size, measured against the whole image) and a confidence. On top, each cell predicts one set of class scores. The cell that owns an object is simply the one its centre falls into.

grid     = S × S                       # v1: 7 × 7
per cell → B boxes of (x, y, w, h, confidence)   # v1: B = 2
         + C class scores (one set per cell)      # v1: C = 20
output   = S × S × (B·5 + C)           # v1: 7 × 7 × 30, in one pass
# confidence = P(object) × IoU(predicted box, true box)

So "confidence" isn't just "is something here" — it is meant to equal how sure the cell is that a box holds an object, times how well that box fits. During training only the responsible cell (and its best-fitting box) is taught to fire for that object; every other cell learns to say "nothing here".

Watch out

  • One cell, few boxes, one class. In the original YOLO a cell predicts just two boxes and a single class, so objects whose centres share a cell — small things in groups, a flock of birds — get lost. The grid is a bottleneck.
  • The single "responsible cell" is a training rule, not what you see at test time. At inference several cells and boxes still fire around one object, so you still run NMS afterwards to keep one box.
  • Mind which coordinates are which: x, y live inside the cell (0–1), but w, h are fractions of the whole image. Decode them against the wrong reference and every box lands at the wrong place or size.

One glance, one grid, one pass — detection as a single prediction instead of a thousand little searches.

Go deeper

YOLO schaut das ganze Bild nur einmal an und sagt alle Boxen in einem Durchlauf vorher — indem es ein S×S-Gitter darüberlegt und jede Zelle für die Objekte zuständig macht, deren Zentrum in ihr liegt. Erkennung als ein Schuss, nicht als Suche.

Wo es vorkommt

Was es tut

Es formuliert Erkennung um zum Ausfüllen eines Gitters. Statt an tausenden Fensterpositionen „ist hier ein Objekt?" zu fragen, schickt YOLO das Bild durch ein Netz, das für jede Gitterzelle auf einmal ein paar Kandidaten-Boxen und deren Klasse ausgibt.

YOLO macht aus „finde die Objekte" ein „fülle ein festes Zahlengitter aus" — Erkennung wird zu einem einzigen Tensor, den das Netz in einem Rutsch vorhersagt.

Wie es funktioniert

Das Bild in ein S×S-Gitter teilen. Jede Zelle sagt B Boxen vorher; jede Box sind fünf Zahlen — x, y (das Box-Zentrum, gemessen innerhalb der Zelle, 0 bis 1), b, h (die Größe, gemessen am ganzen Bild) und eine Konfidenz. Dazu sagt jede Zelle einen Satz Klassen-Scores vorher. Die zuständige Zelle ist einfach die, in die das Zentrum fällt.

Gitter    = S × S                       # v1: 7 × 7
je Zelle  → B Boxen aus (x, y, b, h, Konfidenz)   # v1: B = 2
          + C Klassen-Scores (ein Satz pro Zelle)  # v1: C = 20
Ausgabe   = S × S × (B·5 + C)           # v1: 7 × 7 × 30, in einem Durchlauf
# Konfidenz = P(Objekt) × IoU(vorhergesagte Box, echte Box)

„Konfidenz" heißt also nicht bloß „ist hier etwas" — sie soll dem entsprechen, wie sicher die Zelle ist, dass eine Box ein Objekt enthält, mal wie gut die Box passt. Beim Training lernt nur die zuständige Zelle (und ihre am besten passende Box), für dieses Objekt anzuschlagen; jede andere Zelle lernt „hier nichts".

Worauf achten

  • Eine Zelle, wenige Boxen, eine Klasse. Im ursprünglichen YOLO sagt eine Zelle nur zwei Boxen und eine einzige Klasse vorher — Objekte, deren Zentren sich eine Zelle teilen (kleine Dinge in Gruppen, ein Vogelschwarm), gehen verloren. Das Gitter ist ein Nadelöhr.
  • Die eine „zuständige Zelle" ist eine Trainingsregel, nicht das, was du zur Testzeit siehst. Bei der Inferenz feuern mehrere Zellen und Boxen um ein Objekt herum, du lässt danach also trotzdem NMS laufen, um eine Box zu behalten.
  • Achte darauf, welche Koordinate welche ist: x, y liegen innerhalb der Zelle (0–1), aber b, h sind Bruchteile des ganzen Bildes. Dekodierst du sie gegen die falsche Bezugsgröße, landet jede Box an der falschen Stelle oder in der falschen Größe.

Ein Blick, ein Gitter, ein Durchlauf — Erkennung als eine einzige Vorhersage statt tausend kleiner Suchen.

Mehr dazu

Next up
AI & Machine LearningViola-Jones Detector AI & Machine LearningKLT Tracking All concepts →