2
$\begingroup$

This might be a stupid question, and I might have read too much about neural networks and CNNs today so my mind is a bit of a mess. But I get that neural networks contains neurons or nodes. They calculate a dot product and sends the output further into the network.

But what about CNNs? The initial convolution layer will use a kernel convolution to go over the binary pixel data and calculate a dot product based on the weights in the kernel / filter, and the numbers from the binary pixel data.

And after this we get a feature map, we can have several feature maps that find certain features or patterns, and we can pool and use other functions further on in the network to achieve certain predictions.

But where are the neurons in the CNN? Aren't there "just" convolutional, pooling, flattened layers, and a final fully connected network?

$\endgroup$
6
  • 1
    $\begingroup$ In short, yes. You may additionally have a bias being added. $\endgroup$ Feb 16, 2023 at 20:52
  • 1
    $\begingroup$ The pixels itself represent neurons. $\endgroup$ Feb 16, 2023 at 21:17
  • $\begingroup$ @MuhammadIkhwanPerwira So the pixel in the generated feature map represent one neuron, or what? $\endgroup$ Feb 16, 2023 at 21:32
  • 2
    $\begingroup$ stats.stackexchange.com/a/409172/247274 $\endgroup$
    – Dave
    Feb 16, 2023 at 23:41
  • 1
    $\begingroup$ Does this answer your question? Can neurons in MLP and filters in CNN be compared? I believe this is a duplicate of the linked question or at least the answers there (one of them is mine) should answer your question, so you should mark this as a duplicate $\endgroup$
    – nbro
    Feb 20, 2023 at 11:22

2 Answers 2

5
$\begingroup$

There are no stupid questions :)

As @MuhammadIkhwanPerwira pointed out, the pixels themselves can be thought of as "neurons". His answer to your follow-up question is also valid: generally yes the pixels in the feature map can be thought of similarly to the neurons in the hidden layers of a fully-connected layer, but this analogy starts to break down a bit when you introduce channels.

The key difference with classical (fully-connected neural nets) is that convolution enables parameter sharing, so you no longer have "edges" (parameters) connecting each input node to each output node, but rather you build each output node (pixel) by sliding your (parametrised) kernel across the input nodes (pixels).

$\endgroup$
2
$\begingroup$

If you think about it too much, there aren't neurons in any neural network. There are just weight matrices, and activation functions.

In a traditional NN, we can take a each column of the weight matrix, combined with an application of the activation function, and call that a neuron.

In a CNN, the same weight matrix is used over and over, many times. If you like, you can call each time it's used a separate neuron (all having the same weights) or you can call it the same neuron being used multiple times. It doesn't matter what you call it, though, since the point is the convolution itself.

$\endgroup$

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