Deep Learning · TEE · section

Model answer: CNN structure and parameter sharing

Convolutional neural networks

Question

Question. Explain the main layers of a convolutional neural network and why CNNs are suitable for image data. Compare them with a fully connected image network.

Answer — step by step

A CNN processes spatially arranged data using filters that examine local regions. The same filter weights are reused at different positions. This combination of local connectivity and weight sharing builds an image-specific structure into the model and can greatly reduce the number of learned weights.

The highlighted patch uses the same filter that will be reused at the next position. Tap the diagram to enlarge.

Typical layer sequence

Input → convolution → nonlinear activation → optional pooling → further feature extraction → classifier.

LayerOperationLearned parameters?
ConvolutionMultiply a local window by a filter, sum and add its biasFilter weights and usually one bias per filter
ReLUReplace negative values by zeroNo ordinary ReLU parameters
PoolingSummarize each window by maximum or averageNone for ordinary max/average pooling
FlattenRearrange H × W × C values into a vectorNone
Dense layerForm weighted combinations of all incoming valuesWeights and receiving-neuron biases
SoftmaxConvert class scores into probabilitiesNo additional weights of its own

Early filters can learn local patterns such as edges. Later layers combine features over larger receptive fields. A filter responding at several image positions uses one shared set of weights, not a new set at every location.

Flattening an image and using a dense layer does not enforce this local, shared structure. A dense layer has a separate connection weight for each input–output pair. CNNs can therefore be more parameter-efficient for visual patterns, although they still need suitable data and training. Pooling can provide some robustness to small shifts; it does not guarantee complete invariance to every translation.