-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is the PatchCore image-level anomaly score correctly calculated? #286
Comments
Thanks @StefanoSamele-PoliMi! We'll check it out |
Adding to the discussion, if you aren't aware patchcore authors updated their paper on arxiv and upload the official implementation of the algorithm, apparently it performs even better than the result reported by you (99.2 compared to 98.0 avg) with the wide resnet 50. If you have time might be worth checking it out! |
In official patchcore work, the performance is Patchcore(99.1,98.1). |
We have found a significant difference between the implementation proposed and the one described in the paper, for the PatchCore image-level anomaly score calculation.
For a test image , they first calculate the maximum distance score as:
where is the set of patches of image and the memory bank.
They then apply a re-weighting factor to take into account if the patch is far from neighboring samples and thereby
an already rare nominal occurrence.
We underline that are the nearest neighbors of in the memory bank. In your implementation instead, you weigh according to the nearest neighbors of , choosing the distance from the furthest element as numerator, and the distances from the others as denominator.
We have tested the two scoring methods (the original one and the one proposed in this repository) on a custom dataset and no differences were registered in terms of AUCROC score. We are currently testing on some MVTEC classes.
The text was updated successfully, but these errors were encountered: