The fully connected layer of a CNN works in the same manner as that of a vanilla feedforward network. This layer maps the outputs extracted from the image to the outputs that we desire from the network, such as a label for an image:
In the preceding diagram, our inputs are represented by the blue nodes, which are fed into the first convolutional layer, A. We then have a max pooling layer, a second convolutional layer, and finally the fully connected layer, which transforms our output into human– readable output. As with vanilla feedforward networks, we typically use a cross-entropy loss function for classification tasks.