Answers.Body: <p>Answer to my question is that values obtained from convolutions among different channels <strong>sum up</strong> together, therefore 3 channels after convolution with one filter give one output.</p>
  
  <p>Best explanation delivered by Andrew: <a href="https://www.coursera.org/lecture/convolutional-neural-networks/convolutions-over-volume-ctQZz" rel="nofollow noreferrer">https://www.coursera.org/lecture/convolutional-neural-networks/convolutions-over-volume-ctQZz</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-22T23:17:38.147Z
Answers.Text: I think this answer is a little bit misleading. What happens is that the kernel actually has the same depth as the depth of the input. So, if the input has 3 channels, then a $3 \times 3$ kernel is actually a $3 \times 3 \times 3$ kernel. From your explanation, it seems like you're suggesting that you perform different convolutions (with the same or different kernel?) for each channel, then sum up the results. That's somehow equivalent, but, as I said, in my opinion, conceptually more complicated than thinking that the kernel has the same depth as the input.
Answers.UserDisplayName: nbro
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-28T16:18:51.220Z
Answers.LastActivityDate: 2020-04-28T16:18:51.220Z
Answers.UserDisplayName: GKozinski
Body: <p>I wonder what happens to the 'channels' dimension (usually 3 for RGB images) after the first convolution layer in CNNs? </p>
  
  <p>In books and other sources, it is always said that the depth of the output from convolutional layers is the number of kernels (filters) in that layer. </p>
  
  <p>But, if the input image has 3 channels and we convolve each of them with <span class="math-container">$K$</span> kernels, shouldn't the depth of the output be <span class="math-container">$K * 3$</span>? Are they somehow 'averaged' or in other way combined with each other?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-27T12:26:26.300Z
Comments.Text: This question has been asked multiple times in the past. Your filters will typically have a depth equal to the depth of the input. Does this https://ai.stackexchange.com/q/17783/2444 or https://ai.stackexchange.com/a/18669/2444 answer your question? Maybe have a look at https://ai.stackexchange.com/q/3287/2444 or https://ai.stackexchange.com/q/5769/2444 too. Tell me which one answers your question, then I will mark this as a duplicate of that one.
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-27T15:08:00.783Z
Comments.Text: I would say that none of these question is excactly what I meant BUT answer to my question is somewhere among answers to this one: https://ai.stackexchange.com/q/5769/22659. The direct answer to my question is that values obtained from convolutions among different channels sum up together, therefore 3 channels after convolution with one filter give one output. The best explanation delivered by Andrew: https://www.coursera.org/lecture/convolutional-neural-networks/convolutions-over-volume-ctQZz
Comments.UserDisplayName: GKozinski
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-28T14:28:39.637Z
Comments.Text: I think you shouldn't think of kernels (or filters) as 2d matrices, but as (3d) tensors. Anyway, feel free to provide an answer to your own question (if this isn't really a duplicate)! Also, don't forget next time to tag me with `@nbro`, otherwise, I don't see your comments.
Comments.UserDisplayName: nbro
Tags: <neural-networks><deep-learning><convolutional-neural-networks><filters>
Title: What happens to the channels after the convolution layer?
UserDisplayName: GKozinski
ThreadText: # What happens to the channels after the convolution layer?
  
  (Asked by: username_0 on 2020-04-27)
  
  I wonder what happens to the 'channels' dimension (usually 3 for RGB images) after the first convolution layer in CNNs?
  
  In books and other sources, it is always said that the depth of the output from convolutional layers is the number of kernels (filters) in that layer.
  
  But, if the input image has 3 channels and we convolve each of them with $K$ kernels, shouldn't the depth of the output be $K \* 3$? Are they somehow 'averaged' or in other way combined with each other?
  
  **Tags:** neural-networks, deep-learning, convolutional-neural-networks, filters
  > **Comments:**
  > **username_1**: This question has been asked multiple times in the past. Your filters will typically have a depth equal to the depth of the input. Does this https://ai.stackexchange.com/q/17783/2444 or https://ai.stackexchange.com/a/18669/2444 answer your question? Maybe have a look at https://ai.stackexchange.com/q/3287/2444 or https://ai.stackexchange.com/q/5769/2444 too. Tell me which one answers your question, then I will mark this as a duplicate of that one.  
  > **username_0**: I would say that none of these question is excactly what I meant BUT answer to my question is somewhere among answers to this one: https://ai.stackexchange.com/q/5769/22659. The direct answer to my question is that values obtained from convolutions among different channels sum up together, therefore 3 channels after convolution with one filter give one output. The best explanation delivered by Andrew: https://www.coursera.org/lecture/convolutional-neural-networks/convolutions-over-volume-ctQZz  
  > **username_1**: I think you shouldn't think of kernels (or filters) as 2d matrices, but as (3d) tensors. Anyway, feel free to provide an answer to your own question (if this isn't really a duplicate)! Also, don't forget next time to tag me with `@nbro`, otherwise, I don't see your comments.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2020-04-28. Score: 0 | Accepted answer
  
  Answer to my question is that values obtained from convolutions among different channels **sum up** together, therefore 3 channels after convolution with one filter give one output.
  
  Best explanation delivered by Andrew: <https://www.coursera.org/lecture/convolutional-neural-networks/convolutions-over-volume-ctQZz>
  
  > **Comments:**
  > **username_1**: I think this answer is a little bit misleading. What happens is that the kernel actually has the same depth as the depth of the input. So, if the input has 3 channels, then a $3 \times 3$ kernel is actually a $3 \times 3 \times 3$ kernel. From your explanation, it seems like you're suggesting that you perform different convolutions (with the same or different kernel?) for each channel, then sum up the results. That's somehow equivalent, but, as I said, in my opinion, conceptually more complicated than thinking that the kernel has the same depth as the input.  
  
  ---
  
  