Answers.Body: <p>I am assuming the images you gave the model all contain sheep. This is what i understand from your question.</p>
  
  <p>Any model that you build will be based on the data that you give (training data) and your code. In your case, if you only give images that contains sheeps, and then you test it with no sheep and a background the model hasn't seen, it will search through all of its node, derived from your training data, to see which one is closest to the image you gave. Based on the information given, the only 'route' your cnn model can take is the one with sheeps on it, because you only gave images of sheeps for it to learn.</p>
  
  <p>Here are a few suggestions that i can give you:</p>
  
  <ul>
  <li>Give your model images with no sheep and different backgrounds so it can handle cases where there are no sheeps</li>
  <li>Or you can add a piece of code to your model that tells it to default to some value if certain conditions aren't met (If the model doesn't 'see enough' sheep and background, it defaults to 'unknown image' or whatever you choose)</li>
  </ul>
  
  <p>You are on the right path though! Since you are playing around with a binary classifier, you should definitely feed images with and without sheeps so that it can identify the two cases. Remember, a binary classifier is optimal when you give it 2 things to look out for, such as identifying images with and without sheep.</p>
  
  <p>Here are some reading materials that you can brush up on to get a better basic understanding of how CNN works, personally i found the video helpful on the second link:</p>
  
  <ul>
  <li><a href="https://becominghuman.ai/what-exactly-does-cnn-see-4d436d8e6e52" rel="nofollow noreferrer">https://becominghuman.ai/what-exactly-does-cnn-see-4d436d8e6e52</a></li>
  <li><a href="https://brohrer.github.io/how_convolutional_neural_networks_work.html" rel="nofollow noreferrer">https://brohrer.github.io/how_convolutional_neural_networks_work.html</a></li>
  </ul>
  
  <p>Also, i find google images helps me alot in terms of visualizing binary classifier as a concept.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-22T15:36:36.990Z
Answers.Text: Hi Firdaus, thank you for the information. I am currently using 2 classes in my binary (one of only "sheep" and one of "only backgrounds".  Are you saying that I should have two classes, one of "sheep + backgrounds" and one of "backgrounds only"?  Also, I think my original question is more of "if I feed an image to my classifier that it has never seen before (like I've never shown it an "ocean" background but now I do) what would it say, sheep or background?"
Answers.UserDisplayName: Mecho Engineer
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-22T18:10:46.123Z
Answers.Text: Your model should say 'background' because of the lack of sheep. The goal of using a binary classifier is **only** to identify two, and only two, distinct things. So your classes are really 'sheep' and 'no sheep', not 'sheep' and 'background'. An example would be a binary classifier to tell images of male and female, the classes would be 'male' and 'female'. Another example would be a binary classifier to tell images of empty plates and plates with food, the classes would be 'empty' and 'not empty'. See what I mean by two distinct things? Hope this helps!
Answers.UserDisplayName: Firdaus Indradhirmaya
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-24T05:33:57.983Z
Answers.Text: I'm still having a bit of trouble.  Would it be better to have a set of images of only sheep (like on a black background) and then have a set of images of only backgrounds to be my two classes?  Or would it be better to have sheep on background and then no sheep on background?  I ask because I'm trying the later option right now and not having good luck with it.
Answers.UserDisplayName: Mecho Engineer
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-24T12:35:48.297Z
Answers.Text: For simplicity sake you should try to to have a sheep on background and no sheep on background. But ultimately, you would want to have your CNN detect objects, in this case sheep. Because your ideal model would be to give any image and detect if there are sheep or not. The article i gave might help you a bit on CNN object detection
  
  https://towardsdatascience.com/r-cnn-for-object-detection-a-technical-summary-9e7bfa8a557c
Answers.UserDisplayName: Firdaus Indradhirmaya
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-21T08:32:56.430Z
Answers.LastActivityDate: 2020-04-21T11:20:51.347Z
Answers.LastEditDate: 2020-04-21T11:20:51.347Z
Answers.UserDisplayName: Firdaus Indradhirmaya
Body: <p>I've been messing around with an Open Set, Binary Classifier and am having trouble with it.  I'm sure there are a lot of reasons for that trouble.</p>
  <p>One thing I am struggling with is, what does the model predict if it has never seen the image before?</p>
  <p>An example would be if I'm trying to detect sheep across all background scenes.  If I train a binary classification set with one class having lots of sheep in it and the other class having lots of various backgrounds, what would the model predict if it came across a background it had never seen before with no sheep in it?  [mine is telling me &quot;sheep&quot; and I don't know why]</p>
  
Tags: <machine-learning><convolutional-neural-networks><prediction>
Title: What does the model predict if it has never seen the image before?
UserDisplayName: Mecho Engineer
ThreadText: # What does the model predict if it has never seen the image before?
  
  (Asked by: username_0 on 2020-04-20)
  
  I've been messing around with an Open Set, Binary Classifier and am having trouble with it. I'm sure there are a lot of reasons for that trouble.
  
  One thing I am struggling with is, what does the model predict if it has never seen the image before?
  
  An example would be if I'm trying to detect sheep across all background scenes. If I train a binary classification set with one class having lots of sheep in it and the other class having lots of various backgrounds, what would the model predict if it came across a background it had never seen before with no sheep in it? [mine is telling me "sheep" and I don't know why]
  
  **Tags:** machine-learning, convolutional-neural-networks, prediction
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-04-21. Score: 1
  
  I am assuming the images you gave the model all contain sheep. This is what i understand from your question.
  
  Any model that you build will be based on the data that you give (training data) and your code. In your case, if you only give images that contains sheeps, and then you test it with no sheep and a background the model hasn't seen, it will search through all of its node, derived from your training data, to see which one is closest to the image you gave. Based on the information given, the only 'route' your cnn model can take is the one with sheeps on it, because you only gave images of sheeps for it to learn.
  
  Here are a few suggestions that i can give you:
  
  * Give your model images with no sheep and different backgrounds so it can handle cases where there are no sheeps
  * Or you can add a piece of code to your model that tells it to default to some value if certain conditions aren't met (If the model doesn't 'see enough' sheep and background, it defaults to 'unknown image' or whatever you choose)
  
  You are on the right path though! Since you are playing around with a binary classifier, you should definitely feed images with and without sheeps so that it can identify the two cases. Remember, a binary classifier is optimal when you give it 2 things to look out for, such as identifying images with and without sheep.
  
  Here are some reading materials that you can brush up on to get a better basic understanding of how CNN works, personally i found the video helpful on the second link:
  
  * <https://becominghuman.ai/what-exactly-does-cnn-see-4d436d8e6e52>
  * <https://brohrer.github.io/how_convolutional_neural_networks_work.html>
  
  Also, i find google images helps me alot in terms of visualizing binary classifier as a concept.
  
  > **Comments:**
  > **username_0**: Hi username_1, thank you for the information. I am currently using 2 classes in my binary (one of only "sheep" and one of "only backgrounds".  Are you saying that I should have two classes, one of "sheep + backgrounds" and one of "backgrounds only"?  Also, I think my original question is more of "if I feed an image to my classifier that it has never seen before (like I've never shown it an "ocean" background but now I do) what would it say, sheep or background?"  
  > **username_1**: Your model should say 'background' because of the lack of sheep. The goal of using a binary classifier is **only** to identify two, and only two, distinct things. So your classes are really 'sheep' and 'no sheep', not 'sheep' and 'background'. An example would be a binary classifier to tell images of male and female, the classes would be 'male' and 'female'. Another example would be a binary classifier to tell images of empty plates and plates with food, the classes would be 'empty' and 'not empty'. See what I mean by two distinct things? Hope this helps!  
  > **username_0**: I'm still having a bit of trouble.  Would it be better to have a set of images of only sheep (like on a black background) and then have a set of images of only backgrounds to be my two classes?  Or would it be better to have sheep on background and then no sheep on background?  I ask because I'm trying the later option right now and not having good luck with it.  
  > **username_1**: For simplicity sake you should try to to have a sheep on background and no sheep on background. But ultimately, you would want to have your CNN detect objects, in this case sheep. Because your ideal model would be to give any image and detect if there are sheep or not. The article i gave might help you a bit on CNN object detection  https://towardsdatascience.com/r-cnn-for-object-detection-a-technical-summary-9e7bfa8a557c  
  
  ---
  
  