Answers.Body: <p>According to your example:</p>
  
  <p>Trees will likely be in the bottom half of the image. Still, you will not know whether there will be one, two or five trees. Thanks to translation invariance property of CNN's, each tree will activate filters responsible for tree detection. You still need to handle those few exceptions where trees are on hill.</p>
  
  <p>To achieve better results in this particular case, you might want to consider some kind of focus mechanism, that will try to get rid of unwanted part of picture, in case when there are (for example) no hills. Take a look at <a href="https://arxiv.org/abs/1506.02025" rel="nofollow noreferrer">Spatial Transformer Networks</a>. During training it learns to predict spatial transformation (for example zoom) that will help "main" classifier to predict class of image.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-24T16:13:01.040Z
Answers.LastActivityDate: 2018-07-24T16:13:01.040Z
Answers.UserDisplayName: don_pablito
Answers.Body: <p>I think, your assumption about the location of trees in images is quite incorrect. Just google image search "landscape" (if not already) and you will see almost equal number of images where the trees constitute top part of the image to those images where they lie in only the middle and bottom part.</p>
  
  <p>Talking about the CNN, it automatically learns (thats the beauty!) the properties of an object which are there in the training images. By properties I mean the object's likely position, location, its shape color etc. If you visualize the CNN layer (mostly later layers) output, using <a href="https://jacobgil.github.io/deeplearning/class-activation-maps" rel="nofollow noreferrer">class activated maps</a>, you can see what CNN has learnt and paying attention to. Also, you can <a href="https://jacobgil.github.io/deeplearning/filter-visualizations" rel="nofollow noreferrer">visualize the filters</a> (or kernels) that are learned by the CNN.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-25T06:07:06.200Z
Answers.Text: maybe it was a bad one but the tree was just an example man
Answers.UserDisplayName: simplename
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-25T06:31:42.163Z
Answers.Text: Ya I got your point. It goes with pretty much everything except when you use CNN for self driving cars or any specific applications where the object detection area can be defined.
Answers.UserDisplayName: mausamsion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-25T01:02:27.277Z
Answers.LastActivityDate: 2018-05-25T01:24:47.677Z
Answers.LastEditDate: 2018-05-25T01:24:47.677Z
Answers.UserDisplayName: mausamsion
Body: <p>Various texts on using CNNs for object detection in images talk about how their translation invariance is a good thing. Which makes sense for tasks where the object could be anywhere in the image. Let's say detecting a kitten in household images.</p>
  
  <p>But let's say, you already have some information about the likely position of the object of interest in the image. For example, for detecting trees in a dataset of images of landscapes. Here in <em>most cases</em>, the trees are going to be in the bottom half of the image while in <em>some cases</em> they might be at the top (because it's on a hill or whatever). So you want your neural network to learn that information -- that trees are likely connected to the bottom part of the image (ground). Is this possible using the CNN paradigm? </p>
  
  <p>Thank you</p>
  
Tags: <neural-networks><convolutional-neural-networks><object-recognition>
Title: Can translational invariance of CNNs be unwanted if object is likely in certain positions?
UserDisplayName: simplename
ThreadText: # Can translational invariance of CNNs be unwanted if object is likely in certain positions?
  
  (Asked by: username_0 on 2018-05-22)
  
  Various texts on using CNNs for object detection in images talk about how their translation invariance is a good thing. Which makes sense for tasks where the object could be anywhere in the image. Let's say detecting a kitten in household images.
  
  But let's say, you already have some information about the likely position of the object of interest in the image. For example, for detecting trees in a dataset of images of landscapes. Here in *most cases*, the trees are going to be in the bottom half of the image while in *some cases* they might be at the top (because it's on a hill or whatever). So you want your neural network to learn that information -- that trees are likely connected to the bottom part of the image (ground). Is this possible using the CNN paradigm?
  
  Thank you
  
  **Tags:** neural-networks, convolutional-neural-networks, object-recognition
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-07-24. Score: 3
  
  According to your example:
  
  Trees will likely be in the bottom half of the image. Still, you will not know whether there will be one, two or five trees. Thanks to translation invariance property of CNN's, each tree will activate filters responsible for tree detection. You still need to handle those few exceptions where trees are on hill.
  
  To achieve better results in this particular case, you might want to consider some kind of focus mechanism, that will try to get rid of unwanted part of picture, in case when there are (for example) no hills. Take a look at [Spatial Transformer Networks](https://arxiv.org/abs/1506.02025). During training it learns to predict spatial transformation (for example zoom) that will help "main" classifier to predict class of image.
  
  
  ---
  
  ### Answer by username_2 on 2018-05-25. Score: 1
  
  I think, your assumption about the location of trees in images is quite incorrect. Just google image search "landscape" (if not already) and you will see almost equal number of images where the trees constitute top part of the image to those images where they lie in only the middle and bottom part.
  
  Talking about the CNN, it automatically learns (thats the beauty!) the properties of an object which are there in the training images. By properties I mean the object's likely position, location, its shape color etc. If you visualize the CNN layer (mostly later layers) output, using [class activated maps](https://jacobgil.github.io/deeplearning/class-activation-maps), you can see what CNN has learnt and paying attention to. Also, you can [visualize the filters](https://jacobgil.github.io/deeplearning/filter-visualizations) (or kernels) that are learned by the CNN.
  
  > **Comments:**
  > **username_0**: maybe it was a bad one but the tree was just an example man  
  > **username_2**: Ya I got your point. It goes with pretty much everything except when you use CNN for self driving cars or any specific applications where the object detection area can be defined.  
  
  ---
  
  