Skip to content
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

Questions on the Outlier Detection #7

Open
limzh123 opened this issue Jul 20, 2022 · 2 comments
Open

Questions on the Outlier Detection #7

limzh123 opened this issue Jul 20, 2022 · 2 comments

Comments

@limzh123
Copy link

Hi, I have a question about outlier detection.

After executing the OpenVAE, can we know which image is the outlier?

I really appreciate any help you can provide.

@MrtnMndt
Copy link
Owner

MrtnMndt commented Jul 29, 2022

Hi @limzh123 ,

Yes, you can load your trained model with the eval_openset.py script, which will estimate outliers on the test examples of the dataset which has been trained on and several other datasets. You will then get percentages etc. back.

I'm not sure if I understand correctly, but it may be that you are asking for a function that predicts whether a single image is an outlier or not?
Unfortunately, we have not included such a function right now, as the main goal of the paper was on the continual training with open set recognition, and not the evaluation of single images.

In principle, you should be able to craft this yourself quite easily though. Given your pre-trained model, you can basically take the first half of the eval_openset script and get your Weibull distributions/models.
Then you can do the steps from lines 193 to 202 in a simplified form: get z values for your image, calculate distance, call the Weibull models to get the outlier probability.
In other words, you can do the steps inside these lines/functions, but remove all of the loop that currently do this for an entire dataset/many mini.batches.

Alternatively: if my understanding is correct you pretty much want the 7 lines in

z_dict = sample_per_class_zs(model, len(self.seen_tasks) - self.num_increment_tasks,

but replace the "sample z" part with a value from the encoder for your image and then do the distance + outlier calculations in the lines below.

Kindly let me know if this was your question.

@limzh123
Copy link
Author

Hi, yea this was my question. Thanks for your explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants