Anchor Boxes for Object detection

Viewed 2035

Can someone help me understand how are anchor boxes represented in YoloV5. In the official code it is mentioned as:

  • [10,13, 16,30, 33,23] # P3/8
  • [30,61, 62,45, 59,119] # P4/16
  • [116,90, 156,198, 373,326] # P5/32

I understand that p3, p4 and p5 are layers of feature pyramids. But what are the numbers corresponding to. I'l appreciate if someone can clarify on:

  1. What these number specify.
  2. Their, significance.
  3. Why are they changing from layer to layer.

Thanks.

1 Answers

Anchor box is just a scale and aspect ratio of specific object classes in object detection. The FPN (Future Pyramid Network) has three outputs and each output's role is to detect objects according to their scale. For example:

  • P3/8 is for detecting smaller objects.
  • P4/16 is for detecting medium objects.
  • P5/32 is for detecting bigger objects.

So when you're going to detect smaller objects you need to use smaller anchor boxes and for medium objects you should use medium scale anchor boxes, so on. You can see it on following image as well:

enter image description here

You may have a question why bigger feature maps have smaller anchor boxes. It's because, during downsampling the feature maps if you downsample it many times you may lose smaller objects, that's why you should use bigger feature maps and smaller anchor boxes to detect smaller objects.

Related