liveBook · Manning

Convolutional neural network

As explained in Grokking AI Algorithms, Second Edition

A convolutional neural network is a neural-network architecture that applies learned convolutional filters and typically pooling operations to detect spatial patterns in structured data such as images.

A convolutional neural network (CNN) analyzes nearby parts of structured data with sliding, learned filters. It preserves spatial relationships instead of treating every input as an unrelated list of values, making it especially useful for images. section 9.29 section 12.13

A CNN processes an image in two especially important ways:

  • Convolution examines a pixel together with neighboring pixels, using filters to detect features such as edges and other visual patterns. section 9.29
  • Pooling downsamples the detected patterns by summarizing features, encoding distinctive visual signatures more concisely. section 9.29
  • Successive layers can detect increasingly complex features, moving from simple edges toward objects such as faces and cars. section 12.13

Following a visual pattern

Imagine an image containing a recognizable object. A filter slides across local pixel regions and responds to useful patterns, such as edges. Pooling summarizes those responses, while later layers combine the simpler patterns into a distinctive object signature. The resulting representation can support image classification. section 9.29 section 12.13

CNNs support image classification, optical character recognition, and medical-image analysis. They can also detect local word patterns for text classification, although they are less suitable for complex long-range sentence meaning. Unlike ordinary linear feed-forward layers, convolutional layers analyze regions independently while retaining pixel positions. section 9.29 section 12.13 section 11.11

Figure 9.33 Simple example of a CNN
09_33

Use the diagram to trace how convolution and pooling turn image patterns into a concise learned representation. section 9.29

Figure 12.23 The difference between an ANN and a CNN
12_23

Use the comparison to see how a convolutional layer preserves spatial structure while a linear layer processes inputs uniformly. section 12.13

How Grokking AI Algorithms, Second Edition covers it

How deep it goes
Explains local convolution, pooling, feature hierarchies, and spatial structure without detailing filter-learning mathematics or implementation code.
Examples
Uses pixels, neighboring regions, edges, faces, cars, X-rays, body scans, and local word patterns as examples.
What you can do after
Evaluate when spatial feature detection suits image classification, OCR, medical scans, or local-pattern text classification.
How it connects
Connects convolution and pooling with image classification, optical character recognition, U-Net, diffusion, and text classification.

Also explained in

Compare how 18 books explain convolutional neural network →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking AI Algorithms, Second Edition. The section links point to the parts of the book it draws on.