# What is the difference between a receptive field and a feature map?

In a CNN, the receptive field is the portion of the image used to compute the filter's output. But one filter's output (which is also called a "feature map") is the next filter's input.

What's the difference between a receptive field and a feature map?

## 1 Answer

### Feature map

A feature map is the output of the convolution operation (performed by a convolutional layer).

When you apply a kernel $$K_1$$ to the input image $$I$$ (i.e. you perform the convolution operation with $$K_1$$), you produce one feature map $$F_1$$. We can denote this operation by $$F_1 = I \circledast K_1$$. Note that the convolution (or cross-correlation) can be seen as the multiplication of the kernel $$K_1$$ with different sub-regions of the image $$I$$. Each of these multiplications produces a scalar value of the feature map $$F_1$$.

If you perform another convolution operation with another kernel $$K_2$$, you produce another feature map $$F_2$$. So, if you perform the convolution operation $$n$$ times with $$n$$ different kernels in a convolutional layer, you will get $$n$$ feature maps, which are typically concatenated to form a block of feature maps, which we can denote by $$\mathbf{F}$$. So, the total number of feature maps is equal to $$n$$, i.e. the number of kernels that you convolve with $$I$$.

Each element of a feature map $$F_i \in \mathbb{R}^{w \times h}$$, which we can denote by $$F_{i_{jk}}$$ (i.e. the element at coordinates $$j$$ and $$k$$ of the matrix $$F_i$$), can be thought of as the "activation of a neuron".

Alternatively, you can think of a feature map as a collection/map of features produced by the kernel $$K_i$$ (hence the name feature map). In other words, $$K_i$$ extracts certain features from $$I$$. Another kernel $$K_l$$ may extract other features, and so on.

### Receptive field

A receptive field is the portion of the input image that is/was used to compute the activation of a neuron (aka node) in a feature map.

So, we talk of "the receptive field of a neuron in a feature map". You can read this answer to understand more what a neuron in a convolutional layer is.

### Illustration

This illustration should summarise the descriptions above.

In the illustration above, a feature map is a 2-dimensional matrix of shape $$46 \times 46$$. There are $$100$$ feature maps (so $$100$$ kernels were convolved with the input image). The receptive field of a neuron (small pink square in the feature map) is a 3-dimensional sub-region of the image of shape $$5 \times 5 \times 3$$. Note that, in this case of a 2d-convolution, the kernel has the same depth as the input image (i.e. $$3$$).

### Receptive field of neurons in deeper layers

The output of a convolutional layer, which we denoted by $$\mathbf{F}$$ above (i.e. the concatenation of all feature maps), is the input to the next layer of the CNN. If this layer is a convolutional layer, then it will produce other feature maps $$\mathbf{F}'$$. The receptive fields of the neurons associated with these feature maps $$\mathbf{F}'$$ will not correspond to the receptive fields of the neurons associated with the feature maps produced by the first convolutional layer. In fact, as you go deeper into a CNN, the receptive field of neurons increases. You can read more about how it increases here or watch this video. That's why we can think of neurons in deeper layers as "looking at more general features of the input image".