mathetes
mathetes

Reputation: 12107

Machine learning: how to identify if there is no object of trained classes in image

if I train a deep neural network with (say) 10 classes and I feed the network a completely different image, is it reasonable to expect that the output layer's cells will not activate much, so I will know there is no object of the trained classes in the image?

My intuition says "Yes", but is it so? And what would be the best approach to this?

Thanks

Upvotes: 11

Views: 4595

Answers (2)

John Wakefield
John Wakefield

Reputation: 527

The answer to your question very much depends on your network architecture and the parameters used to train it. If you are trying to protect against false positives, we can typically set an arbitrary threshold value on the relevant output nodes.

More generally, learning algorithms mostly take the form of “closed set” recognition, where all testing classes are known at training time. However, a more realistic scenario for vision applications is “open set” recognition, where an incomplete knowledge of the world is present at training time and unknown classes can be submitted during testing.

This is an on-going area of research - please see this Open Set Recognition web page for plenty of resources on the subject.

Upvotes: 5

lejlot
lejlot

Reputation: 66815

During the supervised training you usually assume that during training you get complete representation of the future types of objects. Typically - these are all labeled instances. In your case - there are also "noise" instances, thus there are basically two main approaches:

  • As multi-class neural network has K output neurons, each representing the probability of being a member of a particular class, you can simply condition on these distribution to say that the new object does not belong to any of them. One particular approach is to check if min(p(y|x))<T (where p(y|x) is the activation of output neuron) for some threshold T. You can either set this value by hand, or through analysis of you "noise" instances (with you do have some for training). Simply pass them through your network and compare what value of T gives you best recognition rate
  • Add another one-class classifier (anomaly detector) before your network - so you will end up with the sequence of two classifiers, first is able to recognize if it is a noise or element of any of your classes (notice, that this can be trained without access to noise samples, see one-class classification or anomaly detection techniques.

You could also add another output to the network to represent noise, but this probably will not work well, as you will force your network to generate consistent internal representation for both noise vs data and inter-class decisions.

Upvotes: 12

Related Questions