Answers.Body: <p>The point of a convnet, or many kinds of neural networks in general, is to go from a lot of data down to a small piece of data. In classification tasks, for example, the input is all the pixels that make up a picture of a house, and the output is just the word &quot;house&quot; (or rather a number representing the word &quot;house&quot;).</p>
  <p>Obviously this process loses information. If you go from the word &quot;house&quot;, back to a picture (i.e. you tell it &quot;draw a house&quot;) you're probably going to get a completely different house!</p>
  <p>In the style transfer task we have many numbers to describe the house picture with, not just the word &quot;house&quot;, but we still have less than the full pixel data. <em>Imagine</em> that the intermediate representation represents something like &quot;yellow wooden house with three windows and one window above and a red brick basement with 4 windows and the house is drawn at a 30 degree angle and there's a pink house to the left with two small windows below and one window above and a red roof is visible behind and above the pink house and .....&quot;</p>
  <p>If you had that representation, you could try to draw the original picture again, and the more information you have, the more accurately you can draw it. Early layers of the convnet contain information like &quot;there's a vertical line at pixel coordinates 123,456&quot; and later layers contain information like &quot;there's a yellow house at pixel coordinates 123,456&quot;, and if you get to dense layers, they may just say &quot;there's a yellow house&quot;.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-06T11:21:32.027Z
Answers.LastActivityDate: 2021-08-06T11:21:32.027Z
Answers.UserDisplayName: Criticize SE actions means ban
Answers.Body: <p>A convolution layer has a Kernel  that is matrix  smaller that the image (in many papers 3*3), so this Kernel have learnable values.</p>
  <p>The kernel is applied pixel by pixel (and dimensions, for color images), by applied I mean take the kernel centered in the pixel and multiply element-wise with the image and sum all results. This is the output for that pixel, a value that takes information from pixel's neighborhood.</p>
  <p>When you apply this many times you lose specific pixel's information, but it gains information about pixel's neighborhood. And this is good because maybe this neighborhood is a corner, a line, curve, etc. (this is what learned the kernel to identify value content, for that reason the network in d and e have more basic forms and color without detail) . if you continue applying more convolutions you will find a abstract representation of the all the input, even you can get only one number that represent that input (if you don't avoid dimension reduction with padding or other tool) and say something like &quot;oh it's a five and therefore the input is a house&quot; (in classification case).</p>
  <p>NOTE: This is very general and many details were omitted, if you want to learn more I recommend the book deep learning (Goodfellow et al., 2016) chapter 9 convolutional networks.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-06T08:09:07.420Z
Answers.LastActivityDate: 2021-09-06T08:09:07.420Z
Answers.UserDisplayName: StandardIO
Body: <p>I was reading this research paper titled 'Image Style Transfer using Convolutional Neural Networks' which as the title suggests was based on Neural Style Transfer. I came across this line which didn't make immediate sense to me.</p>
  <p><a href="https://i.sstatic.net/obxWN.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/obxWN.jpg" alt="enter image description here" /></a></p>
  <p>Here's how it went -</p>
  <blockquote>
  <p>We reconstruct the input image from from layers ‘conv1 2’ (a), ‘conv2 2’ (b), ‘conv3 2’ (c), ‘conv4 2’ (d) and ‘conv5 2’ (e) of the original VGG-Network. We find that reconstruction from lower layers is almost perfect (a–c). <em><strong>In higher layers of the network, detailed pixel information is lost while the high-level content of the image is preserved (d,e).</strong></em></p>
  </blockquote>
  <p>The line that is italicised; Why does that happen?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-06T22:54:01.740Z
Comments.Text: The excerpt you're quoting is not saying that you lose detail of an image as you go deeper, but that using a certain output of a certain layer rather than another leads to "better" **reconstructed images**. So, you may want to edit your post to clarify that.
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-07T06:15:29.650Z
Comments.Text: It says "detailed pixel information is lost". How does that mean you have better images as you go deeper in the network ?
Comments.UserDisplayName: HarshDarji
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-08T21:29:26.493Z
Comments.Text: Yes, but because you're trying to reconstruct the pixels of the images, as far as I understand.
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-09T06:30:09.293Z
Comments.Text: Ohh okay. But at the end of the CNN are the pixels reconstructed better right?
Comments.UserDisplayName: HarshDarji
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-09-05T13:40:09.367Z
Comments.Text: Does this answers your question? https://stackoverflow.com/questions/28953622/do-convolutional-neural-networks-suffer-from-the-vanishing-gradient
Comments.UserDisplayName: sam2611
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-09-06T15:21:38.587Z
Comments.Text: @sam2611 No, this is different from vanishing gradients
Comments.UserDisplayName: Criticize SE actions means ban
Tags: <convolutional-neural-networks><convolution><convolutional-layers>
Title: Why do we lose detail of an image as we go deeper into a ConvNet?
UserDisplayName: HarshDarji
ThreadText: # Why do we lose detail of an image as we go deeper into a ConvNet?
  
  (Asked by: username_0 on 2021-08-06)
  
  I was reading this research paper titled 'Image Style Transfer using Convolutional Neural Networks' which as the title suggests was based on Neural Style Transfer. I came across this line which didn't make immediate sense to me.
  
  [![enter image description here](https://i.sstatic.net/obxWN.jpg)](https://i.sstatic.net/obxWN.jpg)
  
  Here's how it went -
  
  > We reconstruct the input image from from layers ‘conv1 2’ (a), ‘conv2 2’ (b), ‘conv3 2’ (c), ‘conv4 2’ (d) and ‘conv5 2’ (e) of the original VGG-Network. We find that reconstruction from lower layers is almost perfect (a–c). ***In higher layers of the network, detailed pixel information is lost while the high-level content of the image is preserved (d,e).***
  
  The line that is italicised; Why does that happen?
  
  **Tags:** convolutional-neural-networks, convolution, convolutional-layers
  > **Comments:**
  > **username_1**: The excerpt you're quoting is not saying that you lose detail of an image as you go deeper, but that using a certain output of a certain layer rather than another leads to "better" **reconstructed images**. So, you may want to edit your post to clarify that.  
  > **username_0**: It says "detailed pixel information is lost". How does that mean you have better images as you go deeper in the network ?  
  > **username_1**: Yes, but because you're trying to reconstruct the pixels of the images, as far as I understand.  
  > **username_0**: Ohh okay. But at the end of the CNN are the pixels reconstructed better right?  
  > **username_2**: Does this answers your question? https://stackoverflow.com/questions/28953622/do-convolutional-neural-networks-suffer-from-the-vanishing-gradient  
  > **username_3**: @sam2611 No, this is different from vanishing gradients  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2021-08-06. Score: 1
  
  The point of a convnet, or many kinds of neural networks in general, is to go from a lot of data down to a small piece of data. In classification tasks, for example, the input is all the pixels that make up a picture of a house, and the output is just the word "house" (or rather a number representing the word "house").
  
  Obviously this process loses information. If you go from the word "house", back to a picture (i.e. you tell it "draw a house") you're probably going to get a completely different house!
  
  In the style transfer task we have many numbers to describe the house picture with, not just the word "house", but we still have less than the full pixel data. *Imagine* that the intermediate representation represents something like "yellow wooden house with three windows and one window above and a red brick basement with 4 windows and the house is drawn at a 30 degree angle and there's a pink house to the left with two small windows below and one window above and a red roof is visible behind and above the pink house and ....."
  
  If you had that representation, you could try to draw the original picture again, and the more information you have, the more accurately you can draw it. Early layers of the convnet contain information like "there's a vertical line at pixel coordinates 123,456" and later layers contain information like "there's a yellow house at pixel coordinates 123,456", and if you get to dense layers, they may just say "there's a yellow house".
  
  
  ---
  
  ### Answer by username_4 on 2021-09-06. Score: 1
  
  A convolution layer has a Kernel that is matrix smaller that the image (in many papers 3\*3), so this Kernel have learnable values.
  
  The kernel is applied pixel by pixel (and dimensions, for color images), by applied I mean take the kernel centered in the pixel and multiply element-wise with the image and sum all results. This is the output for that pixel, a value that takes information from pixel's neighborhood.
  
  When you apply this many times you lose specific pixel's information, but it gains information about pixel's neighborhood. And this is good because maybe this neighborhood is a corner, a line, curve, etc. (this is what learned the kernel to identify value content, for that reason the network in d and e have more basic forms and color without detail) . if you continue applying more convolutions you will find a abstract representation of the all the input, even you can get only one number that represent that input (if you don't avoid dimension reduction with padding or other tool) and say something like "oh it's a five and therefore the input is a house" (in classification case).
  
  NOTE: This is very general and many details were omitted, if you want to learn more I recommend the book deep learning (Goodfellow et al., 2016) chapter 9 convolutional networks.
  
  
  ---
  
  