Solved – Difference between Conv and FC layers

conv-neural-networkconvolutionneural networks

What is the difference between conv layers and FC layers?

Why cannot I use conv layers instead of FC layers?

Best Answer

A convolutional layer applies the same (usually small) filter repeatedly at different positions in the layer below it. E.g. if the input layer has dimensions 512 x 512, you could have a conv layer that applies the same 8 x 8 filter (specified by 64 filter coefficients), at each point in (e.g.) a 128 x 128 grid overlaid on the input layer. On the other hand, each node in a fully connected layer would learn 512 x 512 weights, one for each of the nodes in the input layer.

Conv layers therefore are well suited to detect local features that may appear anywhere in the input (e.g. edges in a visual image). The idea is that you don't have to train every node separately to detect the same feature, but rather you learn one filter that is shared among all the nodes.

(Note that each conv layer usually learns a set of several filters, each of which gets applied repeatedly across the input. E.g. if the conv layer learns 16 different features, it is said to have a 'depth' of 16.)

FC layers are used to detect specific global configurations of the features detected by the lower layers in the net. They usually sit at the top of the network hierarchy, at a point when the input has been reduced (by the previous, usually convolutional layers) to a compact representation of features. Each node in the FC layer learns its own set of weights on all of the nodes in the layer below it.

So you can (roughly) think of conv layers as breaking the input (e.g. an image) up into common features, and the FC layers as piecing those features together into e.g. objects that you want the network to recognize.

Related Question