ProtoSeg icon indicating copy to clipboard operation
ProtoSeg copied to clipboard

Question about loss

Open XiaoxxWang opened this issue 3 years ago • 5 comments

Hi, I'm interested in your work. After reading the paper, I'm confused that the PPC loss is achieved by contrastive learning strategy in your paper. But according to the code, the PPC loss is using cross entropy loss. Hope to receive your reply, thanks.

XiaoxxWang avatar Jul 18 '22 03:07 XiaoxxWang

Hi @XiaoxxWang, our PPC loss takes the form of InfoNCE, which is in essence a cross-entropy loss. In our context, you can understand PPC as, for each pixel, we aim to identify its assigned (positive) prototype among a set of negative prototypes.

tfzhou avatar Jul 18 '22 16:07 tfzhou

Thanks for your reply, but I still can't understand the PPC loss well. The code shows it is defined as the cross entropy of the proto_logits with proto_targets. The proto_logits is the product of the feature and the prototype, but what does proto_targets mean? It seems it is not the groundtruth , which is not agree with infoNCE loss.

XiaoxxWang avatar Jul 19 '22 14:07 XiaoxxWang

@XiaoxxWang Just read the code more carefully... For, InforNCE, you also have the groundtruth -- you know which one is the positive sample, and which one is the negative sample, but the ground-truth is obtained by free.

wenguanwang avatar Aug 29 '22 13:08 wenguanwang

Hi @XiaoxxWang, our PPC loss takes the form of InfoNCE, which is in essence a cross-entropy loss. In our context, you can understand PPC as, for each pixel, we aim to identify its assigned (positive) prototype among a set of negative prototypes.

I also have a question, the PPC code does not seem to reflect the temperature coefficient setting? Or is the temperature coefficient set to 1 by default, which is different from the 0.1 given in the paper?

yannqi avatar May 13 '23 12:05 yannqi

The temperature coefficient In paper is set as 0.1, howerver, in the source code it is neglected. In other words, it is set to 1 by default in source code. Does it have no influnce for the performance ?

fangs99 avatar Oct 14 '23 09:10 fangs99