CNN - Convolutional Neural Networks CNN Architecture Fundamentals Questions and Answers — Questions and Answers
Question 1: In a typical Convolutional Neural Network (CNN) architecture, what is the primary function of the pooling layer?
- To introduce non-linearity into the model.
- To reduce the spatial dimensions of the feature maps. (Correct answer)
- To perform classification based on extracted features.
- To extract features like edges and textures from the input image.
Correct answer: To reduce the spatial dimensions of the feature maps.
The pooling layer, also known as a downsampling layer, is primarily used to reduce the spatial dimensions (width and height) of the input feature maps. This process helps to decrease the computational complexity, control overfitting, and create an invariance to small translations in the input image.
Question 2: A data scientist is designing a CNN to classify high-resolution medical images. They are concerned about losing important information at the borders of the images during the convolution operations. Which technique should they employ to mitigate this issue?
- Increasing the stride of the convolution.
- Using a larger pooling window.
- Adding a padding layer around the input images. (Correct answer)
- Implementing a dropout layer after the convolutional layer.
Correct answer: Adding a padding layer around the input images.
Padding involves adding extra pixels (usually zeros) around the border of an input image. This technique ensures that the filter can process the pixels at the edges of the image more effectively, preventing the spatial dimensions from shrinking with each convolution and preserving information at the borders.
Question 3: Which of the following best describes the role of the convolutional layer in a CNN?
- To flatten the multi-dimensional feature maps into a one-dimensional vector.
- To apply a set of learnable filters to the input data to create feature maps. (Correct answer)
- To reduce the number of parameters in the network through downsampling.
- To classify the input by connecting every neuron from the previous layer.
Correct answer: To apply a set of learnable filters to the input data to create feature maps.
The convolutional layer is the core building block of a CNN. Its primary function is to apply a series of learnable filters (or kernels) that slide over the input image to detect specific features like edges, corners, and textures, resulting in feature maps.
Question 4: What is the main purpose of using the ReLU (Rectified Linear Unit) activation function in the hidden layers of a CNN?
- To normalize the output of the layer to have a mean of zero.
- To convert the output into a probability distribution for classification.
- To introduce non-linearity, allowing the network to learn more complex patterns. (Correct answer)
- To significantly increase the number of parameters for better feature extraction.
Correct answer: To introduce non-linearity, allowing the network to learn more complex patterns.
The ReLU activation function introduces non-linearity into the network. Without a non-linear activation function, a deep CNN would behave like a single, equivalent convolutional layer, limiting its ability to learn complex relationships in the data. ReLU is computationally efficient and helps mitigate the vanishing gradient problem.
Question 5: In the context of a convolutional operation, what does the 'stride' parameter define?
- The number of filters applied to the input volume.
- The number of pixels by which the filter slides over the input at each step. (Correct answer)
- The amount of zero-padding added to the borders of the input.
- The size of the pooling window used for downsampling.
Correct answer: The number of pixels by which the filter slides over the input at each step.
The stride defines the step size the convolutional filter moves across the input image. A stride of 1 means the filter moves one pixel at a time. A larger stride (e.g., 2) means the filter jumps 2 pixels at each step, resulting in a smaller output feature map and reduced computation.
Question 6: Towards the end of a CNN architecture, after the convolutional and pooling layers have extracted features, which layer is typically responsible for taking these high-level features and performing the final classification task?
- Another convolutional layer
- A max-pooling layer
- An activation layer like ReLU
- A fully connected (dense) layer (Correct answer)
Correct answer: A fully connected (dense) layer
The fully connected (or dense) layer takes the high-level features from the preceding layers (which are often flattened into a 1D vector) and performs the final classification. Each neuron in a fully connected layer is connected to all neurons in the previous layer, allowing it to learn non-linear combinations of these features to make a prediction.
In a typical Convolutional Neural Network (CNN) architecture, what is the primary function of the pooling layer?