Answers.Body: <p>The pooling operation in a CNN is applied <em>independently</em> to each layer and the resulting feature maps are disjoint. This is the very reason that in most schematics depicting a certain CNN architecture, we obtain three output maps from an input image (corresponding to the convolutions and pooling operations performed on the RGB channels separately).</p>
  
  <p><a href="https://i.sstatic.net/Lkl5q.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Lkl5q.png" alt="CNN"></a></p>
  
  <p>Each channel in an image captures a set of information that might not be demonstrated by the other channels owing to the <em>color receptivity</em>. Hence, pooling performed independently is intuitive, in the sense that a group of pixels in the Red Channel may not provide similar features as the same set of pixels in a Blue or Green channel. Thus comparison of pixels is restricted within a channel.</p>
  
  <p>The following image provides a visualization of the RGB channels converted to greyscale. Note the brightness of the Red Color (comparing with the color-image) in the three different channels for a better intuition: 
  <a href="https://i.sstatic.net/KRG3v.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/KRG3v.png" alt="Channel"></a>
  <a href="https://en.wikipedia.org/wiki/Channel_(digital_image)#RGB_color_sample" rel="nofollow noreferrer">[Image Source]</a></p>
  
  <p>Finally, to feed the multi-dimensional outputs of the Convolutional Layers to a Fully Connected layer, the feature maps are stacked along the depth dimension and flattened to form a vector. This ensures that the Dense layer learns to classify images (using a Softmax activation in the final Dense layer) based on the non-linear combinations of these high-level features. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-05T19:55:43.757Z
Answers.LastActivityDate: 2020-02-05T21:13:49.560Z
Answers.LastEditDate: 2020-02-05T21:13:49.560Z
Answers.UserDisplayName: s_bh
Answers.Body: <p>The pooling operation is applied to the output of the convolution layer. More precisely, it is applied separately for each of the input channels (or slices). So, if the pooling layer receives an input volume of <span class="math-container">$H_i \times W_i \times D$</span>, then it will produce an output volume <span class="math-container">$H_o \times W_o \times D$</span>, so the depth of the output volume is equal to the depth of the input volume. There is no sum involved in the pooling operation. For example, in the case of max pooling, you will choose the maximum number of a certain 2D window of values. You do this for each of the input channels.</p>
  
  <p>In the article (which is part of some course notes) <a href="http://cs231n.github.io/convolutional-networks/#pool" rel="nofollow noreferrer">Convolutional Neural Networks: Architectures, Convolution / Pooling Layers</a>, Andrej Karpathy says</p>
  
  <blockquote>
    <p>Pooling layer downsamples the volume spatially, independently in each depth slice of the input volume.</p>
  </blockquote>
  
  <p>The following diagram (a screenshot of one of the figures from the mentioned article) should provide some intuition behind the pooling operation.</p>
  
  <p><a href="https://i.sstatic.net/pcJO9.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pcJO9.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-05T15:39:20.437Z
Answers.LastActivityDate: 2020-02-05T15:39:20.437Z
Answers.UserDisplayName: nbro
Body: <p>When using convolutional networks on images with multiple channels, do we max pool after we sum the feature map from each channel, or do we max pool each feature map separately and then sum? </p>
  
  <p>What's the intuition behind this, or is there a difference between the two?</p>
  
Tags: <convolutional-neural-networks><convolution>
Title: When is max pooling exactly applied in convolutional neural networks?
UserDisplayName: Joel
ThreadText: # When is max pooling exactly applied in convolutional neural networks?
  
  (Asked by: username_0 on 2020-02-05)
  
  When using convolutional networks on images with multiple channels, do we max pool after we sum the feature map from each channel, or do we max pool each feature map separately and then sum?
  
  What's the intuition behind this, or is there a difference between the two?
  
  **Tags:** convolutional-neural-networks, convolution
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-02-05. Score: 2
  
  The pooling operation in a CNN is applied *independently* to each layer and the resulting feature maps are disjoint. This is the very reason that in most schematics depicting a certain CNN architecture, we obtain three output maps from an input image (corresponding to the convolutions and pooling operations performed on the RGB channels separately).
  
  [![CNN](https://i.sstatic.net/Lkl5q.png)](https://i.sstatic.net/Lkl5q.png)
  
  Each channel in an image captures a set of information that might not be demonstrated by the other channels owing to the *color receptivity*. Hence, pooling performed independently is intuitive, in the sense that a group of pixels in the Red Channel may not provide similar features as the same set of pixels in a Blue or Green channel. Thus comparison of pixels is restricted within a channel.
  
  The following image provides a visualization of the RGB channels converted to greyscale. Note the brightness of the Red Color (comparing with the color-image) in the three different channels for a better intuition:
  [![Channel](https://i.sstatic.net/KRG3v.png)](https://i.sstatic.net/KRG3v.png)
  [[Image Source]](https://en.wikipedia.org/wiki/Channel_(digital_image)#RGB_color_sample)
  
  Finally, to feed the multi-dimensional outputs of the Convolutional Layers to a Fully Connected layer, the feature maps are stacked along the depth dimension and flattened to form a vector. This ensures that the Dense layer learns to classify images (using a Softmax activation in the final Dense layer) based on the non-linear combinations of these high-level features.
  
  
  ---
  
  ### Answer by username_2 on 2020-02-05. Score: 2
  
  The pooling operation is applied to the output of the convolution layer. More precisely, it is applied separately for each of the input channels (or slices). So, if the pooling layer receives an input volume of $H\_i \times W\_i \times D$, then it will produce an output volume $H\_o \times W\_o \times D$, so the depth of the output volume is equal to the depth of the input volume. There is no sum involved in the pooling operation. For example, in the case of max pooling, you will choose the maximum number of a certain 2D window of values. You do this for each of the input channels.
  
  In the article (which is part of some course notes) [Convolutional Neural Networks: Architectures, Convolution / Pooling Layers](http://cs231n.github.io/convolutional-networks/#pool), Andrej Karpathy says
  
  > Pooling layer downsamples the volume spatially, independently in each depth slice of the input volume.
  
  The following diagram (a screenshot of one of the figures from the mentioned article) should provide some intuition behind the pooling operation.
  
  [![enter image description here](https://i.sstatic.net/pcJO9.png)](https://i.sstatic.net/pcJO9.png)
  
  
  ---
  
  