From one label to many boxes

In the earlier parts of this path you built and fine-tuned classifiers: a network looks at an image and outputs one label, such as 'cat' or 'golden retriever'. Object detection asks a harder question: given an image, find every object of interest, say where it is, and say what it is. The output is no longer a single label but a variable-length list of (box, class, confidence) triples. A photo of an empty road might have zero objects to report; a photo of a busy street might have forty.

This variability is what makes detection genuinely harder than classification, not just a bigger version of the same problem. A classifier always produces a fixed-size output: one score per class. A detector has to produce an unknown number of boxes, each with its own location, size and label, from a single forward pass through a network that has a fixed architecture. Three ideas dominate how the field has solved this: propose candidate regions and classify them (the two-stage family), predict boxes directly from a dense grid using anchors (YOLO and its relatives), or treat detection as predicting a fixed-size set of objects directly (DETR). This article builds up all three, with the anchor idea as the hinge between them.

Bounding boxes and IoU

Before anything else, you need a shared language for 'where'. A bounding box is almost always described by four numbers. Two common conventions are (x, y, width, height), where (x, y) is the top-left corner, and (x1, y1, x2, y2), the top-left and bottom-right corners. Both describe the same rectangle; which one a given model uses is just a convention, and code that mixes them up silently is a classic source of bugs, so it is worth checking which one a library expects before you feed it coordinates.

To say how good a predicted box is, detection uses Intersection over Union, IoU. Take the predicted box and the true box, compute the area where they overlap (the intersection), and divide by the area covered by either box (the union). An IoU of 1.0 means a perfect match; an IoU of 0.0 means the boxes do not touch at all.

Here is a worked example. Suppose the ground-truth box for a dog is (x1=10, y1=10, x2=50, y2=50), a 40 by 40 square with area 1600. A model predicts (x1=30, y1=30, x2=70, y2=70), also 40 by 40, area 1600, but shifted down and to the right. The overlapping region runs from x=30 to x=50 and y=30 to y=50, a 20 by 20 square, area 400. The union is the sum of the two areas minus the overlap counted twice: 1600 + 1600 - 400 = 2800. IoU is 400 / 2800, about 0.14. That is a poor match even though the two boxes are the same size and clearly refer to the same rough area of the image; detection pipelines usually require an IoU of 0.5 or higher before they count a prediction as correct for a given object.

🐍Python
def iou(box_a, box_b):
    # boxes are (x1, y1, x2, y2)
    ax1, ay1, ax2, ay2 = box_a
    bx1, by1, bx2, by2 = box_b

    inter_x1 = max(ax1, bx1)
    inter_y1 = max(ay1, by1)
    inter_x2 = min(ax2, bx2)
    inter_y2 = min(ay2, by2)

    inter_w = max(0, inter_x2 - inter_x1)
    inter_h = max(0, inter_y2 - inter_y1)
    inter_area = inter_w * inter_h

    area_a = (ax2 - ax1) * (ay2 - ay1)
    area_b = (bx2 - bx1) * (by2 - by1)
    union_area = area_a + area_b - inter_area

    return inter_area / union_area if union_area > 0 else 0.0


ground_truth = (10, 10, 50, 50)
prediction = (30, 30, 70, 70)
print(round(iou(ground_truth, prediction), 3))  # 0.143

This runs with no dependencies beyond the Python standard library. The function clips the overlap to zero if the boxes do not intersect at all (the max(0, ...) guards against a negative width or height), then applies the area formula directly. Every detector you will meet below, whether anchor-based or not, is ultimately graded with this same quantity.

A quick look at two-stage detectors

Before anchors became the default, the first strong deep-learning detectors worked in two stages. R-CNN and its successors first generate a list of candidate regions that might contain an object (originally using a separate, non-learned algorithm to propose a few thousand boxes), then run a CNN classifier, of the kind you built in earlier parts of this path, on each cropped region to decide what, if anything, it contains. This works, but running a full classifier on thousands of crops per image is slow, and the proposal stage is a bottleneck that is not learned jointly with the rest of the network.

Faster R-CNN closed that gap by replacing the hand-built proposal step with a small learned network, the Region Proposal Network, that slides over the feature map produced by a CNN backbone (the same kind of ResNet-style backbone from part 4 of this path, often reused via transfer learning as in part 6) and predicts, at every location, whether something object-like is there and roughly what box it occupies. To make that prediction tractable, the Region Proposal Network does not try to guess box coordinates from nothing. It compares a small set of predefined reference boxes, anchors, against the ground truth, and this is the idea that then spread into single-stage detectors like YOLO. The rest of this article is built around that idea.

Anchors: giving the network a starting guess

Imagine you are standing at one point on a feature map, say the cell at row 7, column 9 of a 13 by 13 grid, and you have to predict a bounding box for whatever object is centered near there. You have no idea in advance whether that object is a tall pedestrian, a wide bus, or a small traffic sign. Asking the network to predict four absolute numbers (x, y, width, height) from scratch, with no prior assumption, turns out to be a hard regression problem: the range of plausible widths and heights at any one location is huge, and small mistakes early in training can send the regression wildly off course.

The core trick

Anchors sidestep this by giving the network a menu of reference boxes at every location, each with a fixed scale and aspect ratio, for example a small square, a medium square, a wide rectangle and a tall rectangle. Instead of predicting a box from nothing, the network predicts, for each anchor, two much easier things: a classification score (does this anchor contain an object, and if so, which class) and a small correction (how should this anchor be nudged and resized to better fit the true object). Predicting a correction to something that already looks roughly right is a far easier learning problem than predicting absolute coordinates, in the same way that it is easier to say 'move two steps left' than to say the exact coordinates of your destination from memory.

A typical setup uses a handful of scales (say, boxes with areas corresponding to 32, 64 and 128 pixels on a side) crossed with a handful of aspect ratios (say, 1:1, 1:2 and 2:1), giving 3 times 3 equals 9 anchors at every single spatial location of the feature map. On a 13 by 13 feature map that is 13 times 13 times 9, 1521 candidate boxes, from a single map; real detectors often repeat this at several feature map resolutions (a feature pyramid) so that small objects are covered by anchors on a finer, higher-resolution map and large objects by anchors on a coarser one. The total number of anchors examined per image is easily in the tens of thousands, almost all of which will contain no object at all.

Matching anchors to ground truth

During training, every anchor needs a target: is this a positive example of some class, a negative example (background), or should it be ignored because it is ambiguous? The usual rule uses IoU with the ground-truth boxes. If an anchor overlaps a ground-truth box with IoU above a high threshold, for instance 0.7, it is labelled positive for that object's class. If its IoU with every ground-truth box is below a low threshold, for instance 0.3, it is labelled negative, meaning background. Anchors that fall in between are usually ignored during training, because they are neither clearly right nor clearly wrong, and forcing a hard decision on them tends to confuse the network.

This matching step is where the overwhelming imbalance of detection becomes visible: out of tens of thousands of anchors, usually only a few dozen end up positive. The rest are either negative (the majority) or ignored. Left unaddressed, this imbalance would let the loss be dominated by trivial background predictions. Different detectors handle it differently, for example by subsampling the negatives so the classification loss is computed on a more balanced mix, or by reweighting hard examples so that confidently-correct background predictions contribute little to the loss (an idea often described through a technique called focal loss, which you may encounter if you read detector papers, though we will not derive it here).

What the network actually predicts

For a positive anchor, the network does not predict the ground-truth box's coordinates directly. It predicts four small numbers, usually called (tx, ty, tw, th), that describe how to transform the anchor into the ground-truth box. A common parameterisation is: tx and ty describe how far the box center should move, as a fraction of the anchor's width and height; tw and th describe how much the box should be scaled, in log space. Suppose an anchor is centered at (100, 100) with width 64 and height 64, and the matched ground-truth box is centered at (108, 92) with width 80 and height 50. The center offset target is tx = (108 - 100) / 64 = 0.125 and ty = (92 - 100) / 64 = -0.125. The scale target is tw = log(80 / 64) ≈ 0.22 and th = log(50 / 64) ≈ -0.25. The network is trained to output numbers close to these targets, using a regression loss such as smooth L1, computed only over the positive anchors. Using log space for width and height keeps the targets small and symmetric whether the true box is bigger or smaller than the anchor, which in practice makes the regression easier to learn than predicting raw pixel differences.

Put together, anchors turn 'find an unknown number of objects anywhere in the image, of unknown size' into 'for each of a large, fixed set of candidate boxes, decide object-or-not and refine the box a little'. That reformulation is what let both two-stage detectors and, as you will see next, single-shot detectors like YOLO train with ordinary classification and regression losses.

YOLO: anchors in a single pass

YOLO stands for 'You Only Look Once', and the name describes the design goal directly: instead of a separate proposal stage followed by classification, run the image through one network, once, and read predictions straight off its output. The family has gone through several versions over the years, with changes to the backbone, the exact number of detection scales, and whether anchors are used at all; we will not try to track every version's exact architecture here, since the details differ release to release and some of that detail is genuinely contested or in flux. What stays constant across the family, and what matters for understanding the idea, is the grid-based formulation.

The grid idea

Picture the input image overlaid with a grid, say 13 by 13 cells. Each cell is 'responsible' for detecting any object whose center falls inside it. For each cell, and for each anchor box assigned to that cell, the network predicts: the box's position and size (as offsets from the anchor, exactly as described above), a confidence score for whether an object is present, and a set of class probabilities for what that object is, if present. All of this comes from a single convolutional feature map; there is no cropping or re-running the network on sub-images.

Concretely, suppose the grid is 13 by 13, there are 3 anchors per cell, and the dataset has 20 classes. Each cell, for each anchor, needs to output 4 numbers for the box, 1 confidence score, and 20 class scores, so 25 numbers per anchor, 75 per cell, and 13 times 13 times 75 equals 12675 numbers for the whole image, all produced in one forward pass by a convolutional layer whose output channels are arranged to represent exactly this structure. Compare that to a two-stage detector, which first has to decide where to even look before it can classify anything; YOLO's single dense grid does both at once, which is a large part of why it runs fast enough for real-time use.

Confidence scores

The confidence output is trained to approximate the probability that an object is present in that box, multiplied by how good the box's overlap with the true object is, that is, confidence ≈ P(object) × IoU(predicted box, true box). This single number does two jobs at once: it tells you whether to trust the detection at all, and it gives a rough sense of localisation quality. At inference time, the system discards any box whose confidence falls below a chosen threshold, say 0.25, before even considering it a candidate detection. This is a tunable choice: a low threshold reports more objects but also more false positives, and a high threshold is stricter but risks missing faint or partially occluded objects.

From a grid of boxes to a final list: non-max suppression

A grid with multiple anchors per cell will typically produce several overlapping boxes for the same physical object: neighbouring cells near the object's edge, and different anchors in the same cell, can all fire with reasonably high confidence. Reporting all of them would mean counting one dog three or four times. Non-max suppression, NMS, is the standard post-processing step that cleans this up.

The algorithm, for a single class, is: sort all remaining boxes by confidence, from highest to lowest. Take the highest-confidence box, keep it as a final detection, and remove it from the list. Compare it against every remaining box; any box whose IoU with it exceeds a threshold (commonly 0.5) is considered 'the same object' and is discarded. Repeat with the next highest-confidence box among those that remain, until no boxes are left.

Here is a small worked example. Suppose after thresholding by confidence we have three boxes left for the 'dog' class: box A, confidence 0.90, covering roughly the dog's body; box B, confidence 0.85, almost identical to A, IoU with A of 0.8; and box C, confidence 0.40, covering a second, separate dog elsewhere in the image, IoU with A of 0.0. NMS sorts them as A, B, C. It keeps A. It checks B against A: IoU 0.8 exceeds the 0.5 threshold, so B is discarded as a duplicate of A. It checks C against A: IoU 0.0, well below threshold, so C survives. The final output is two boxes, A and C, one per actual dog, even though the raw network produced three candidates.

🐍Python
def non_max_suppression(boxes, scores, iou_threshold=0.5):
    # boxes: list of (x1, y1, x2, y2); scores: matching list of confidences
    order = sorted(range(len(boxes)), key=lambda i: scores[i], reverse=True)
    keep = []

    while order:
        current = order.pop(0)
        keep.append(current)
        order = [i for i in order if iou(boxes[current], boxes[i]) <= iou_threshold]

    return keep


boxes = [(10, 10, 60, 60), (12, 12, 62, 62), (200, 200, 240, 240)]
scores = [0.90, 0.85, 0.40]
kept_indices = non_max_suppression(boxes, scores, iou_threshold=0.5)
print(kept_indices)  # [0, 2]

This reuses the iou function defined earlier. It prints [0, 2], meaning it keeps the first box (index 0, the highest-confidence box) and the third box (index 2, the separate dog), discarding index 1 as a duplicate of index 0. This is a simplified, single-class version; in practice NMS is run separately per class, since two overlapping boxes of different classes, say a person standing in front of a car, should both be kept.

Where anchors and NMS start to hurt

Both the anchor mechanism and NMS are effective, battle-tested engineering, but they come with real costs that are worth naming, because they motivate the next idea.

  • Anchor shapes are hyperparameters. The number of scales, aspect ratios and feature map levels all have to be chosen, and a poor choice (anchors that do not match the typical object sizes in your dataset) can hurt accuracy before training even starts. YOLOv2 addressed this partly by running k-means clustering on the ground-truth box dimensions of the training set to pick data-driven anchor sizes rather than guessing them by hand.
  • The positive-negative imbalance (a handful of positive anchors among tens of thousands of candidates) requires careful loss weighting or sampling, adding another layer of tuning.
  • NMS is a hand-written, non-differentiable post-processing step, not something the network learns end to end. Its fixed IoU threshold can be wrong in either direction: too low and it merges genuinely separate, overlapping objects (a known failure mode in crowded scenes, for instance several people standing close together); too high and it leaves duplicate boxes for the same object.
  • Because each anchor is evaluated independently, the network has no direct mechanism to notice 'I have already reported an object near here' while scanning other anchors; duplicate suppression is bolted on afterwards rather than learned.

These costs do not make anchor-based detection a bad choice, and YOLO-style detectors remain a strong, fast, practical default, which is exactly why part 13 of this path has you train one. But they do explain why researchers asked whether detection could be formulated without anchors and without NMS at all.

DETR: detection as predicting a set

DETR, short for Detection Transformer, reframes object detection as a direct set-prediction problem: given an image, predict a fixed-size set of (box, class) pairs, where some of those pairs are explicitly allowed to say 'no object here'. There are no anchors, no grid of candidate boxes, and no NMS step at the end. Part 9 of this path covers Vision Transformers and self-attention in full; here we only need the minimum needed to see why DETR's design removes anchors and NMS, so the explanation of attention below is intentionally light and will be revisited properly later.

The pipeline, at a glance

DETR starts with an ordinary CNN backbone, of the kind covered in part 4, that turns the image into a grid of feature vectors, much like the feature maps you have already seen feeding into classifiers and into YOLO's grid. Those feature vectors are flattened into a sequence and passed through a transformer encoder. In short, a transformer encoder lets every position in that sequence exchange information with every other position through an attention mechanism, so that, for example, a feature vector near a car's wheel can be informed by what is happening near the car's windshield, even though they are far apart in the grid. The result is a sequence of feature vectors that each carry some global context about the whole image, not just their local neighbourhood.

A transformer decoder then takes over, using a fixed, small number of learned input vectors called object queries, for example 100 of them, the number used in the original DETR paper. Each object query attends over the encoded image features and, through further processing, is turned into exactly one prediction: a class label (possibly the special label 'no object') and a bounding box. With 100 queries and, say, 7 actual objects in the image, the network is expected to have 93 queries predict 'no object' and 7 queries each predict one real object with its box. Crucially, this happens directly, in one pass, with no proposal stage and no dense grid of anchors to filter down.

The matching problem this creates

This design immediately raises a training question that anchor-based detectors never have to face: which of the 100 queries should be trained to predict which ground-truth object? There is no spatial rule like 'the cell containing the object's center is responsible', because queries are not tied to any grid location; they are abstract slots. If query 17 happens to predict a box close to the true dog, and query 42 predicts a box close to the true cat, we want to train query 17 against the dog's label and box, and query 42 against the cat's, but this assignment is not known in advance; it has to be found fresh for every single training image, since the queries do not specialise to fixed positions the way anchors do.

DETR solves this with bipartite matching: for each training image, build a cost matrix between the N predictions (one per query, N=100 in the example above) and the M ground-truth objects (here, padded conceptually with 'no object' entries so the matrix is square), where the cost of matching a given prediction to a given ground truth combines how wrong the predicted class is and how far off the predicted box is. The Hungarian algorithm then finds the one-to-one assignment between predictions and ground truths that minimises the total cost. Only after this optimal assignment is found does ordinary supervised training proceed: each matched pair contributes a classification loss and a box regression loss, and every unmatched query is trained to predict 'no object'.

A small illustration makes the idea concrete, even though real cost values come from learned class probabilities and box coordinates rather than a toy number. Suppose there are 3 queries and 2 ground-truth objects (a dog and a cat), and the cost matrix, lower is better, looks like this: query 1 against dog costs 2, against cat costs 9; query 2 against dog costs 8, against cat costs 1; query 3 against dog costs 6, against cat costs 7. The Hungarian algorithm looks for the assignment of queries to objects that minimises the total cost while assigning each object to a different query. Here, matching query 1 to dog (cost 2) and query 2 to cat (cost 1) gives a total of 3, which is lower than any other pairing, so query 1 is trained against the dog's label and box, query 2 against the cat's, and query 3, left unmatched, is trained to predict 'no object'. This matching is recomputed for every image during training, since which query happens to be closest to which object varies from image to image.

Why this removes NMS

Because the loss only ever rewards a one-to-one assignment between queries and ground-truth objects, the network is actively discouraged, during training, from having two queries converge on the same object: if both query A and query B learn to predict a box near the same dog, only one of them can be the matched pair for that dog in any given training image, and the other is pushed, via the 'no object' target for unmatched queries, away from confidently predicting a duplicate. Over many training images this pressure teaches the network to spread its queries across distinct objects rather than piling several queries onto the same one, so at inference time there is no need for a separate step that detects and removes duplicate boxes. This is a genuine architectural difference from anchor-based detectors, where duplicates are an expected by-product cleaned up afterwards, rather than suppressed by the training objective itself.

What DETR gives up

The simplicity comes at a cost. Transformers do not have the same built-in assumption that nearby pixels matter more than far-apart ones (the inductive bias that convolutions have by construction, as discussed in part 2 and part 4 of this path), so they tend to need more training data and more training time to reach the same accuracy as a well-tuned anchor-based detector, a trade-off widely reported both in the original DETR paper and in follow-up work that specifically tries to speed up its convergence. DETR and its descendants have also been reported to need particular care to detect small objects well, since a single flattened sequence of coarse feature-map positions can lose fine spatial detail, something multi-scale anchor pyramids were specifically built to handle. None of this means DETR is worse in an absolute sense; it means the two families currently sit at different points of a trade-off between pipeline simplicity and training cost, and which one is the better fit depends on your data, your compute budget and your latency requirements.

Comparing the three families

  • Two-stage, anchor-based (Faster R-CNN and relatives): a learned region proposal step followed by classification and box refinement on each proposal. Generally strong accuracy, especially on small or crowded objects, at the cost of being slower than single-shot methods because of the two separate passes.
  • Single-stage, anchor-based (the YOLO family and relatives such as SSD): one forward pass predicts boxes directly from a dense grid of anchors, cleaned up with non-max suppression. Fast enough for real-time use on modest hardware, with accuracy that has closed much of the gap with two-stage methods over successive versions, at the cost of anchor hyperparameters and a non-differentiable NMS step.
  • Set-based, transformer (DETR and relatives): a fixed number of object queries predict a full object set directly, trained with bipartite matching, no anchors and no NMS. Conceptually the simplest pipeline, since there is nothing to hand-design beyond the number of queries, at the cost of typically needing more training time or data to match the other two families, and extra care for small objects.

None of these is simply 'better'; they are different answers to the same underlying problem of producing a variable number of outputs from a fixed-size network, and all three ideas, anchors, dense single-shot prediction, and set prediction with matching, show up in detectors you will encounter in practice.

Measuring detector quality: from IoU to mAP

A classifier's accuracy is a single, easy number: fraction of images with the correct label. A detector's quality has to account for localisation as well as classification, and for the fact that missing an object and hallucinating one that is not there are both mistakes but different kinds of mistakes. The standard metric is mean Average Precision, mAP, and it is built up from precision and recall exactly as you may have seen in other classification contexts, with one twist: a prediction only counts as a true positive if its class is correct and its IoU with some unmatched ground-truth box exceeds a chosen threshold, commonly 0.5.

Here is a small worked example for a single class, 'dog', in one image with 3 ground-truth dogs. The detector outputs 4 predictions with these confidences, in descending order: 0.95, 0.85, 0.70, 0.55. Suppose, after computing IoU against the ground truths with a threshold of 0.5, we find: prediction 1 (0.95) matches ground truth A, true positive. Prediction 2 (0.85) matches ground truth B, true positive. Prediction 3 (0.70) overlaps ground truth A again, but A is already matched, so this counts as a false positive (a duplicate). Prediction 4 (0.55) does not overlap anything well enough, false positive. Ground truth C was never matched by any prediction, a false negative (a missed dog).

Walking through the predictions in confidence order and keeping a running tally: after prediction 1, we have 1 true positive, 0 false positives, so precision is 1/1 = 1.0 and recall is 1/3 ≈ 0.33 (1 of the 3 ground-truth dogs found so far). After prediction 2, 2 true positives, 0 false positives, precision 2/2 = 1.0, recall 2/3 ≈ 0.67. After prediction 3, 2 true positives, 1 false positive, precision 2/3 ≈ 0.67, recall still 2/3, since no new ground truth was matched. After prediction 4, 2 true positives, 2 false positives, precision 2/4 = 0.5, recall still 2/3, since ground truth C is never recovered. Average Precision summarises this precision-recall curve into a single number, roughly the area under it (in practice computed with an interpolation rule rather than a raw trapezoidal sum, and the exact interpolation detail varies between evaluation protocols, so treat this description as the intuition rather than a precise formula to reimplement from memory). In this toy example, precision stays high (1.0) while recall climbs to 0.67, then precision drops as recall stalls, which is exactly the shape you want to reward: catching real objects early and confidently, and being punished for duplicate or spurious detections, and separately for the one object that was never found at all.

Mean Average Precision then averages this Average Precision score across all classes, and, in widely used benchmarks such as COCO, additionally across a whole range of IoU thresholds (commonly every value from 0.5 to 0.95 in steps of 0.05) to capture localisation quality at several strictness levels rather than a single cutoff, so a model that gets boxes roughly right but not pixel-precise scores differently from one that nails both class and tight localisation.

Common mistakes when working with detectors

  • Treating the confidence score as a calibrated probability. It is trained to correlate with 'object present and box is roughly correct', not to be a well-calibrated probability in the statistical sense; do not feed it directly into a downstream system that assumes calibrated probabilities without checking.
  • Leaving the NMS and confidence thresholds at their default values without testing on your own data. A default IoU threshold of 0.5 for NMS can be too aggressive for datasets with many touching or overlapping objects, such as fruit on a tray or people in a crowd, merging distinct objects into one.
  • Forgetting that data augmentation must transform the boxes along with the image. If you flip or crop an image (see part 5 of this path), every bounding box coordinate has to be transformed consistently, or you will train the network on images and labels that no longer correspond to each other.
  • Reusing default anchor scales and aspect ratios from a dataset like COCO on a very different dataset, for instance aerial imagery dominated by small, thin objects. Anchors (or, for DETR, the number of queries) should be sanity-checked against the actual size and shape distribution of objects you care about.
  • Judging localisation quality solely by eye on a handful of images, rather than computing IoU and mAP on a held-out validation set. A detector can look fine on a few hand-picked examples while performing poorly in aggregate, especially on rare classes or small objects.
  • Ignoring the class imbalance between background and foreground. Whether you are implementing or just configuring a detector, remember that the vast majority of anchors, grid cells, or queries correctly represent 'no object', and a model that is lazy about this can still rack up a misleadingly low raw loss while missing real objects.

Summary and what comes next

Object detection extends the classifiers from earlier parts of this path into a problem with a variable number of outputs, each carrying both a location and a label. IoU gives a precise way to score how well a predicted box matches a true one, and that single idea threads through matching anchors to ground truth during training, through non-max suppression at inference time, and through the mAP metric used to compare detectors. Anchors solve the 'predict an unknown box from nothing' problem by giving the network a menu of reference shapes to refine rather than invent from scratch; YOLO showed that this refinement can be done in a single dense pass over a grid, trading some of the accuracy of a two-stage proposal network for speed; and DETR showed that, using attention and a fixed set of object queries matched to ground truth via the Hungarian algorithm, you can drop anchors and NMS entirely and predict a full set of objects directly, at the cost of needing more training to get there.

The next part of this path, Semantic and Instance Segmentation, moves from boxes to pixel-precise masks, asking not just where an object is but exactly which pixels belong to it. Part 9, Vision Transformers, will return properly to the attention mechanism only sketched here, explaining self-attention from first principles rather than relying on the intuition used above to motivate DETR's design. Later, the hands-on parts of this path, 12 and 13, will have you fine-tune a classifier on your own photos and then train an actual YOLO detector on a custom dataset, where the anchor, grid and non-max-suppression concepts covered here will show up directly as configuration choices you need to understand, not just abstract ideas.