← Neural NetworksToolsInVisionLearning Center
Convolutional Neural Networks · Lesson 55

LeNet and a Complete Convolutional Network

Trace a simplified modern LeNet-style classifier from a 32 × 32 grayscale input to ten digit scores.

Watch the lesson

LeNet and a Complete Convolutional Network explained visually

2:28

Trace a simplified modern LeNet-style classifier from a 32 × 32 grayscale input to ten digit scores.

Lesson overview

What you will learn

Follow filters, pooling, flattening, and classification through complete CNN examples.

  1. Set up the teaching architecture
  2. Follow the first convolution and pooling stage
  3. Calculate the second stage and feature count
  4. Connect features to the digit decision
01

Set up the teaching architecture

Handwritten digits vary in shape and orientation. A learned recognizer uses examples to handle variation instead of requiring a separate visual rule for every style of writing.

This lesson uses a simplified modern LeNet-style model with ReLU and max pooling. It illustrates the LeNet approach and does not reproduce every detail of the original architecture.

02

Follow the first convolution and pooling stage

Start with one 32 × 32 grayscale image. Six 5 × 5 filters with stride 1, no padding, and no dilation produce 6 feature maps of shape 28 × 28, because 32 − 5 + 1 = 28.

Apply an activation, then a 2 × 2 pooling operation with stride 2. Each map becomes 14 × 14, and the number of maps remains 6.

03

Calculate the second stage and feature count

The next convolution produces 16 maps. A 5 × 5 filter with stride 1 and no padding turns 14 × 14 into 10 × 10. A second 2 × 2 pooling step with stride 2 produces 16 maps of shape 5 × 5.

There are 16 × 5 × 5 = 400 values. Flattening the feature dimensions produces a 400-element vector for each image.

04

Connect features to the digit decision

Fully connected layers combine the feature vector. The final layer produces 10 scores, one for each digit from 0 through 9.

The complete sequence connects local filtering, activations, spatial reduction, flattening, and classification. The filters are learned during training. The next lesson considers image recognition at a larger scale with AlexNet.

Knowledge check

Quick check: test your understanding

What shape follows the first convolution?

6 maps of shape 28 × 28, using the specified 5 × 5 filters, stride 1, and no padding.

Why does flattening produce 400 features?

There are 16 maps with 5 × 5 = 25 values each; 16 × 25 = 400.

Is this an exact reproduction of original LeNet?

No. It is an explicitly simplified modern LeNet-style teaching model using ReLU and max pooling.

Accessible referenceLesson 55 transcript320 words · Matches the published narration and captionsOpen transcript

Imagine recognizing a handwritten seven. One person writes it with a narrow shape. Another adds a horizontal stroke. A third writes it at an angle. A useful digit recognizer must learn patterns that remain helpful across these variations. Le Net is a classic example of a neural network designed for handwritten digit recognition. We will use a simplified modern teaching version to connect the ideas from our recent lessons.

Start with a grayscale image that is thirty two pixels wide and thirty two pixels high. The first convolution uses six filters. Each filter is five by five. With a stride of one and no padding, the layer produces six feature maps that are twenty eight by twenty eight.

An activation introduces a nonlinear transformation. A pooling layer then uses a two by two window with a stride of two. Each feature map becomes fourteen by fourteen. The next convolution produces sixteen feature maps. Using five by five filters, a stride of one, and no padding reduces their spatial size to ten by ten.

A second pooling stage reduces each map to five by five. We now have sixteen maps, each containing twenty five values. Sixteen times twenty five gives four hundred values. Flattening arranges them into a vector of length four hundred. Fully connected layers use these features to produce ten final class scores, one for each digit from zero through nine.

Notice the overall progression. The network begins with pixels, extracts local patterns, combines information, reduces spatial size, and makes a classification. The filters are learned from examples. We do not manually write a rule for every possible way of drawing a seven. This teaching version uses rectified linear activations and max pooling. It illustrates the main structure, but it does not reproduce every detail of the original Le Net design. In the next lesson, we will move from handwritten digits to large scale image classification with Alex Net.