Deep Learning · TEE · section
One filter over multiple channels: all contributions go into one cell
Convolutional neural networks
Definition. Multi-channel convolution contracts the kernel's spatial and input-channel dimensions to produce one output value per filter at each spatial location. Different filters have independent learned kernels.
Explanation and working
1. Separate spatial size from depth
Imagine a 1 × 1 spatial location with three input channels [2, 5, 1]. A 1 × 1 filter still has one weight for each channel. Suppose its weights are [0.1, −0.2, 0.5] and its bias is 0.3.
z=0.1(2)+(-0.2)(5)+0.5(1)+0.3z=0.2-1+0.5+0.3=0The three channels contributed to one output value. A single filter creates one output channel, even when its input has several channels.
2. A larger filter has one spatial grid per input channel
A 3 × 3 filter on a three-channel input has three 3 × 3 weight grids, totaling 27 weights. At one output location, calculate the nine products for channel 1, nine for channel 2 and nine for channel 3. Add all 27 products and then add the filter's one bias.
The channel-wise sums are intermediate contributions; do not treat them as three final output channels unless three distinct filters were specified.
3. What changes when there are several filters?
Each filter has its own full-depth weight set and bias. Four filters give four independent sums at each output location, so the result has four channels. The filters all receive the same input depth.
For three input channels and four 3 × 3 filters, parameters are (27 + 1) × 4 = 112. Moving those filters over more image locations reuses these same 112 parameters.
4. One-by-one does not mean one weight
A 1 × 1 convolution with 64 input channels and 16 filters has 64 weights and one bias per filter: (64 + 1) × 16 = 1,040 parameters. It mixes channel information at each spatial position. With 16 outputs it reduces depth from 64 to 16; height and width stay unchanged when stride is 1 and no padding is needed.
This is the channel-reduction idea used by Inception bottlenecks and some residual projections. Spatial kernel size, input depth and output-channel count must all be read separately.