# Convolution over several channels

Subject: Deep Learning

Exam: MT2

Reader: https://deep-learning-study-room.vercel.app/#mt2/read/7/mt2-c7-s4

Canonical: https://deep-learning-study-room.vercel.app/read/dl/mt2/section/mt2-c7-s4/

**Definition.** A standard convolutional filter spans every input channel. At one spatial position, channel-wise weighted sums are accumulated and one filter bias is added, producing one scalar output in that filter's feature map.

### Explanation and working

A 3 × 3 filter receiving RGB input has depth 3, so it contains 3 × 3 × 3 weights. At one position, compute a weighted sum in each of the three channels, add those sums, and then add the filter’s one bias. One filter produces one output channel. Sixteen filters produce sixteen output channels.

![Add the channel contributions into one output cell. The filter bias is added once after those contributions.](https://deep-learning-study-room.vercel.app/assets/figures/v_channels.svg)

Diagram: Add the channel contributions into one output cell. The filter bias is added once after those contributions.. Labels: One filter combines all incoming channels | One filter combines all incoming channels | The three channel contributions join into one cell, not three separate maps. | Red channel | Weighted sum = 2 | Green channel | Weighted sum = −1 | Blue channel | Weighted sum = 4 | Add contributions and one bias | 2 + (−1) + 4 + 0.5 = 5.5 | The filter spans all three channels. Add its bias once after summing the channel | contributions.

Add the channel contributions into one output cell. The filter bias is added once after those contributions. Tap the diagram to enlarge.

**Tiny example.** At one position the red, green and blue channel sums are 2, −1 and 4. With bias 0.5, the output is 2 − 1 + 4 + 0.5 = 5.5. Do not keep three separate outputs for this one filter; they have been added.
