yyliu01 / PS-MT

[CVPR'22] Perturbed and Strict Mean Teachers for Semi-supervised Semantic Segmentation
https://arxiv.org/pdf/2111.12903.pdf
MIT License
187 stars 17 forks source link

Does the prediction from the "running_inference" function rely solely on a single teacher model for estimation? #29

Closed Howard-Hsiao closed 1 year ago

Howard-Hsiao commented 1 year ago

Hello, I noticed some discrepancies between the code used for inference and the formula described in the research paper. I want to comfirm which one is recommended.

The "running_inference" function utilizes only encoder1 and decoder1 to generate predictions. This means that the function relies solely on teacher 1 for the prediction process.

with torch.no_grad():
    prediction = model.module.decoder1(model.module.encoder1(data),
                                       data_shape=[data.shape[-2], data.shape[-1]],
                                       req_feature=True)

conf_result = torch.softmax(prediction.squeeze(), dim=0).max(0)[0]
hard_result = torch.argmax(prediction.squeeze().squeeze(), dim=0)
false_mask = hard_result != target.squeeze()

Meanwhile, the inference formula described in the paper involve both teacher 1 and teacher 2. image

yyliu01 commented 1 year ago

Hi,

We only utilise single-teacher inference in sliding evaluation of Cityscape dataset to speed up the inference, because some reviewers questioned it in my rebuttal stage. Please feel free to use the ensemble result (i.e., the code in VOC), which brings slightly better performances for most of the split protocol in my experience.

Cheers, Yuyuan

Howard-Hsiao commented 1 year ago

Thank you for your prompt response. I'll proceed to experiment with the ensemble approach.