A grid divides an image into regular cells so a detector can make localized predictions. In a YOLO-style model, each cell predicts a bounding box, class information, and confidence; most cells usually contain no object. section 12.2.2
A 6 × 6 prediction grid
With grid_size = 6, the prediction head reshapes its output to (6, 6, num_labels + 5). Each cell stores five box values—x, y, width, height, and confidence—plus class predictions. A cell is responsible for an object whose center falls inside that cell. section 12.2.2 section 12.2.3
Grid coordinates use two representations. A normalized box is converted to a cell index and offsets within that cell; decoding reverses the operation to recover image-relative coordinates. Training targets place the class label and box at the responsible cell, while other locations receive zero confidence. section 12.2.3
When implementing a grid-based detector:
- Treat a simple grid as a teaching model: overlapping boxes, multiple boxes per cell, and larger output grids require further design. section 12.2.4
Figure 12.4 YOLO outputs as visualized in the first YOLO paper
Visualizes how YOLO associates image regions with box predictions and confidence scores. section 12.2.2







