TheWho
TheWho

Reputation: 939

How to categorize image as a 'not categorized image' by using convolutional nets

In order to classify 10 type of images, I have modeled Convolutional based Sequential model by using Keras. I utilized categorical_crossentropy. My question is that although I am getting 99% accuracy on training model by including validation data, I have a problem to identify an image that does not belong to any of 10 classes. What would be the right way to do that? Any test image that is one of these types is being classified by my model perfectly fine. But if an image is not one of these types, I would like to classify it as a 'not categorized image', how can I do that?

Thank you very much for your support in advance.

Upvotes: 1

Views: 821

Answers (3)

Pierre S.
Pierre S.

Reputation: 1129

I guess your question is known as "Open Set Classification" in opposition to "Closed Set Classification" (where all testing classes are known at training time). A technic to address your problem is to train 10 "One versus All" models. For each model, you learn if the image belong to one class (positive match) or the rest of your images (negative match). Using it, if a test image has a negative match for the 10 models, it will indicate that it is an unknown class.

Hoping it helps a bit.

Upvotes: 1

Mathias
Mathias

Reputation: 173

One way is to do as Daniel describes, otherwise you could the confidence of the predicted class and threshold it, if it is below the threshold it is "non categorized"

Upvotes: 1

Daniel Möller
Daniel Möller

Reputation: 86630

Make 11 classes. One of them is "non categorized" class.

Upvotes: 3

Related Questions