Looking at some old notes I took on CNN's and I wrote down that the weights in a CNN are acting like filters in a CNN but to be honest I don't really know what the weights are acting as in a CNN and was wondering if someone could explain that clearly to me.

  • $\begingroup$ You asked me to re-open this post because you wanted to get a specific answer to your question, although this question is already although somehow implicitly answered in other posts. In any case, if my answer below answers your question, you should accept it. $\endgroup$
    – nbro
    Feb 9, 2021 at 15:20
  • $\begingroup$ hi @PlayerUnknown_12, check out this minicourse about CNNs by Andrew Ng, if you're interested. I found it very helpful. Starting from second video he discusses how filters of CNNs can learn to detect edges of the objects in the images $\endgroup$
    – mark mark
    Feb 18, 2021 at 17:27

1 Answer 1


There are many resources that answer your question, but, given that you're apparently new to machine learning (ML), deep learning (DL), and neural networks (NN), let me provide a simple answer that should clarify your doubts.

The term weight in the context of ML, DL, and NN is a synonym for parameter (sometimes, in some contexts, such as linear regression, it is also known as coefficient), which can be constant (i.e. do not change during, for example, learning/training) or learnable (i.e. change during the training/learning process). In a feedforward neural network (FFNN), with and without recurrent connections, the weights are the numbers on the connections between neurons in different or same layers. They are called weights to emphasize that their role is to weigh the effect of one neuron on the other.

In a CNN, the weights are the kernels/filters of the CNN, i.e. the matrices that you use to perform the convolution (or cross-correlation) operation in a convolutional layer. So, given that CNNs perform an operation that seems to be different than the linear combination followed by the non-linear activation function in FFNNs, you could think that the weights in a CNN are not very similar to the weights in FFNNs. However, this is not fully true, as CNNs can be viewed as FFNNs (with some specific structure): maybe this answer will provide you more info about this topic. So, your notes are right!

In my opinion, the best way to understand the role of the kernels (i.e. weights) of a CNN and all the details behind the convolution (or cross-correlation) operation is to first study some traditional computer vision and image processing techniques, so maybe you should pick a book that covers them.

In this answer, I briefly try to describe what a CNN is and what it can be used for. There are other answers on this site, such as this, this, and this, which you may want to read, if not now later, to understand even more all the details of CNNs. A decent reference book that covers CNNs (and other DL topics) is Deep Learning by Ian Goodfellow et al.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .