5

I am attempting to explain the purposes of different parameters in the yolov3.cfg file, however, I can't find any explanation for ignore_thresh and truth_thresh.

My current (limited) understanding is that they are either related to non-max suppression where they act as thresholds for combining bounding boxes, or upper and lower bounds for confidence in predictions.

Couldn't find anyone actually explaining the parameters online, only people who have copy-pasted parts of the config file. I have looked through https://blog.paperspace.com/tag/series-yolo/ where YOLOv3 is implemented in PyTorch, however, they smoothly skip using and explaining these two parameters.

The relevant parts of yolov3.cfg is shown below.

[yolo]
mask = 3,4,5
anchors = 10,13,  16,30,  33,23,  30,61,  62,45,  ...
classes=80
num=9
jitter=.3
ignore_thresh = .7
truth_thresh = 1
random=1

I don't think it matters, but I am using AlexeyAB's darknet repository as framework.

Jonas
  • 137
  • 2
  • 10
  • After a bit of searching, I found this thourough expanation of cfg parameters: https://github.com/AlexeyAB/darknet/issues/279 . I hope this will help you. – Anubhav Singh May 19 '19 at 04:38
  • I found this site as well, however, I couldn't really piece together the meanings of the two parameters from what was said there. – Jonas May 19 '19 at 08:18

1 Answers1

4

I also found this:

ignore_thresh = .7: The parameter determines whether the IOU error needs to be calculated is greater than the thresh, and the IOU error is not pinched in the cost function.

truth_thresh = 1: The size of the IOU threshold involved in the calculation.

When the predicted detection box overlaps the ground true IOU by ignore_thresh, the detection box doesn't participate in the calculation of loss, otherwise, it does.

The purpose is to control the scale of the detection frame participating in the loss calculation.

When the ignore_thresh is too large, close to 1, then participate.The number of regressions in the detection box will be less, and it will easily cause over-fitting.

If the ignore_thresh is set too small, then the number of participants involved in the calculation will be large. At the same time, it is easy to cause under-fitting when performing the detection frame regression.

Anubhav Singh
  • 8,321
  • 4
  • 25
  • 43
  • According to YOLOv3 paper, "If the bounding box prior is not the best but does overlap a ground truth object bymore than some threshold we ignore the prediction, following [17]. We use the threshold of.5.". It sounds to me like the detection box is left out of the loss function when the threshold is reached as opposed to what the source says. – Jonas May 19 '19 at 10:30
  • Yeah. In case of greater than ignore_thresh, the prediction is ignored and hence doesn't participate. I updated the post. Thanks! – Anubhav Singh May 19 '19 at 12:08