A convolutional neural network (CNN) is a deep-learning model primarily used for image and video processing. It learns patterns directly from raw images, making it useful for computer-vision tasks such as classification, detection, and recognition. section 8.6 section 8.1.1
A typical CNN processes an image through these stages:
- Represent the image as a three-dimensional tensor containing width, height, and RGB channels. section 8.6.1
- Slide small filters, commonly 3 × 3 or 5 × 5, across the image; element-wise multiplication and summation produce feature maps for lines, edges, curves, or textures. section 8.6.1
- Apply ReLU to introduce nonlinearity, then use pooling—often max pooling—to reduce spatial dimensions, computation, and overfitting. section 8.6.1
- Flatten the resulting maps and pass them to a fully connected layer for high-level image classification. section 8.6.1
- Use an output function such as softmax to assign probabilities to classes. section 8.6.1
Classifying an image
For a cat-versus-dog classifier, convolutional filters extract visual features, later layers combine them for classification, and softmax reports the probability of each class. Applying the same filter across image regions reduces the number of parameters compared with a traditional neural network. section 8.6.1
Figure 8.13 CNN process. The original data is 6 × 6, and the filter applied is 3 × 3, which results in a 4 × 4 output.
Inspect the 6 × 6 input and 3 × 3 filter example to see how convolution produces a 4 × 4 output. section 8.6.1

















