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.
Typical layer sequence
Input → convolution → nonlinear activation → optional pooling → further feature extraction → classifier.
| Layer | Operation | Learned parameters? |
|---|---|---|
| Convolution | Multiply a local window by a filter, sum and add its bias | Filter weights and usually one bias per filter |
| ReLU | Replace negative values by zero | No ordinary ReLU parameters |
| Pooling | Summarize each window by maximum or average | None for ordinary max/average pooling |
| Flatten | Rearrange H × W × C values into a vector | None |
| Dense layer | Form weighted combinations of all incoming values | Weights and receiving-neuron biases |
| Softmax | Convert class scores into probabilities | No 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.