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:
Thank you.
Hi,
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.
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.
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?
Do you use this fork or original repo?
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?
20 000 iterations - is small for maximum accuracy, but enough to get acceptable accuracy.
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 ,
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.
Most helpful comment
@jackchen0117 Can you provide some images with poor detections?
Do you use this fork or original repo?
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-showand pin here the screenshot of sizes distribution?20 000 iterations - is small for maximum accuracy, but enough to get acceptable accuracy.
You can get mAP and IoU using this command:
darknet.exe detector map data/obj.data yolo-obj.cfg backup\yolo-obj_9000.weightsYes, 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.cfgin the direcory: build/darknet/x64/