user25093
user25093

Reputation: 287

How can filters later in a CNN recognize color?

Let's say the input is a 32x32 RGB image (so 32x32x3).

If a 5x5x3 filter on a first layer conv network recognizes a green-red fade, it records it's activation value on a 28x28 feature map (given a stride of 1 and padding of 0).

That feature map caries no information about color, so when it is inputed into the next conv layer, conv2, then conv2 will only learn grayscale filters.

So, how can higher level filters, like these, contain color information?

Colored Filters

From this visualization, it seems as though they don't even bother with color. Also, the colors in filters seem to become so contorted that they don't really describe what a class feature looks like. To clarify what I'm saying, notice the third set of filters pictured above. In the natural world, colors don't appear in that saturated way. My immediate reaction would be to guess that they appear as so to make generalizing easier. But, wouldn't a high level filter for a dog that has a blue tinge in the inside of it's face be detrimental to the labeling process, since most dogs don't have such color in their facial features?

Upvotes: 2

Views: 4262

Answers (2)

Tiphaine Champetier
Tiphaine Champetier

Reputation: 353

Those filters are not properly filters, except maybe for those on the left (first-layer filters). There are a visualization of the filters. Each square is the result of an optimization of the input in order to maximize the values of a feature map, corresponding to one filter. The visualization of the filter is consequently an image with the same dimension as the input.

The first-layer filters are NxNx3 (N = 7 in this case I think). It is possible to display them directly, without going through an optimization step.

Upvotes: 0

Snate
Snate

Reputation: 305

Yes, you are right, the feature maps from the convolutional layers appear to be in grayscale. If you want to visualize each of the feature maps separately, then you will only see a grayscale image. The way you can come up with such colorful images is to combine 3 filters(convolutional feature maps), assigning them R,G and B values. In this lecture you can learn more about the visualization techniques.

Upvotes: 1

Related Questions