Darknet: about multiple similar-classes recognition

Created on 8 Mar 2018  路  5Comments  路  Source: AlexeyAB/darknet

Dear all,

I'm working on a multiple similar-classes recognition project which is required to tell about 300 traffic signs from each other. These data come from video of ground truth.
I tried couple of data augment methods with the parameters in .cfg file, but the result is still messy.
The recognition of the same sign in ground truth is inconsistent when camera passed by.
I would really appreciate if you can provide some of your suggestions regarding YOLOv2.
Say, change the backbone network to a deeper one like densenet-201?
(I'm currently using darknet-19 with 608*608 resolution. Speed of test-video processing is needed as well.)

Here are some other questions:

  1. What does argument "partial" do?
  2. Why do we need 2000 iteration for each class? Where does this number "2000" come from?
    If the loss value has become lower than 0.06 while the number of iteration doesn't reach 2000*number_of_classes yet, should I stop it?

Thank you.

Most helpful comment

@jackchen0117 Can you provide some images with poor detections?

  1. Do you use this fork or original repo?

  2. So you have about 230 images for each class.
    What resolution of images do you have?
    Can you run darknet.exe detector calc_anchors data/obj.data -num_of_clusters 5 -final_width 19 -final_heigh 19-show and pin here the screenshot of sizes distribution?

  3. 20 000 iterations - is small for maximum accuracy, but enough to get acceptable accuracy.

  4. You can get mAP and IoU using this command: darknet.exe detector map data/obj.data yolo-obj.cfg backup\yolo-obj_9000.weights

Yes, deeper network might help, but requires more iterations for training. Also detection and training are slower.

Use this file to get pre-trained weights for resnet50, resnet152 and densenet201: https://github.com/AlexeyAB/darknet/blob/master/build/darknet/x64/partial.cmd
And base your cfg-file on the one of these files: densenet201_yolo.cfg, resnet152_yolo.cfg, resnet50_yolo.cfg in the direcory: build/darknet/x64/

All 5 comments

Hi,

  • How many classes are there?
  • How many images do you have?
  • How many iterations did you train?
  • And what mAP and IoU did you get?

  1. partial just loads weights-file, put weights to the layer of specified cfg-file, and then saves first N lyaers to the new weights-file. So you got pre-trained weights file with first the same layers (first 23 layers are the same in the darknet19_448.cfg and in the yolo.cfg, yolo.2.0.cfg, yolo-voc.cfg, yolo-voc.2.0.cfg). It allows to train faster, and get precision higher.

  2. This is just recommendation. There is no specific goal for loss or number of iterations. The main thing - your weights-file should gives you the highest mAP on the separate validation dataset, as described here: https://github.com/AlexeyAB/darknet#when-should-i-stop-training

AlexeyAB,

Thanks for your reply. : )

1.I have about 300 classes to be recognized.

2.70000+ images, most of them have finely labeled bounding-boxes.

3.Due to the limitation of computer resources, I trained it less than 20,000 iterations every time.
But the loss value reaches 0.06 at far earlier iteration already.

  1. I used IoU>=0.5 as threshold, and the mAP is pretty low.
    Still working on the function of mAP calculation. But at a glance of statistic result, I think it's lower than 30%.
    (When I watch the test video, recognition results change very fast and unstable for every ground truth.)

I think a deeper network might help. But in this way, it's going to be very slow, right?

@jackchen0117 Can you provide some images with poor detections?

  1. Do you use this fork or original repo?

  2. So you have about 230 images for each class.
    What resolution of images do you have?
    Can you run darknet.exe detector calc_anchors data/obj.data -num_of_clusters 5 -final_width 19 -final_heigh 19-show and pin here the screenshot of sizes distribution?

  3. 20 000 iterations - is small for maximum accuracy, but enough to get acceptable accuracy.

  4. You can get mAP and IoU using this command: darknet.exe detector map data/obj.data yolo-obj.cfg backup\yolo-obj_9000.weights

Yes, deeper network might help, but requires more iterations for training. Also detection and training are slower.

Use this file to get pre-trained weights for resnet50, resnet152 and densenet201: https://github.com/AlexeyAB/darknet/blob/master/build/darknet/x64/partial.cmd
And base your cfg-file on the one of these files: densenet201_yolo.cfg, resnet152_yolo.cfg, resnet50_yolo.cfg in the direcory: build/darknet/x64/

AlexeyAB ,

  1. I downloaded this project under your account, so I guess it's a fork.
    2 & 4. It's FullHD.
    As for the command with "calc_anchors" ,somehow it doesn't work.
    (command with"map" doesn't work either for me. Is this because I need to update a newer version of your project?)
  2. I see.

Thank you for answering my questions so fast !

As for the command with "calc_anchors" ,somehow it doesn't work.
(command with"map" doesn't work either for me. Is this because I need to update a newer version of your project?)

Yes, you should update your code.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

qianyunw picture qianyunw  路  3Comments

Yumin-Sun-00 picture Yumin-Sun-00  路  3Comments

Cipusha picture Cipusha  路  3Comments

HanSeYeong picture HanSeYeong  路  3Comments

shootingliu picture shootingliu  路  3Comments