In a Convolutional Neural Network (CNN) architecture, what is the primary function of the fully connected (dense) layer located at the very end of the network?
Select an answer to reveal the explanation.
Short Explanation
You use the final fully connected layer to combine high-level features learned earlier and make the final classification or regression prediction. Without it, you'd have features but no final answer.
Full Explanation
Convolutional Neural Networks are structured into two main parts: feature extraction and classification. The early and middle layers—composed of convolutional and pooling layers—perform feature extraction. Convolutional layers apply filters to capture local patterns such as edges, shapes, and complex textures, while pooling layers reduce spatial dimensions and introduce translation invariance.
Once convolutional layers process input, final feature maps represent high-level, abstract features of the image. However, these features remain in multi-dimensional grid format. To make prediction, the network must flatten output and pass it to one or more fully connected dense layers. The fully connected layer connects every input node to every output node, allowing it to learn non-linear combinations of these high-level features and map them to target classes or regression outputs, often using Softmax activation to output class probabilities for classification tasks.
The correct choice is the one describing combining high-level abstract features learned by prior layers and performing final classification or regression prediction.
The choice describing reduction of spatial dimensionality of input feature maps using pooling operations is incorrect because that is the function of pooling layers, such as max pooling or average pooling, not fully connected layers. The choice describing extraction of low-level features such as lines, edges, and color gradients from raw input pixels is incorrect because that is the responsibility of initial convolutional layers, which detect basic patterns like edges and curves. The choice describing data augmentation by generating transformed versions of input image is incorrect because data augmentation is preprocessing technique performed on input dataset before it enters neural network to artificially expand training set size and prevent overfitting, not something handled by final fully connected layer.