I'm not a person who studies neural networks, or does anything that is related with that area, but I have seen a couple of seminars, videos (such as 3Blue1Brown's Series), and what I am always told is that we trying the network over some huge collection of data about what is right. For example, when we are training an AI in order for it to recognise hand written words, what we do is that we give it some hand-written letters, and let it guess the letter. If the guess is wrong, by some means, we adjust the neural network in a way that, next time it will give us the correct result with more probability (the basic description of the "learning" process might not be accurate, but it is not important for sake of the question.)

But it is like teaching some mathematical subject to a student without saying him/her the boundaries of the theorems that we supply; for example, if we teach A implies B, student might be tend to relate A with B, and when he/she has B, s/he might be tempted to say we also have A, so to make sure he/she will not do such a mistake, what we do is to show him/her a counterexample where we have B, but not A.

This - i.e teaching not only what is true, but also what is not true - especially important in the process of "learning" of a neural network, because the whole process is in a sense "unbounded" (please excuse my vagueness in here).

So, what I would do if I was working on neural networks is that; for example in the above recognition of hand written letter case: I would also show the NN some non-letter images, and also put an option in the last layer as "non-letter" with all those other letters, so that the NN should not always return a letter just to sake of producing a result for a given input, it needs to also have to option to say that "I do not know", in which case it produces the result Not a Letter.


Is there anyone that has ever applied above method to a NN, and got results ? if so, what were the result compare to the case where there is not option as "I do not know".


1 Answer 1


Yes this is done routinely. For example this is how the YOLO object detection and classifier system works, to give a real-world for example. In YOLO, the "non-object" classification is "background" i.e. any image segment that doesn't contain one of the types of object we are interested in.

In general, you can add an "other" class to any classifier, provided you have data examples that fit into "other" class to learn and some sense of how often "other" will occur in the production system you are aiming for. Whether you choose to do so depends on the purpose of the model.

Many toy and test models do not include an "other" category, because they are used in a closed way to assess how each machine learning system works. That includes the famous MNIST handwritten digits data set for instance, so if you read tutorials about that, there is an underlying assumption that the trained network will only be presented with other handwritten digits and its only task is to classify them. However, this is not a general assumption for machine learning classifiers in general, just related to the goal of using the MNIST data set.

Adding a new "I do not know" category does not increase the accuracy or performance of a system when that category is not important in the target production system. When such a category is required due to the nature of a task, then the performance metrics will be different - a system that has been trained with some negative examples will likely perform better in that case.

  • 1
    $\begingroup$ But how do you determine the number of I don't​ knows? $\endgroup$
    – user9947
    Jul 13, 2018 at 14:44
  • 1
    $\begingroup$ @DuttaA: there is typically only one "I don't know" class that contains everything not already classified. It is more interesting problem to decide how many "I don't know" data examples to provide, and how varied they should be. The pragmatic answer there is whatever leads to the best performance in production, which hopefully goes through a test and QA phase using realistic data. $\endgroup$ Jul 13, 2018 at 15:05
  • 1
    $\begingroup$ Let's say somehow we confine the weights of an NN to a universal set of animals only...I.e. they can only have weights to classify animals...Now say it has 2 classes dog and I don't know...Now if a wolf is supplied it'll be most definitely classified as dog...How can we circumvent this problem? I thought to have many I don't know classes and assigning one to the wolf depending on distances of final output...I.e in humans you don't know a word is much different form you don't know a chemical..But since they are dissimilar you assign them to different I don't knows in ur brain. $\endgroup$
    – user9947
    Jul 13, 2018 at 16:00
  • 2
    $\begingroup$ @DuttA: Humans who have seen only dogs and cats before, who then see a wolf, will almost definitely think that the wolf is a dog, too. You circumvent this problem by providing examples of the "other" class (in this case pictures of a wolf) correctly labeled (as "other"). There are perhaps more interesting scenarios where classes are created in response to important details - in the dog/wolf scenario for a human after they learn some more things that make the animal different - it's wild habitat and different behaviour. There might be some research about that, but it seems a different question. $\endgroup$ Jul 13, 2018 at 16:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .