thtang / CheXNet-with-localization

Weakly Supervised Learning for Findings Detection in Medical Images
https://www.csie.ntu.edu.tw/~yvchen/f106-adl/doc/HTCMedical.pdf
GNU General Public License v3.0
314 stars 108 forks source link

where's thresholds.npy come from? #3

Closed QiaoranC closed 6 years ago

QiaoranC commented 6 years ago

Hi, i found you using different thresholds for each class, this seems interesting. How did you generate the thresholds for each class? and why?

thtang commented 6 years ago

The thresholds are set to maximize the sum of True positive rate and True negative rate for each class on the validation set. In other words, sensitivity and specificity are considered here.

QiaoranC commented 6 years ago

Emm, not fully understand why, but thanks for the explain

QiaoranC commented 6 years ago

i see this iou.oy and find_bbox_size.py, this are more like to find the best npy from a list npy. how do i generate the thresholds.npy? Thx

thtang commented 6 years ago

When doing validation, compute ROC curve for each class. sklearn.metrics.roc_curve could help you. You would get three returns, fpr, tpr and thresholds. Then find out the threshold that could maximize (tpr + (1-fpr)) for each class.

QiaoranC commented 6 years ago

got it thx again