LeNet-5
The 1998 seven-layer convolutional network for handwritten characters that most CNN classifiers still echo.
Image classification · 12 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Image classification
- Parameters
- 61.7K
- Operations
- 12
- Framework
- PyTorch
- Recurrent
- No
- Published
- 1998, Proceedings of the IEEE
- Cited by
- 62,996 (as of 4 October 2026)
- Authors
- Yann LeCun, Léon Bottou, Yoshua Bengio, Patrick Haffner
- License
- Apache-2.0
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m1573
- Graph hash
- 47b048f7863f8fa9611528cd819a3db8c7c06da28824c6697b4a90de1e0f6f2a
- Skeleton hash
- bd5c689096fcd471a2f7e5cd090bb5c2294eb0d65e7aab20d40e63999759b147
- Architecture hash
- 5cc14e23977fc2eafa58028f11d37cc9a900f1009d12005369ff91f0b1183896
- Diagram SHA-256
- bc5aa0a7cc7c789fcc045a3d1d2978f87fe299478578fd956cf3008ee119880b
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
LeNet-5 is the convolutional network of Yann LeCun, Léon Bottou, Yoshua Bengio and Patrick Haffner's 1998 paper "Gradient-based learning applied to document recognition", among the first published CNNs to capture wide attention for its performance on computer vision tasks. LeCun's own page introduces it as the group's latest convolutional network, designed for handwritten and machine-printed character recognition, and shows it in action. At the time it matched the performance of support vector machines, then a dominant approach in supervised learning, with an error rate of less than 1% per digit, and it was eventually adapted to recognize digits for processing deposits in ATM machines.
The network comprises seven layers, not counting the input, all of which carry trainable weights, and its input is a 32 by 32 pixel image, significantly larger than the largest character in the database. Layer C1 is a convolutional layer with six feature maps, each unit connected to a 5 by 5 neighbourhood of the input, and S2 is a subsampling layer that reduces them to six maps of size 14 by 14. C3 is a convolutional layer with 16 feature maps, each connected to 5 by 5 neighbourhoods in only a subset of S2's maps, so that different feature maps are forced to extract different features. After S4, layer C5 has 120 feature maps that amount to a full connection with S4, layer F6 contains 84 units, and the output layer is composed of Euclidean RBF units. The squashing function throughout is a scaled hyperbolic tangent, with the constant chosen to be 1.7159.
Modern re-implementations simplify this: Dive into Deep Learning describes LeNet as a convolutional encoder of two convolutional layers and a dense block of three fully connected layers with 120, 84 and 10 outputs, using sigmoid activations and average pooling because ReLUs and max-pooling had not yet been discovered. The capture here is a ten-class classifier that takes the paper's 32 by 32 single-channel input. A slightly modified LeNet-5 port saved alongside reports an accuracy of about 99% on the MNIST dataset.
Key idea. A seven-layer convolutional network, trained with a version of the back-propagation algorithm, that recognizes characters directly from pixel images with minimal preprocessing.
- lenet
- lenet-5
- lenet5
- lecun
- mnist
- handwritten digits
- character recognition
- document recognition
- classic cnn
AI-written summary, checked automatically against its sources; not reviewed by a person. Corrections welcome.
Cite the paper
@article{Lecun_1998, title={Gradient-based learning applied to document recognition}, volume={86}, ISSN={0018-9219}, url={http://dx.doi.org/10.1109/5.726791}, DOI={10.1109/5.726791}, number={11}, journal={Proceedings of the IEEE}, publisher={Institute of Electrical and Electronics Engineers (IEEE)}, author={Lecun, Y. and Bottou, L. and Bengio, Y. and Haffner, P.}, year={1998}, pages={2278–2324} }