Skip to content
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

Add GIoU loss into this repo? ~+3 AP@[.5, .95] #3249

Closed
TaihuLight opened this issue May 27, 2019 · 13 comments
Closed

Add GIoU loss into this repo? ~+3 AP@[.5, .95] #3249

TaihuLight opened this issue May 27, 2019 · 13 comments

Comments

@TaihuLight
Copy link

TaihuLight commented May 27, 2019

YoloV3 with GIoU loss implemented in original Darknet as https://github.com/generalized-iou/g-darknet
Will GIoU loss be supported in this version of Darknet?

@article{Rezatofighi_2018_CVPR,
  author    = {Rezatofighi, Hamid and Tsoi, Nathan and Gwak, JunYoung and Sadeghian, Amir and Reid, Ian and Savarese, Silvio},
  title     = {Generalized Intersection over Union},
  booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  month     = {June},
  year      = {2019},
}
@AlexeyAB
Copy link
Owner

AlexeyAB commented May 27, 2019

I will think about it:
https://arxiv.org/abs/1902.09630v2

https://giou.stanford.edu/

@AlexeyAB AlexeyAB added the want enhancement Want to improve accuracy, speed or functionality label May 27, 2019
@AlexeyAB AlexeyAB added enhancement and removed want enhancement Want to improve accuracy, speed or functionality labels Jun 4, 2019
@tdurand
Copy link

tdurand commented Jun 4, 2019

@AlexeyAB this is used for training or inference ?

@AlexeyAB
Copy link
Owner

AlexeyAB commented Jun 4, 2019

@tdurand
It should be used for training.

@tdurand
Copy link

tdurand commented Jun 4, 2019

@tdurand thanks and sorry for this other question, I went through the paper and the website but failed to understand if those trained weight published here: https://github.com/generalized-iou/g-darknet#pre-trained-models improves inference speed / accuracy ? Or is it just a method to train faster ?

@AlexeyAB
Copy link
Owner

AlexeyAB commented Jun 4, 2019

@tdurand As they said, the MS COCO AP@[.5, .95] was increased: https://arxiv.org/pdf/1902.09630v2.pdf

It means that by training with GIoU:

  • AP@[.5, .95] - was increased
  • mAP@0.75 - was increased
  • mAP@0.5 - was decreased

image


Checking mAP on MS COCO 2014 validation dataset 5k.txt - you can get this dataset by using: https://github.com/AlexeyAB/darknet/blob/master/scripts/get_coco_dataset.sh

Yolo v3 (not spp) width=608 height=608: https://github.com/AlexeyAB/darknet/blob/master/cfg/yolov3.coco-giou-12.cfg

Using these weights-files: https://github.com/generalized-iou/g-darknet#pre-trained-models


mAP@0.75 - (IoU_threshold = 75%)

  • GIoU - 35.05% mAP@0.75 - 0.351
    darknet.exe detector map cfg/coco.data cfg/yolov3.coco-giou-12.cfg yolov3_final_giou.weights -points 101 -iou_thresh 0.75

  • MSE - 31.39% mAP@0.75 - 0.314
    darknet.exe detector map cfg/coco.data cfg/yolov3.coco-giou-12.cfg yolov3_492000_mse.weights -points 101 -iou_thresh 0.75

  • MSE (default weights https://pjreddie.com/media/files/yolov3.weights ) - 31.63% mAP@0.75 - 0.316
    darknet.exe detector map cfg/coco.data cfg/yolov3.coco-giou-12.cfg yolov3.weights -points 101 -iou_thresh 0.75

Result is slightly different than in Pycoco-tool, since Pycoco-tool takes into account parameters crowd in MS COCO labels.


mAP@0.50 (IoU_threshold = 50%)

  • GIoU - 52.17% mAP@0.50 - 0.522
    darknet.exe detector map cfg/coco.data cfg/yolov3.coco-giou-12.cfg yolov3_final_giou.weights -points 101 -iou_thresh 0.50

  • MSE - 52.17% mAP@0.50 - 0.522
    darknet.exe detector map cfg/coco.data cfg/yolov3.coco-giou-12.cfg yolov3_492000_mse.weights -points 101 -iou_thresh 0.50

  • MSE (default weights https://pjreddie.com/media/files/yolov3.weights ) - 55.19% mAP@0.50 - 0.552
    darknet.exe detector map cfg/coco.data cfg/yolov3.coco-giou-12.cfg yolov3.weights -points 101 -iou_thresh 0.50

Result is slightly different than in Pycoco-tool, since Pycoco-tool takes into account parameters crowd in MS COCO labels.

@tdurand
Copy link

tdurand commented Jun 4, 2019

many thanks !

@AlexeyAB AlexeyAB changed the title Add GIoU loss into this repo? Add GIoU loss into this repo? ~+3 AP@[.5, .95] Jun 7, 2019
@AlexeyAB
Copy link
Owner

AlexeyAB commented Jul 1, 2019

Explanation of AP(GIoU)-metric: generalized-iou/g-darknet#12 (comment)

@LukeAI
Copy link

LukeAI commented Aug 1, 2019

Is it possible to evaluation the GIoU metric with this repo?
Why is it that there is an increase in mAP and AP75 but a decrease in AP50 with GIoU loss?

@AlexeyAB
Copy link
Owner

AlexeyAB commented Aug 1, 2019

@LukeAI

Is it possible to evaluation the GIoU metric with this repo?

Do you mean mAP@GIoU_treshold instead of mAP@IoU_treshold ?
No.

Why is it that there is an increase in mAP and AP75 but a decrease in AP50 with GIoU loss?

correct classifications are slightly less likely but the bounding boxes are tighter

@yrc08
Copy link

yrc08 commented Oct 23, 2019

@AlexeyAB
Copy link
Owner

@yrc08 Yes.

@yrc08
Copy link

yrc08 commented Oct 23, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants