facebookresearch / CutLER

Code release for "Cut and Learn for Unsupervised Object Detection and Instance Segmentation" and "VideoCutLER: Surprisingly Simple Unsupervised Video Instance Segmentation"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IOU threshold used for DropLoss

VGrondin opened this issue · comments

Hello, I am a bit confused with the droploss threshold. From my understanding, a high threshold = more loss (the model is penalized for exploring), while a low threshold encourage the model to explore. This seems to be the case when I look at the code:

weights = iou_max.le(self.droploss_iou_thresh).float()
weights = 1 - weights.ge(1.0).float()
losses = self.box_predictor.losses(predictions, proposals, weights=weights.detach())

However the wording in the paper says the opposite:

Finally, in Table 8d, we vary the IOU threshold used for DropLoss. With a high threshold, we ignore the loss for a higher number of predicted regions while encouraging the model to explore. 0:01 works best for the trade-off between exploration and detection performance.

Hello! DropLoss is a technique that lowers the loss for proposals with an IoU (Intersection over Union) with ground truths that are smaller than the self.droploss_iou_thresh value. If you set a high threshold, the model will explore more regions.

To understand better, let's take an example of three proposals (P1, P2, P3) with IoUs of 0.002, 0.02, and 0.2, respectively:

  • When self.droploss_iou_thresh=0.001, all losses remain unchanged, so the total_loss would be the sum of the losses for all three proposals: total_loss = loss(P1) + loss(P2) + loss(P3)
  • When self.droploss_iou_thresh=0.1, the losses for P1 and P2 are dropped, so the total_loss would be the loss for P3: total_loss = loss(P3)
  • When self.droploss_iou_thresh=1.0, all losses are dropped, so the total_loss would be 0.

Using a higher threshold will lead to a higher drop rate, but there is a trade-off between exploration and exploitation. Simply encouraging the model to explore new regions may cause it to fail to fit the training data, leading to meaningless predictions.

I see, so increasing by only 1% the "tolerance" for bounding box IoU has a surprisingly big impact on model training. Very interesting and thanks for the clarification.