liyunsheng13 / BDL

MIT License
222 stars 30 forks source link

About confidence threshold in SSL #50

Closed DaehanKim-Korea closed 2 years ago

DaehanKim-Korea commented 2 years ago
    for i in range(19):
        x = predicted_prob[predicted_label==i]
        if len(x) == 0:
            thres.append(0)
            continue        
        x = np.sort(x)
        thres.append(x[np.int(np.round(len(x)*0.5))])
    print thres
    thres = np.array(thres)
    thres[thres>0.9]=0.9
    print thres

In the code above, applying 0.5(len(x) * 0.5) seems to get the median of confidence per class. In some cases, the corresponding confidence value could be 0.4 or 0.6. Is that right?

If my interpretation is correct, are there any other references on how to assign these pseudo-labels? If not, is it a technical skill?

liyunsheng13 commented 2 years ago

You are right. For some classes with rare pixels, the threshold might be much lower than other classes. There are a lot of papers working on looking for thresholds to generate pseudo-labels for domain adaptation. In our implementation, we just use the most trivial one.

DaehanKim-Korea commented 2 years ago

Thank you very much for your kind reply. Good luck will always be with you in your research.