-
Describe the bug Thanks for the help! To Reproduce
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
Hi @Cassie07, It is the anomaly score that the algorithm calculates. Patchcore doesn't generate scores that fall between [0, 1]. The score may be fairly high depending on the application. Higher scores in this case would suggest a possible anomaly. The best metric, such as F1, is produced by the threshold score found by AdaptiveThreshold. Let me know if this is any clearer? |
Beta Was this translation helpful? Give feedback.
-
@samet-akcay Thanks for the response. Maybe my description is not clear. Actually, I did not focus on the scores generated by Patchcore. My issue is that I want to know the exact threshold score (optimal F1) which AdaptiveThreshold generates. I suppose this threshold should be in [0, 1]. However, I found it is larger than 1. I print the output of adaptive_threshold and I supposed this value is the threshold. Please feel free to let me know if I did not find the proper function for generating the threshold. Thank you so much! |
Beta Was this translation helpful? Give feedback.
-
Hi I was also trying to understand how adaptive threshold is determined and when it's actually applied so let me share my understanding here. During training, patchcore model outputs unnormalized values. At the end of validation epoch, threshold is computed and determined to maximize F1 score over validation set like below with
As threshold is determined with un-normalized raw model output score, the value is not limited to [0, 1]. That threshold is used during inference.
Adaptive threshold determined during training is used as part of
That's why you see normalized anomaly score as output of inference.py |
Beta Was this translation helpful? Give feedback.
-
Thanks for the clarification @fujikosu, this is more or less how the thresholding works! |
Beta Was this translation helpful? Give feedback.
Hi I was also trying to understand how adaptive threshold is determined and when it's actually applied so let me share my understanding here. During training, patchcore model outputs unnormalized values. At the end of validation epoch, threshold is computed and determined to maximize F1 score over validation set like below with
_compute_adaptive_threshold
.As threshold is determined with un-normalized raw model output s…