Contents
  1. What Is a Channel?

What Is a Channel?

[CNN] Understanding Channels in Convolutional Neural Networks

First, TensorFlow defines the meaning of channels in input samples. A typical RGB image has 3 channels (red, green, and blue), while a monochrome image has a channels count of 1.

Second, according to MXNet, channels generally refers to the number of convolution kernels in each convolutional layer.

For example, suppose we have a 6×6×3 image sample and perform convolution using a 3×3×3 convolution kernel (filter). The input image has 3 channels, while the in_channels of the convolution kernel must match the channels of the data being convolved (the image sample in this case, so it is 3).

Next, during convolution, the 27 numbers in the convolution kernel are multiplied by their corresponding values in the sample and then summed to obtain the first result. Repeating this process eventually produces a 4×4 result.

What Is a Channel?

After the steps above, because there is only one convolution kernel, the final result is 4×4×1, and out_channels is 1.

In practice, multiple convolution kernels are used. If another convolution kernel is added here, the result will be 4×4×2.

What Is a Channel? (2)

Summary

  • The channels of the initial input image sample depend on the image type, such as RGB;
  • The out_channels produced by convolution depends on the number of convolution kernels. This out_channels also becomes the in_channels of the convolution kernel in the next convolution;
  • The in_channels of a convolution kernel is the out_channels of the previous convolution. For the first convolution, it is the sample image’s channels from item 1.