6

I'm still new to "You Only Look Once" object detection algorithm (YOLOv4 to be exact). I have some questions regarding the mAP and loss chart.

I tried to follow the instructions from AlexeyAB Darknet, and train my custom object detector using Google Colabs. After the training, it shows the loss and mAP chart as shown below.

Loss and mAP chart:

image

My questions are:

  1. Is there any chart other than this?
  2. Is this loss for training or validation?
  3. Why is there a sudden drop near iteration 1200?
  4. Is the output of the training only that chart and the weight files?
Shayan Shafiq
  • 1,447
  • 5
  • 18
  • 25
Thariq
  • 63
  • 1
  • 1
  • 4

2 Answers2

10
  1. Yes. But if you want to export the log and make a chart out of it, you can try this command:

./darknet detector train data/obj.data cfg/yolov4.cfg yolov4.weights -map | tee results.log

  1. The blue curve is the training loss or the error on the training dataset (specifically Complete Intersection-Over-Union or CIoU loss for YOLOv4). For more details on CIoU loss, check this paper. The red line is the mean average precision at 50% Intersection-over-Union threshold (mAP@0.5), which checks if your model it is generalizing well on a never-before-seen dataset or validation set. If you want to understand mAP more, you can refer to this easy-to-understand blogpost.

  2. Are you using a custom dataset? The drop near iteration 1200 might be caused by some problems in your dataset. To check, try these:

    (a) Check your dataset - run training with flag -show_imgs i.e. ./darknet detector train ... -show_imgs and look at the aug_...jpg images, do you see correct truth bounded boxes?

    (b) Check generated files bad.list and bad_label.list if they exist. These files contain the label files that may have problems.

  3. Yes. But if you enable the log file (check my answer - no. 1), then, no.

  • There is a green line tied with max_batches? What it means? Also in my case Map, the red line, does not apperes while training running. Is it appear after the training finished or I need to write a code for that? – N.white Aug 23 '23 at 05:36
1
  1. The loss in the chart is for validation
  2. the drop near iteration 1200 is most probably because the mean precision is lower for that particular mini-batch of your data as compared to other mini-batches.
  3. You might have to manually save the weights explicitly after the training is stopped.

For second and third question, please check point 2.2 at When should I stop training | AlexeyAB / darknet

Shayan Shafiq
  • 1,447
  • 5
  • 18
  • 25
Sujit
  • 143
  • 2
  • 13