1

In image classification, there are sometimes images that do not fit in any category.

For example, if I build a CNN in Keras to classify Dogs and Cats, does it help (in terms of training time and performance) to create an "other" (or "unclassified") category in which images of houses, people, birds, etc., are classified? Is there any research paper that discusses this?

A similar question was asked before here, but, unfortunately, it has no answer.

nbro
  • 39,006
  • 12
  • 98
  • 176
  • 2
    Related question and my answer: https://ai.stackexchange.com/questions/17721/why-do-cnns-sometimes-make-highly-confident-mistakes-and-how-can-one-combat-th/17722#17722 basically you need to use a Bayesian neural network which produces good epistemic uncertainty in order to do out of distribution detection – Dr. Snoopy Mar 09 '21 at 12:26
  • Other similar questions have been asked here in the past: [this](https://ai.stackexchange.com/q/4889/2444), [this](https://ai.stackexchange.com/q/18745/2444) or [this](https://ai.stackexchange.com/q/26175/2444). – nbro Mar 10 '21 at 00:38
  • Does this answer your question? [In a CNN, does each new filter have different weights for each input channel, or are the same weights of each filter used across input channels?](https://ai.stackexchange.com/questions/5769/in-a-cnn-does-each-new-filter-have-different-weights-for-each-input-channel-or) – Pluviophile Mar 10 '21 at 06:50

1 Answers1

1

It is not advisable because if you use an "other" class, you are just increasing problems for your network. Since "other" means not dog and not cat, then, what common feature does it have? Most of the time the "other" images won't have many features in common. If they do, then go ahead and make an "other" class.

There is a better way: if the probabilities for both cat and dog are less than a threshold (you need to decide that, take, 0.5), then, you can say it is an "other" object.

nbro
  • 39,006
  • 12
  • 98
  • 176
Abhishek Verma
  • 858
  • 3
  • 6
  • Thank you. If I know that some image categories (for ex. horses) will appear often but they are not of practical interest (my goal is to only tag Cats and Dogs), does it in that case make sense for model performance to make a third category? – Ruthger Righart Mar 09 '21 at 10:37
  • It only makes sense if the third class has visual features similar to the classes of interest. Since, it will be a source of confusion in decision, it makes sense to make the network to learn to separate them out. On the other hand, if confusion is happening then you can increase the threshold for classification. – Abhishek Verma Mar 09 '21 at 10:45