AI360Xpert
Core ML

Convolutional Neural Networks

Neural networks that scan an image with small pattern-detectors, so they recognize a cat whether it sits in the corner or the center.

A small filter slides across an image, producing a feature map that pooling shrinks before a final classification
A small filter slides across an image, producing a feature map that pooling shrinks before a final classification

Why Does This Exist?

Suppose you flatten a modest 200x200 color image into a long list of numbers and feed it to a plain MLP. The first layer alone needs a weight for every pixel times every neuron, which is millions of parameters before you've done anything useful. Worse, the MLP treats the top-left pixel as completely unrelated to the top-right one, so if it learns to spot a cat's ear in one corner, it has no idea how to spot the same ear somewhere else.

Convolutional neural networks (CNNs) fix both problems with a single idea: scan the image with small, reusable pattern-detectors. The same detector slides across the whole image, so a feature learned in one spot is recognized everywhere, and you need far fewer weights.

Think of It Like This

Sliding a stencil across a photo

Imagine a little stencil cut in the shape of an edge. You slide it across every part of a photo and, at each position, note how well the photo matches the stencil. Where it lines up, you get a bright spot; where it doesn't, nothing. Slide a few dozen different stencils and you end up with a map of where each pattern lives. That sliding-and-matching is a convolution.

How It Actually Works

  • Filters (kernels) are small grids of weights, often 3x3. A filter slides over the image and, at each position, multiplies-and-sums the pixels it covers into a single number. The grid of those outputs is a feature map showing where the filter's pattern appears.
  • Weight sharing is the key trick: the same filter is reused at every position. That's what gives translation invariance (a pattern is found wherever it sits) and keeps the parameter count tiny compared to a fully-connected layer.
  • Stacking builds a hierarchy. Early layers detect simple things like edges; deeper layers combine those into textures, then object parts like an eye or a wheel, then whole objects.
  • Pooling periodically shrinks the feature maps, keeping the strongest signals while reducing the amount of data to process.

Features build up with depth

Step 1 of 3

Early layers

Detect the simplest patterns — edges, corners, and colors.

Show all steps
  1. Early layers: Detect the simplest patterns — edges, corners, and colors.
  2. Middle layers: Combine those edges into textures and simple shapes.
  3. Deep layers: Assemble shapes into recognizable object parts, then whole objects.

When to Use This

  • Your input has grid-like spatial structure, such as images or audio spectrograms
  • The same pattern can appear anywhere in the input
  • You want strong results without an enormous training set
  • You need far fewer parameters than a fully-connected network

Watch Out For

Translation-invariant, not rotation-invariant

A CNN recognizes a shape wherever it slides, but flip or rotate the object and it can be fooled. Data augmentation, such as rotating and flipping training images, is the usual fix.

Mind the receptive field

Each neuron only "sees" a small patch of the image early on. Understanding a large object requires enough depth or pooling for later neurons to take in the whole thing.

The Quick Version

  • CNNs scan inputs with small filters instead of wiring every pixel to every neuron.
  • Sharing one filter across the whole image gives translation invariance and slashes the parameter count.
  • Stacked layers grow from edges to textures to whole objects.
  • Pooling shrinks the data while keeping the strongest signals.
  • They dominate image tasks but aren't naturally robust to rotation.

What to Read Next