facebookresearch / CutLER

Code release for "Cut and Learn for Unsupervised Object Detection and Instance Segmentation" and "VideoCutLER: Surprisingly Simple Unsupervised Video Instance Segmentation"
Other
913 stars 90 forks source link

IOU threshold used for DropLoss #21

Closed VGrondin closed 1 year ago

VGrondin commented 1 year ago

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.

frank-xwang commented 1 year ago

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:

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.

VGrondin commented 1 year ago

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.