Answers.Body: <p>Yes this is done routinely. For example this is how the <a href="https://towardsdatascience.com/yolo-you-only-look-once-real-time-object-detection-explained-492dc9230006" rel="noreferrer">YOLO object detection</a> 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.</p>
  
  <p>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. </p>
  
  <p>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.</p>
  
  <p>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 <em>required</em> 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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-13T15:05:50.570Z
Answers.Text: @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.
Answers.UserDisplayName: Neil Slater
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-13T16:06:21.013Z
Answers.Text: @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.
Answers.UserDisplayName: Neil Slater
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-13T12:43:58.817Z
Answers.LastActivityDate: 2018-07-13T12:52:30.547Z
Answers.LastEditDate: 2018-07-13T12:52:30.547Z
Answers.UserDisplayName: Neil Slater
Body: <p>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 <a href="https://www.youtube.com/watch?v=aircAruvnKk&amp;frags=pl%2Cwn" rel="noreferrer">3Blue1Brown's Series</a>), 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.)</p>
  
  <p>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.</p>
  
  <p>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).</p>
  
  <p>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 <em>Not a Letter</em>.</p>
  
  <h2> Question </h2>
  
  <p>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".</p>
  
Tags: <neural-networks><deep-learning><backpropagation><learning-algorithms>
Title: Why not teach to a NN not only what is true, but also what is not true?
UserDisplayName: Our
ThreadText: # Why not teach to a NN not only what is true, but also what is not true?
  
  (Asked by: username_0 on 2018-07-13)
  
  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](https://www.youtube.com/watch?v=aircAruvnKk&frags=pl%2Cwn)), 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*.
  
  ## Question
  
  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".
  
  **Tags:** neural-networks, deep-learning, backpropagation, learning-algorithms
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-07-13. Score: 7
  
  Yes this is done routinely. For example this is how the [YOLO object detection](https://towardsdatascience.com/yolo-you-only-look-once-real-time-object-detection-explained-492dc9230006) 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.
  
  > **Comments:**
  > **username_1**: @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.  
  > **username_1**: @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.  
  
  ---
  
  