A convolutional neural network (CNN) extends a deep-learning model with layers for localized feature extraction. It is typically used for 2D image processing, where it can improve classification and related tasks. CNNs are valuable but difficult to configure because layer type, size, placement, and hyperparameters interact. section 7.6 section 7.0
A practical CNN can be assembled as a Keras Sequential model: convolution layers extract features, max-pooling layers reduce the intermediate output, and Flatten plus Dense layers produce class outputs. For Fashion-MNIST, input images are normalized and reshaped from 2D arrays to 28×28×1 tensors so the channel dimension is explicit. section 7.1
Architecture choices require inspection rather than assuming a larger model is better:
- Compare model summaries to track output shapes and trainable parameter counts across convolution and pooling layers. section 7.1
- Watch training and validation results for memorization: a one-convolution-layer model can exceed 6 million parameters, fit reduced training data nearly perfectly, and perform poorly on validation data. section 7.1.1
- Use pooling and, where appropriate, batch normalization to alter model size and layer behavior; adding pooling in the demonstrated model reduces its parameter count to about one quarter. section 7.1.1
CNN architecture can also be searched through neuroevolution. Encode a variable-length sequence of convolution, pooling, batch-normalization, and dense-layer blocks, with values for filters or neurons and kernel sizes. A decoder reads those blocks and builds the Keras model; genetic operators can then optimize architectures for a dataset. section 7.2 section 7.6
A small Fashion-MNIST CNN
Start with 1,000 training and 100 test examples to keep repeated experiments tractable. Build three Conv2D layers with 64, 32, and 16 filters, place max pooling after each, then add Flatten, a 128-unit Dense layer, and a 10-output Dense layer. Inspect the resulting 23,728 trainable parameters before training. section 7.1
Inspect the variable-length encoding to see how negative block identifiers separate CNN layer types from their hyperparameter values before decoding an architecture. section 7.2

















