3
$\begingroup$

I have implemented a CNN for image classification. I have not used fully connected layers, but only a softmax. Still, I am getting results.

Must I use fully-connected layers in a CNN?

$\endgroup$
  • $\begingroup$ Depends on what you want to do. If you want to classify images, FC is simply a convenient way of making all the outputs of the previous layer contribute to the final classification. Convolutional layers on the other hand, have a sparser connectivity, so you can't use them. However FC layers aren't the only way to classify the features extracted by the CNN. I've seen other classifiers being used besides FC as well. That being said there are many tasks, besides classification, where CNNs are used without FC layers. One example is image segmentation. $\endgroup$ – Djib2011 Aug 7 at 9:47
1
$\begingroup$

The reasons people use the FC after convolutional layer is that CNN preserves spatial information. You said you use softmax, so you probably make some classification task. If you don't use FC layer, then you probably evaluate first class by first position of the first kernel, not by whole image with all kernels, second class by second position of the kernel and so on.

The dense net combine the info from all the kernels in all positions.

That said, you technically can convert FC to Conv net, as described here, so then you can said you "skipped" FC layer.

$\endgroup$
1
$\begingroup$

In theory, you do not need fully-connected (FC) layers. FC layers are used to introduce scope for updating weights during back-propagation, due to its ability to introduce more connectivity possibilities, as every neuron of the FC is connected every neuron of the further layers.

$\endgroup$

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.