jakesnell/prototypical-networks

How to detect a untrained class image as unknown one, when passed to query images?

Opened this issue · 1 comments

Hello,Could you help me how to identify a new image class, on which the model is not trained on that class in query images as unknown one?

Thanks in advance

Hi, thank you for your interest. This is not a problem handled by our paper. However, one thing you could try is to look at the distribution of base classes in the embedding space. Ideally, all the training examples will cluster around a single prototype per class. So you could compute a prototype for each base class as the mean of the corresponding examples in the train set. Then, if you want to detect a novel class, you can compute the distance to each of the base prototypes. If the distance exceeds a threshold, you could conclude it's a new class. If you want a probabilistic interpretation, you can imagine a mixture of Gaussian model in the latent space with one Gaussian per base class. If the query example has low likelihood under this density model, then it's likely a novel class.