Closed xfffrank closed 3 years ago
in_score has the "anomaly scores" for in-distribution examples, and out_score has the scores for out-of-distribution points. We'd like for in_score values to be quite distinct from out_score values to successfully perform OOD detection.
For your second question, these might be useful (the maths is complicated): https://github.com/hendrycks/outlier-exposure/issues/12 https://github.com/hendrycks/outlier-exposure/issues/14
Thanks for your quick reply! I still have two more questions. @hendrycks
Can I just apply the loss above directly for the OOD detection of binary classes ? What about one-class classification?
I'm wondering why the ROCAUC score is used instead of the accuracy in many OOD papers. Is it because the appropriate threshold depends on different outlier distributions?
Thank you so much! I'm already reading that paper and the implementation. If you don't mind, I've got two follow-up questions.
For an imbalanced dataset containing outliers, we often choose the metric of AUROC. And if I want to know whether an image is an outlier or not, I need to set a threshold for the anomaly score (perhaps based on the outlier samples I can find). Am I right?
Will the unsupervised method in https://github.com/hendrycks/ss-ood work if I need to know whether an image belongs to a specific kind of cats? I mean, if the unknown samples can come from a close but different distribution, what can we do to avoid false positive predictions (assuming in-distribution data is positive)?
Thanks a lot!
Hi, I'm new to out-of-distribution detection. After reading the paper and the code, I still cannot figure out how the out-of-distribution data is detected. I see there are two related lines of code as below.
It seems that the detection process is related to the
in_score
. But what about the prediction in a real application scenario? I'm confused. You could give me some references to read if that's easier to explain.In the training script, the cross entropy between the softmax distribution and the uniform distribution is implemented with this line.
How does
torch.logsumexp(x[len(in_set[0]):], dim=1)
represent the uniform distribution?Thanks.