# What is the classical way to visualize 3D filters in convolutional neural networks?

Suppose that at a layer $N$ within a CNN, my "image" is a 200$\times$200$\times$10 array. Thus, if I convolve such an array with, for example, 15 filters of size 3$\times$3$\times$10, I will end up with a new "image" whose shape is $A\times{B}\times{15}$ where $A$ and $B$ depend on the stride of the convolution.

I am thus wondering how such 3D (3$\times$3$\times$10 in my toy example) convolution filters are usually displayed as 2D images (i.e. sum or mean, ...)?

• How are you visualising your input data? Feb 28 '17 at 14:13
• If my input data are RGB images, using one channel per depth component. Feb 28 '17 at 14:35
• I don't understand how you get 200 x 200 x 10 from that, nor how you visualise it. I am asking because if you have a way that you need to visualise the input data, it is likely to inform how you visualise the convolutional filters for that input data. Or, is the 200 x 200 x 10 picked from some layer N, and these are just normal images? CNNs are used for more than images, so perhaps make it clear in the question that your input data is 2D images. Use of 3D in the title implies it is something else . . . and if the x 10 part is channels, then you are doing 2D convolution and have 2D filters. Feb 28 '17 at 14:44
• The shape 200 x 200 x 10 is a random shape (just for example purpose) that could be the shape at a given layer within the convolutional neural net, not the very first input of the network. Feb 28 '17 at 14:48
• Yes, as I said you have a 3D structure there, but it is a stack of 3 times 2D filters, not a 3D filter. It is a 2D convolution. Feb 28 '17 at 15:03

With CNNs, a common strategy is to visualize the weights. They are usually most interpretable on the first CONV layer which is looking directly at the raw pixel data, but it is possible to also show the filter weights deeper in the network.

If you want to have a look at the activation maps, you will have to display them 1 by 1 and they will be grayscale (e.g. you would display 15 AxB grayscale filters for your layer N). Check this site for more ideas: http://cs231n.github.io/understanding-cnn/

Having said that, it is unclear what you can expect to "see" on layers that are looking at a 200*200*10 cube and what action you can take afterwards.

EDIT - Additional link This article describe a new technique that tries to show the "meaning" included in the neural network layers: https://distill.pub/2018/building-blocks/ "For instance, by combining feature visualization (what is a neuron looking for?) with attribution (how does it affect the output?), we can explore how the network decides between labels like Labrador retriever and tiger cat."

I am thus wondering how such 3D (3×3×10 in my toy example) convolution filters are usually displayed as 2D images (i.e. sum or mean, ...)?

TL;DR The 3x3x10 image is displayed as 10 3x3 images

Longer Version

Each of these 15 $28$$\times$$28$$\times$$1$ images are stacked on top of each other to make a 28x28x15 image.
So, to answer your question : the $N$$\times$$N$$\times$$15$ images are split into 15 NxNX1 images and displayed.