Example

Anchor Box Labeling Example

To illustrate anchor box labeling, consider an image containing ground-truth bounding boxes for a dog and a cat, alongside a set of five generated anchor boxes, denoted as A0,,A4A_0, \ldots, A_4. The labeling process evaluates the pairs of anchor boxes and ground-truth bounding boxes based on Intersection over Union (IoU). For example, if the IoU between anchor box A4A_4 and the cat's ground-truth bounding box is the largest among all pairs, A4A_4 is labeled as the cat. Removing all pairs containing A4A_4 or the cat's bounding box, if the remaining pair with the largest IoU is A1A_1 and the dog's bounding box, A1A_1 is labeled as the dog. For the remaining unlabeled anchor boxes (e.g., A0,A2,A3A_0, A_2, A_3), they are assigned to the ground-truth bounding box with the highest IoU only if that IoU exceeds a predefined threshold (e.g., 0.50.5). Thus, if A2A_2 has an IoU with the cat exceeding the threshold, it is labeled as the cat; conversely, if A0A_0 and A3A_3 have maximum IoUs below the threshold, they are labeled as the background class.

Image 0

0

1

Updated 2026-05-20

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L