Another interesting aspect of this to consider is that we need to “flatten” the images into vectors in order for the algorithm to handle them. So you might think that doing that obscures the geometric relationships between the pixels, but the algorithm is still able to figure them out. In fact there are more ways than one to do that flattening operation, but as long as you consistently handle all the data the same way the algorithm can still learn. Here’s a thread which discusses the flattening operations in more detail. Make sure to read all the posts to see the discussion of the “F” versus “C” unrolling order.