How to classify a data as not matching any label I'm creating a supervised convnet which recognizes a phrase in a regional language.

For example:


  I have a dataset which contains 100 sounds for labels A and another 100 sounds for labels B. Now normal operation of the network is to differentiate a sound between label A and label B.


But let's say that I give a new sound to the network to classify, which is actually neither A nor B. I want the neural net to tell me that it doesn't qualify any of the labels.

How can I achieve this?
Let's phrase it another way, decomposing into two problems:


given a sound, we want to know if it's of class A
given a sound, we want to know if it's of class B


This way of putting it is valuable to some techniques, notably "one-class classification" and "PU learning" (learning from positive and unlabeled examples). These techniques are very relevant when you want to know "does my item follow a given distribution D?", which is exactly what you're looking for.

Still, if you have (or can collect) a lot of data that is neither A nor B, you may simply label it as a garbage class C and use a common classifier - however, it may actually be harmful, because you're likely assuming wrong things about class C [Li, Liu and Ng, "Negative Training Data can be Harmful to Text Classification", 2010]. It could work and is much simpler to develop, may be good enough depending on your case.