ByChelsea / VAND-APRIL-GAN

[CVPR 2023 Workshop] VAND Challenge: 1st Place on Zero-shot AD and 4th Place on Few-shot AD
193 stars 22 forks source link

实验结果的可视化问题 #7

Closed archyin closed 1 year ago

archyin commented 1 year ago

跑了一下test,出来的结果是这样的, image 有那种二值化的结果图,或者把异常区域圈出来的吗?

ByChelsea commented 1 year ago

Hi! You can binarize the anomaly map by selecting a threshold. I recommend using the optimal threshold obtained when calculating the F1-max score:

precisions, recalls, thresholds = precision_recall_curve(label, predict)
f1_scores = (2 * precisions * recalls) / (precisions + recalls)
f1_max = np.max(f1_scores[np.isfinite(f1_scores)])
f1_max_index = np.argmax(f1_scores[np.isfinite(f1_scores)])

where f1_max represents the F1-max score, and thresholds[f1_max_index] is the corresponding optimal threshold.

archyin commented 1 year ago

Hi! You can binarize the anomaly map by selecting a threshold. I recommend using the optimal threshold obtained when calculating the F1-max score:

precisions, recalls, thresholds = precision_recall_curve(label, predict)
f1_scores = (2 * precisions * recalls) / (precisions + recalls)
f1_max = np.max(f1_scores[np.isfinite(f1_scores)])
f1_max_index = np.argmax(f1_scores[np.isfinite(f1_scores)])

where f1_max represents the F1-max score, and thresholds[f1_max_index] is the corresponding optimal threshold.

每类图像集用同一个阈值吗?

ByChelsea commented 1 year ago

Yes, this is a viable approach.