Why are only 2 of the RT-DETR v2 implemented losses actually used?

Hi,

I’ve been studying the RTDetrLoss implementation in the transformers library and noticed something interesting. The class implements several loss functions:

  • loss_labels_vfl
  • loss_labels (cross-entropy)
  • loss_cardinality
  • loss_boxes
  • loss_masks
  • loss_labels_bce
  • loss_labels_focal

However, looking at the code, it seems only ā€œvflā€ and ā€œboxesā€ losses are actually used in practice (these are the only ones included in self.losses = ["vfl", "boxes"]).

I’m curious about why the other loss functions are implemented but not utilized. Is this consistent with the RT-DETR paper’s implementation? Or perhaps were the other losses tested empirically but found to be less effective?

Has anyone experimented with enabling the other loss functions like the focal loss or BCE loss? I’d appreciate any insights about the design choices here.

Hope you guys can help! Thank you.

1 Like

If anyone has an answer it would be very helpful.

1 Like

I did some quick research at the time, but couldn’t find any useful information. It seems that those parameters already existed in RT-DETR (not v2), but I couldn’t figure out why they were implemented.

1 Like

ok thank you

1 Like