5

I'm trying to understand how to calculate the value of circled terms, what are the inputs/outputs I have to compare?

Loss Function

Let's take the first term for example, if I understand it correctly it goes something like this:

Let's say my predicted values for the first cell, first bounding box (yolov1 = 2 bbs) are

[pr, x, y, W, H]
[.7, 0.5, 0.3, 0.1, 0.1]

and my true values are

[pr, x, y, W, H]
[1, 0.6, 0.4, 0.2, 0.2]

That would make mean the formula goes something like this

5 * (1 or 0) ((0.6 - .5)^2 + (0.4 - 0.3)^2)

Can someone provide an example step by step on what are the metrics to determine 1 or 0?

Are we looking at the label from the training set image? Are we looking at the predicted objectness score? IoU?

According to the YOLO paper:

1objij : denotes that the jth bounding box predictor in cell i is “responsible” for that prediction

1obji : Denotes if object appears in cell i

But this quote doesn't exactly help me answer my question... Any help would be appreciated.

Salvador Molina
  • 315
  • 4
  • 17

2 Answers2

1

The 1objij is either 0 or 1:

  • It is always 0 if the cell is empty in the training data, in your example if the value for pr from training data is 0. Note: In the training data the value for pr is either 0 or 1, nothing else is possible for this value.
  • If there is a 1 in the training data for pr it furthermore depends on the IoU of the predicted bounding boxes and the ground truth. Yolo predicts B bounding boxes for each cell, the highest IoU bounding box the value of the corresponding 1objij is 1 for all other bounding box predictions it is 0.

Are we looking at the label from the training set image? Are we looking at the predicted objectness score? IoU?

  • As I tried to answer 1objij uses both pr from training data and IoU calculated from prediction and training data.
  • 1obji uses only pr from training data.
Stefan
  • 1,151
  • 1
  • 8
  • 13
-1

As i understand, every grid cell, yolo predict 2 boxes,

box1 = [.7, 0.5, 0.3, 0.1, 0.1]
box2 = [1, 0.61, 0.41, 0.21, 0.21]

Obviously the

IOU(box2,ground-truth box) > IOU(box1,ground-truth box)

so when we calulate loss, we do not consider box1, that means

1objij(i=0,j=0) = 0
1objij(i=0,j=1) = 1
Nikolai Shevchenko
  • 7,083
  • 8
  • 33
  • 42
du s
  • 1