openvinotoolkit / anomalib

An anomaly detection library comprising state-of-the-art algorithms and features such as experiment management, hyper-parameter optimization, and edge inference.
https://anomalib.readthedocs.io/en/latest/
Apache License 2.0
3.86k stars 687 forks source link

[Task]: pixel/image-level AUC-ROC curve #1068

Open TorAP opened 1 year ago

TorAP commented 1 year ago

What is the motivation for this task?

I am having troubles understanding this metric.

As normally auroc curves are related to TPR (true positive rate) and FPR (false positive rate) for each classification threshhold value. But in this example we get a point on the auroc curve for every 100th step, what exactly is a point? e.g., how should I interpret 0.84 pixel-level AUC-ROC.

Screenshot 2023-05-03 at 00 01 32

Describe the solution you'd like

Maybe some insights into how to understand the pixel/image-level AUC-ROC curve? Or maybe it is just my ignorance.

Additional context

No response

djdameln commented 1 year ago

Hi, can you share the config you used to generate this image? From the layout it looks like this image was generated by weights&biases. In this case the image shows a plot of the final AUPRO or AUROC score against the global step (number of batches seen by the model). Note that the AUPRO and AUROC are single values, because they quantify the area under the ROC or PRO curve. You could verify that Anomalib also generates a plot of the ROC curve by enabling AUROC in the image- or pixel-metrics in the config.yaml, and looking for the plot in the 'Media' section of w&b, or in your local results directory under images.

TorAP commented 1 year ago

It is configured to log in WandB. So.. e.g. at training step 100 the area under the ROC (AUC-ROC) curve is 0.7ish? But is the ROC curve created by changing the threshold (between 1 and 0) for each training-step and then I just log after every 100th training-step AUC-ROC value, which then give me a AUCROC-plot of: training steps / log-interval (5000/100) = 500 - AUC-ROC points?