ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
50.34k stars 16.25k forks source link

Introducing SIoU Loss #8138

Closed WZMIAOMIAO closed 2 years ago

WZMIAOMIAO commented 2 years ago

Search before asking

Description

Hi, have you ever tried SIoU Loss?

Paper: SIoU Loss: More Powerful Learning for Bounding Box Regression

According to the Abstract of the paper, feel so good.

In particular, the application of SIoU to the COCO-train/COCO-val results in improvements of +2.4% (mAP@0.5:0.95) and +3.6%(mAP@0.5) over other Loss Functions.

image

wenjunx commented 2 years ago

in my datasets, it didn't work.

wilile26811249 commented 2 years ago

I just started to try SIOU Loss. I'll report if the training have any news.

wilile26811249 commented 2 years ago

Other discussion about the SIOU loss in the PaddleDetection. https://github.com/PaddlePaddle/PaddleDetection/issues/6070

It doesn't seem as good as in the paper.

glenn-jocher commented 2 years ago

@wilile26811249 interesting, let us know your experiment results!

glenn-jocher commented 2 years ago

@AyushExel can you take a look at this SIoU loss to see if it might be suitable for YOLOv5?

@wilile26811249 do you have a torch SIoU implementation we could use to experiment with?

The official publication lacks code unfortunately.

wilile26811249 commented 2 years ago

You can check this implementation.

https://github.com/xialuxi/yolov5-car-plate/blob/master/utils/general.py#L370-L388

AyushExel commented 2 years ago

@glenn-jocher I think the correct way forward for supporting this in the master branch would be to run ablation tests. For starters we can run a training job comparing SIoU with current version on 10% coco dataset and then on the full dataset. Ideally, if it outperforms on both tests then we'll have a clear indication( if it doesn't affect other things like speed) otherwise we can just add the implementation and allow user to enable it via a feature flag. This could be a nice community led R&D experiment.

wilile26811249 commented 2 years ago

@glenn-jocher @WZMIAOMIAO, Here are my results. Unfortunately, It seems like not improved.

with SIOU:

image

with CIOU:

image
glenn-jocher commented 2 years ago

@wilile26811249 thanks for the results! Ok so it seems like not a significant change.

WZMIAOMIAO commented 2 years ago

well, I will close this issue.

lucysumi commented 1 year ago

I just started to try SIOU Loss. I'll report if the training have any news.

Hi, @wilile26811249 Could you please tell me how do you change the current Yolov5 loss function fro CIOU to SIOU loss? Where specifically do I make the changes? I'm a newbie and trying to understand Yolov5. Thanks!