I'm going through Andrew NG's course which talks about YOLO but he doesn't go into the implementation details of anchor boxes.

Look through the code, each anchor box is represented by two values, but what exactly are these values representing??

As for the need of Anchor boxes, I'm also a little confused about that -- As far as I understand, the ground truth labels have around 6 variables :

1) P_o which check if it's an object or background,

2,3) Bx, By (which are the center coordinates)

4,5) Bh, Bw which are the (Height and Width of the box)

6) C ( Object Class, which depends on how many class labels you have, so you can have multiple C)

As for creating the bounding box,

Bh is divided by 2, with one half from the center points (Bx, By) to the top, and the other half to the bottom.

If we train our classifier, wouldn't the prediction boxes be close to the ground truth labels as training progresses? So if our ground truth label has a high height, small width as boxes for some images, and low hight and large width for other images, wouldn't our classifier automatically learn to differentiate between when to use one over the other, as it is being trained? If so then what is the use of anchor boxes? And what are those numbers representing anchor boxes representing?

Thank you.

Not an pro but I think I know some answers to your questions.

If we train our classifier, wouldn't the prediction boxes be close to the ground truth labels as training progresses

I think that's what YOLO v1 did. According to Andrew NG's video the bounding boxes are introduced to solve multiple objects inside the same grid cell. And according to this post anchor boxes assignment ensures that an anchor box predicts ground truth for an object centered at its own grid center, and not a grid cell far away (like YOLO may)

what are those numbers representing anchor boxes representing?

They are just width and height (shape). In YOLO v2 it is used to compute IOU assuming all boxes are placed at the same location (ignoring the location), you could think of it just tries to match the shape. And it uses (1-IOU) as the distance when applying the K-means clustering.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.