-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DIoU and CIOU loss implementation #4360
Comments
Paper: https://arxiv.org/abs/1911.08287v1
|
Looks like a really nice big "free" performance boost! Can't wait to test it! |
I added CIoU and DIoU to both [yolo] and [Gaussian_yolo] layers. But didn't test yet. @LukeAI Did you test |
if you tested. please give me the corresponding cfg file. thanks |
@tuteming I fixed several bugs. cfg-file with |
Very interesting!! I will try to implement DIoU and CIoU in ultralytics/yolov3 and test on COCO vs our default GIoU. |
Hi @AlexeyAB I'm confused about the "scale_x_y" param. In this "yolov3-tiny_pan_ciou.cfg.txt", the "scale_x_y" params are as follows:
But In your topic about "Sensitivity Effects Near Grid Boundaries (Experimental Results) ~+1 AP@[.5, [.95]" #3293, you say the rule of setting param "scale_x_y" as follows:
so my question is: for large objects, like mask = 8,9,10,11, according to the rule, the value of scale_x_y should be 1.05, it's in conflict with "yolov3-tiny_pan_ciou.cfg.txt" setting, so which one is right then? |
@lq0104 Yes, my mistake ) Should be:
Or 1.1 for all yolo-layers. |
I tested the 3 box regression methods below on https://github.com/ultralytics/yolov3 using yolov3-spp.cfg with swish trained on full COCO2014 to 27 epochs each, but was not able to realize performance improvements with the new methods. I'll try again with LeakyReLU(0.1). The IoU function I implemented is here: python3 train.py --weights '' --epochs 27 --batch-size 16 --accumulate 4 --prebias --cfg cfg/yolov3s.cfg
|
When using ciou - the model converges faster and accuracy increases faster during training? Or no change at all? They also introduced new NMS function, that can be enabled in the last [yolo] layer by set
Mainly introduced Lines 201 to 218 in b832c72
Lines 855 to 917 in b832c72
|
The 3 really didn't differ much throughout the entire training oddly enough. I did see CIoU help out more on a custom small dataset I had, so perhaps it helps more when there is less training data. The results73, 74 and 75 are G, D and CIoU. Did you see any difference when using the different NMS techniques? I tried to implement soft-nms before without success. |
May be CIoU and DIoU improves only [email protected] - [email protected] like as GIoU: #3249 (comment) I just tested [email protected] on the default yolov3-spp.cfg / weights 608x608:
( May be if yolov3-spp.cfg will be trained with CIoU then |
CIOU hurt the mAP in my run |
@AlexeyAB
But I found in Which one of the following should I set to my
Or should I train 3 times and then choose the one with best mAP ? |
Honestly guys I don't understand how giou, diou, ciou is better than just IOU for YOLOv3 framework. The main problem they all address compared to vanilla iou is that loss is not differential if intersection of an anchor and a target is 0. However in the yolo framework it is always non-zero - we pick the anchor with largest IOU with target. Otherwise box loss doesn't contribute to overall loss. So I'm sceptical about these papers and reported results. At least in the experiments using my own pytorch yolo implementation with custom datasets I'm getting worse results with *IOU losses compared to original yolo loss. |
@LukeAI Try to use these hyperparameters: #4430 It isn't tested well, so use Or try scale_x_y = 1.05, 1.1, 1.2 for different yolo-layers ?
|
I also have doubts about the effectiveness of C/D/GIoU. Perhaps they simply generate a higher delta and therefore improve the results of AP75 and reduce the results of AP50. Maybe we can achieve the same effect with default Yolo-loss (without GIoU) and with But:
This Pytorch-Yolov3 uses GIoU: https://github.com/ultralytics/yolov3 |
I don't know how good DIoU works with rotated bboxes. |
9 anchors. Angle loss is just another separate loss component, so |
@glenn-jocher yes, I think it will be on par with other losses.
Yes |
@AlexeyAB |
@nyj-ocean The basic idea is the same as in It it better than |
Indeed loss was correct, but I had another bug - I scaled anchors 2 times... Now re-running experiments. Will keep posted. |
@AlexeyAB @glenn-jocher. I've fixed bug in my code and now it seems:
|
@dselivanov Nice! |
Btw this is ap@iou>=0.5
I haven't tried and I think will not. I believe my comment here is valid.
Do you mean how loss is calculated? I predict angle between X axis and the largest side (width by convention). |
Thanks! Do you use Linear activation for Angle, or Logistic as for x,y,obj,class, or EXP as for w,h? |
Logistic because angle is bounded by 0 and |
@dselivanov
|
I am not sure |
@AlexeyAB @glenn-jocher @dselivanov thanks for the detailed discussion which you are currently have i had few queries Thanks in advance |
|
@AlexeyAB thansk for your response but does these method take rotation/orientation of the object into considerations |
No. |
@dselivanov can you pls share the rotation section of the CIOU/DIOU ? |
There is no "rotation part" of *IOU. Rotation loss is a separate component
- see our discussion above.
…On Sat, 11 Jan 2020, 06:15 abhigoku10, ***@***.***> wrote:
@dselivanov <https://github.com/dselivanov> can you pls share the
rotation section of the CIOU/DIOU ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4360?email_source=notifications&email_token=ABHC5XN4VTG5NIAZ2GMT6WDQ5ETUTA5CNFSM4JQTY7Q2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIVWRDI#issuecomment-573270157>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHC5XJNG477YYWUPI23RULQ5ETUTANCNFSM4JQTY7QQ>
.
|
@dselivanov thanks for confirming this , just wanted to knw of by including the rotation/ orientation param in the loss calculation is effective or not ? |
@abhigoku10 yes |
@simon-rob @AlexeyAB @LukeAI @glenn-jocher can anyone please tell me how can I change the loss functions for training a classification model while using this repo. |
https://github.com/Zzh-tju/CIoU |
https://github.com/Zzh-tju/DIoU-darknet
This already implemented in the about repository.
The text was updated successfully, but these errors were encountered: