I've started to research ANNs and specifically Deep Learning. I'm confused however about the exact input of such nets. When reading about ANNs we keep hearing how good they can be for the classic MNIST digit classification problem and how a 28x28 grey scale image becomes a 784 input ANN. My question is - how does the 784 input nodes 'know' that say pixels 1 & 29 are on top of each other, for it to go on and find higher abstracted patterns..? No where in the input do we specify "pixel location" if you will...?

When I read about ConvNets I see they use a sliding 3x3 pixel map etc as a method to get that 'location' information....is it therefore a matter of all ANNs use this and its explicity called out when discussing ConvNets...or does the standard MNIST problem solve it differently - as I don't believe some of the examples Ive seen state that ConvNets are being used for digit classification..?

I'm not sure if I've phrased this correctly - hopefully someone could shed some light.


  • $\begingroup$ The output of a convolution layer is an activation pattern with similar spatial relationships as the input. $\endgroup$ – Pieter Jan 24 '17 at 6:57

There are different network topologies that can profit from the input information in different ways.

If your input layer is dense, like in a multilayer perceptron, the units don't know the spatial relationships among pixels. This way, you feed your input dense layer with a vector or a matrix, the shape is not important.

However, ConvNets explicitly exploit those relationships. If you have a convolutional layer, you feed it with a matrix (2D if it's grayscale, 3D if it's color). The ConvNet applies patches (small 2D matrices) to the input matrix. What you train in a ConvNet are the values in the patches. The patches are applied in a sliding window fashion, outputting the values of a new matrix (that can then be fed to another convolutional layer).

The power of ConvNets is precisely that they exploit information locality to detect features.

| cite | improve this answer | |
  • $\begingroup$ OK, this is starting to make sense and not too far from what I had thought...ConvNets explicitly make use of the location of inputs...so in a ConvNet is the Input individual pixels...or small 2x2 or 3x3 filters..? $\endgroup$ – PaulB. Jan 23 '17 at 14:35
  • $\begingroup$ A convolutional layer is composed of patches. These are usually small: 3x3, 5x5 at most. The patches are applied to the input matrix in order to generate a new matrix, which is then fed to the next layer. The convolutional layer are the patches. The result of applying the convolutional layer to an input matrix is another matrix. $\endgroup$ – ncasas Jan 23 '17 at 14:37
  • $\begingroup$ Note that the result of applying the convolutional layer is as many output matrices as the number of patches in the convolutional layer. $\endgroup$ – ncasas Jan 23 '17 at 14:42
  • $\begingroup$ OK thanks for this - really helps me to understand - its surprising because I thought I had a pretty good grasp of what ANNs and Deep learning is doing...I just hadn't given thought to the 'spatial' aspect of the inputs before.. $\endgroup$ – PaulB. Jan 23 '17 at 14:49
  • 1
    $\begingroup$ You can find plenty of material about convnets in cs231n.github.io/convolutional-networks $\endgroup$ – ncasas Jan 23 '17 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.