Yolov3: Evolve parameters

Created on 5 May 2020  路  14Comments  路  Source: ultralytics/yolov3

Hi,
Thanks for this great work.
I have trained my model for one class (includes 700 images) and gec mAP 60.
To increase mAP, I used evolve and got evolve.tx, but it has lotf of parameters. I cant not figure out what are the first 7 parameters, other starts with giou. My evolve txt looks like this:
0.96 0.833 0.911 0.892 1.47 0.247 0 3.57 0.00573 0.99 65.7 0.983 0.198 0.01 0.0005 0.935 0.000492 0 0.0132 0.702 0.361 0 0 0 0.
giou starts 3.57 and so on, but what is ( 0.96 0.833 0.911 0.892 1.47 0.247 0) ?

Thanks for advance

Stale bug

Most helpful comment

@jaqub7676 --evolve will not modify your anchors. You can use this function to get optimal anchors for your dataset:
https://github.com/ultralytics/yolov3/blob/d40595989388e0c99b7ee7e391b2ca9a7edb7848/utils/utils.py#L693-L698

All 14 comments

Hello @jaqub7676, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Google Colab Notebook, Docker Image, and GCP Quickstart Guide for example environments.

If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

@jaqub7676 your best result will be the first row. First 7 values are metrics, the rest are your hyps.

@glenn-jocher many thanks.
To justify (sorry), the order of metrics ? , prec, rec, map, f1, val/giou loss, val/obj loss and val/cls loss.. If so, I updated hyps in train.py, but I did not got higher results, got map 0.86 with 0.06 increase, P: 0.96, R:0.68 AND F1: 0.80. According to these hyps, I had to get (0.96 0.833 0.911 0.892 1.47 0.247 0) that map is 0.91... ? Am I right ? (It looks like only F1 is same compared to evolve params).
Another quesiton, I wonder what do you suggest for my medical data (700 images and 200 for test) with single class ?
Do I need to do augmententation before training or train.py is enough ? I am waiting for your suggest ? ( yolo.weights and yolov3.cfg worked best for me).
Many thanks again.

@jaqub7676 the first 7 are P, R, mAP, F1, and then the 3 losses: GIoU, obj, class

Thanks again. Do you have any suggestion for my other questions ?

@jaqub7676 reproducibility of results will depend on many factors, but in general seperate trainings may not be deterministic, so you can expect variations from one training run to another.

This is quite unfortunate obviously, especially in the case of hyperparameter evolution, where we'd ideally like all of the mAP change to be caused by the hyperparameters rather than nondeterministic factors, but it is the current state of affairs in the industry. See https://pytorch.org/docs/stable/notes/randomness.html

Augmentation during training is all you need (there's no point creating additional copies of your dataset before training). I would suggest using yolov3-spp, as it should produce better results.

last thing, Only if we use darknet, then we can update anchors. For others like yolov3-spp etc, do I need to use k-means anchor to get new anchor for my datasets. Or evolve is doing everything includes anchors ? Thnaks again.

@jaqub7676 --evolve will not modify your anchors. You can use this function to get optimal anchors for your dataset:
https://github.com/ultralytics/yolov3/blob/d40595989388e0c99b7ee7e391b2ca9a7edb7848/utils/utils.py#L693-L698

Thanks...

@jaqub7676 you're welcome, good luck!

@glenn-jocher Hi, Thank you for your amazing work!
I have a question about hyperparameters. If I use image augmentation, is that right I change the 0 in the following code to 1? And does the value 1.98 represent the rotation degree, the 0.05 represent that the translation is 5%?
'degrees': 1.98 * 0, # image rotation (+/- deg) 'translate': 0.05 * 0, # image translation (+/- fraction) 'scale': 0.05 * 0, # image scale (+/- gain) 'shear': 0.641 * 0 } # image shear (+/- deg)
And if I trained at multi-scale, do I need to uncomment the following code? Because the default hyp "obj loss gain"is evolved at 320.
hyp['obj'] *= opt.img_size[0] / 320.
Thank you in advance for your reply!

@tyb197 yes that is correct, units are degrees rotation and fractional translation. No, you do not need to comment that line (we should probably remove it to avoid confusion). It simply scales the obj loss accordingly, which may help certain datasets, but the current hyps are defined at 416 rather than 320 FYI.

@tyb197 also yes, if you remove the zeros then augmentation will proceed acording to these values. You can observe the result in train*.jpg after you start training.

This issue is stale because it has been open 30 days with no activity. Remove Stale label or comment or this will be closed in 5 days.

Was this page helpful?
0 / 5 - 0 ratings